You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@locus.apache.org on 2000/02/01 15:26:27 UTC

cvs commit: xml-xalan/src/org/apache/xalan/xpath/xdom XercesLiaison.java

sboag       00/02/01 06:26:27

  Modified:    src/org/apache/xalan/xpath/dtm DTMLiaison.java
               src/org/apache/xalan/xpath/xdom XercesLiaison.java
  Log:
  Make calls to Xerces engine to enable validation if -validate flag is used, call to have entity expansion turned on (both of these seemed to have changed since the previous release of Xerces).
  
  Revision  Changes    Path
  1.9       +3 -0      xml-xalan/src/org/apache/xalan/xpath/dtm/DTMLiaison.java
  
  Index: DTMLiaison.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xpath/dtm/DTMLiaison.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DTMLiaison.java	1999/12/16 11:19:19	1.8
  +++ DTMLiaison.java	2000/02/01 14:26:26	1.9
  @@ -193,6 +193,9 @@
           if(null != m_locale)
             parser.setLocale(m_locale);
           
  +        if(getUseValidation())
  +          parser.setFeature("http://xml.org/sax/features/validation", true);
  +        
           if(m_doThreading)
           {
             parser.parse(source);
  
  
  
  1.5       +14 -3     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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XercesLiaison.java	2000/01/31 08:25:38	1.4
  +++ XercesLiaison.java	2000/02/01 14:26:26	1.5
  @@ -254,6 +254,7 @@
         isDomParser = true;
         DOMParser domParser = new MyParser();
         domParser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
  +      domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", false);
         parser = domParser;
         // ((NonValidatingDOMParser)parser).setExpandEntityReferences(true);
       }
  @@ -269,6 +270,8 @@
           saxparser.setDTDHandler(m_DTDHandler);
         }
       }
  +    if(getUseValidation())
  +      parser.setFeature("http://xml.org/sax/features/validation", true);
       
       try
       {
  @@ -391,12 +394,20 @@
     
     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;
  +      if(getUseValidation())
  +      {
  +        return super.getSchemaValidator();
  +      }
  +      else
  +      {
  +        if (fSchemaValidator == null)
  +          fSchemaValidator = new NullSchemaValidator(fStringPool, fErrorReporter, fEntityHandler);
  +        return fSchemaValidator;
  +      }
       }
     }