From ff1b3fd2a7c2ed7ad8b3f2a75cbfaeb1bc42181f Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Thu, 23 Apr 2015 15:46:34 +0300 Subject: [PATCH] Xerces version advanced to 2.11.0 --- .../psi/impl/source/xml/XsContentDFA.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XsContentDFA.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XsContentDFA.java index a6fbc0c33c46..f7f15eb3e74d 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/xml/XsContentDFA.java +++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XsContentDFA.java @@ -28,10 +28,7 @@ import com.intellij.xml.XmlElementDescriptor; import com.intellij.xml.actions.validate.ValidateXmlActionHandler; import com.intellij.xml.actions.validate.ErrorReporter; import org.apache.xerces.impl.Constants; -import org.apache.xerces.impl.xs.SubstitutionGroupHandler; -import org.apache.xerces.impl.xs.XSComplexTypeDecl; -import org.apache.xerces.impl.xs.XSElementDecl; -import org.apache.xerces.impl.xs.XSGrammarBucket; +import org.apache.xerces.impl.xs.*; import org.apache.xerces.impl.xs.models.CMBuilder; import org.apache.xerces.impl.xs.models.CMNodeFactory; import org.apache.xerces.impl.xs.models.XSCMValidator; @@ -88,7 +85,13 @@ class XsContentDFA extends XmlContentDFA { public XsContentDFA(@NotNull XSElementDeclaration decl, final XmlTag parentTag) { XSComplexTypeDecl definition = (XSComplexTypeDecl)decl.getTypeDefinition(); myContentModel = definition.getContentModel(new CMBuilder(new CMNodeFactory())); - myHandler = new SubstitutionGroupHandler(new XSGrammarBucket()); + final XSGrammarBucket bucket = new XSGrammarBucket(); + myHandler = new SubstitutionGroupHandler(new XSElementDeclHelper() { + @Override + public XSElementDecl getGlobalElementDecl(QName name) { + return bucket.getGrammar(name.uri).getGlobalElementDecl(name.localpart, name.prefix); + } + }); myState = myContentModel.startContentModel(); myElementDescriptors = ApplicationManager.getApplication().runReadAction(new Computable() { @@ -143,7 +146,13 @@ class XsContentDFA extends XmlContentDFA { } Collections.reverse(ancestors); XSElementDeclaration declaration = null; - SubstitutionGroupHandler fSubGroupHandler = new SubstitutionGroupHandler(new XSGrammarBucket()); + final XSGrammarBucket bucket = new XSGrammarBucket(); + SubstitutionGroupHandler fSubGroupHandler = new SubstitutionGroupHandler(new XSElementDeclHelper() { + @Override + public XSElementDecl getGlobalElementDecl(QName name) { + return bucket.getGrammar(name.uri).getGlobalElementDecl(name.localpart, name.prefix); + } + }); CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory()); for (XmlTag ancestor : ancestors) { if (declaration == null) { @@ -214,5 +223,4 @@ class XsContentDFA extends XmlContentDFA { } }, new XSGrammar[0])); } - }