Xerces version advanced to 2.11.0

This commit is contained in:
Dmitry Avdeev
2015-04-23 15:48:25 +03:00
parent a5e1e832f0
commit ff1b3fd2a7
@@ -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<XmlElementDescriptor[]>() {
@@ -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]));
}
}