sboag       99/12/16 13:18:53

  Modified:    src/org/apache/xalan/xpath/xdom XercesLiaison.java
  Log:
  Overide the silly schema validator so that it won't crash when it's trying to 
use (mis-use) the namespace URLs.
  
  Revision  Changes    Path
  1.3       +24 -1     
xml-xalan/src/org/apache/xalan/xpath/xdom/XercesLiaison.java
  
  Index: XercesLiaison.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/src/org/apache/xalan/xpath/xdom/XercesLiaison.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XercesLiaison.java        1999/11/25 04:22:06     1.2
  +++ XercesLiaison.java        1999/12/16 21:18:53     1.3
  @@ -252,7 +252,7 @@
       if(null == m_docHandler)
       {
         isDomParser = true;
  -      DOMParser domParser = new DOMParser();
  +      DOMParser domParser = new MyParser();
         
domParser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion";, 
false);
         parser = domParser;
         // ((NonValidatingDOMParser)parser).setExpandEntityReferences(true);
  @@ -375,7 +375,30 @@
       return (Node.ATTRIBUTE_NODE == node.getNodeType())
              ? ((AttrImpl)node).getElement() : node.getParentNode();
     }
  +
  +  class NullSchemaValidator extends 
org.apache.xerces.validators.schema.XSchemaValidator
  +  {
  +    public NullSchemaValidator(org.apache.xerces.utils.StringPool 
stringPool, 
  +                               org.apache.xerces.framework.XMLErrorReporter 
errorReporter, 
  +                               org.apache.xerces.readers.XMLEntityHandler 
entityHandler) 
  +    {
  +        super(stringPool, errorReporter, entityHandler);
  +    }
  +  
  +    public final void loadSchema(String uri) {}
  +  }
     
  +  class MyParser extends DOMParser
  +  {
  +    /** Returns the XML Schema validator. */
  +    protected org.apache.xerces.validators.schema.XSchemaValidator 
getSchemaValidator() 
  +    {
  +      if (fSchemaValidator == null)
  +        fSchemaValidator = new NullSchemaValidator(fStringPool, 
fErrorReporter, fEntityHandler);
  +      return fSchemaValidator;
  +    }
  +  }
  +
     /**
      * Command line interfact to transform the XML according to 
      * the instructions found in the XSL document.
  
  
  

Reply via email to