You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by ar...@apache.org on 2003/08/13 14:52:43 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/transformer TransformerIdentityImpl.java

aruny       2003/08/13 05:52:43

  Modified:    java/src/org/apache/xalan/transformer Tag: jaxp-1_3_0-branch
                        TransformerIdentityImpl.java
  Log:
  Description: Applying patch for :
  1.As per JAXP1.2 spec if Zero-argument default constructor DOMSource()
   is used, and no DOM source is set, then the Transformer will create
   an empty source Document using newDocument().
  2.As per JAXP1.2 spec, if a SAXSource is created using a SAX InputSource then
   the Transformer or SAXTransformerFactory creates a reader via
   org.xml.sax.helpers.XMLReaderFactory (if setXMLReader is not used),
   sets itself as the reader s org.xml.sax.ContentHandler , and calls
   reader.parse(inputSource).
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.24.2.1  +22 -5     xml-xalan/java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java
  
  Index: TransformerIdentityImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java,v
  retrieving revision 1.24
  retrieving revision 1.24.2.1
  diff -u -r1.24 -r1.24.2.1
  --- TransformerIdentityImpl.java	1 Apr 2003 20:26:39 -0000	1.24
  +++ TransformerIdentityImpl.java	13 Aug 2003 12:52:43 -0000	1.24.2.1
  @@ -322,6 +322,16 @@
           m_systemID = dsource.getSystemId();
     
           Node dNode = dsource.getNode();
  +        
  +      // As per JAXP1.2 spec if Zero-argument default constructor DOMSource()
  +      // is used, and no DOM source is set, then the Transformer will create
  +      // an empty source Document using newDocument().
  +        if(null == dNode){
  +            try{
  +                dNode = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  +            }
  +            catch(Exception e){ }
  +        }
     
           if (null != dNode)
           {
  @@ -383,6 +393,17 @@
           if (source instanceof SAXSource)
             reader = ((SAXSource) source).getXMLReader();
             
  +        //As per JAXP1.2 spec, if a SAXSource is created using a SAX InputSource then
  +        // the Transformer or SAXTransformerFactory creates a reader via 
  +        //org.xml.sax.helpers.XMLReaderFactory (if setXMLReader is not used), 
  +        //sets itself as the reader s org.xml.sax.ContentHandler , and calls 
  +        //reader.parse(inputSource).
  +        if (null == reader)
  +        {
  +          reader = XMLReaderFactory.createXMLReader();
  +          reader.setFeature("http://xml.org/sax/features/namespaces", true);
  +        } 
  +        
           if (null == reader)
           {
     
  @@ -410,11 +431,7 @@
             catch (AbstractMethodError ame){}
           }
     
  -        if (null == reader)
  -        {
  -          reader = XMLReaderFactory.createXMLReader();
  -        }
  -  
  +        
           try
           {
             reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org