Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6558593

sjsxp issue 15: Error in applying XSLT Transformer with StaXSource

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 6u4
    • Component/s: xml
    • Labels:

      Backports

        Description

        Originally sjsxp issue 15:
        The problem arises only when then the XML document has a DOCTYPE declaration (as
        in <!DOCTYPE message PUBLIC "-//TSN//DTD Statistics 1.0/EN"
        "NCAA_Conference_Schedule_XML.dtd"> ).

        Compile and run under JDK 6.0 on both linux and windows with same results.

        Code follows:
            
        inputFactory.setProperty("javax.xml.stream.isSupportingExternalEntities",Boolean.TRUE);
             inputFactory.setProperty("javax.xml.stream.isNamespaceAware",Boolean.TRUE);
            
        inputFactory.setProperty("javax.xml.stream.isReplacingEntityReferences",Boolean.TRUE);
        inputFactory.setProperty("javax.xml.stream.supportDTD", Boolean.TRUE );
        inputFactory.setXMLResolver( new MyResolver() );

        // create a StaXSource for xsl and xml, StaXResult to hold result
        transformer.transform( xml, xmlresult);

        and throws a trace like:

        ERROR: 'ParseError at [row,col]:[3,1]
        Message: expected start or end tag'
        ERROR: 'com.sun.org.apache.xml.internal.utils.WrappedRuntimeException:
        ParseError at [row,col]:[3,1]
        Message: expected start or end tag'
        javax.xml.transform.TransformerException:
        javax.xml.transform.TransformerException:
        com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: ParseError at
        [row,col]:[3,1]
        Message: expected start or end tag
        at
        com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:721)
        at
        com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
        at com.atomica.nlp.answerbase.utils.stax.StaxPlusXsl.main(StaxPlusXsl.java:108)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
        Caused by: javax.xml.transform.TransformerException:
        com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: ParseError at
        [row,col]:[3,1]
        Message: expected start or end tag

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  spericas Santiago Pericasgeertsen
                  Reporter:
                  joehw Joe Wang
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: