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

wrong javax.xml.transform.TransformerConfigurationException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 1.4.0
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.4
    • CPU:
      x86
    • OS:
      windows_xp
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.6.0_01"
        Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
        Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        MS Windows / XP

        A DESCRIPTION OF THE PROBLEM :
        The given program fails on the following statement in the stylesheet.

            not(preceding-sibling::* or following-sibling::*)

        It runs fine on the following parenthesized variant.

            not((preceding-sibling::*) or following-sibling::*)



        -----------------Test.java------------------
        import java.io.*;
        import javax.xml.transform.*;
        import javax.xml.transform.stream.*;

        public class Test {
           public static void main(String[] args)
                throws TransformerConfigurationException,
                      TransformerException {
            try{
               StreamSource xslt = new StreamSource(new File("test.xslt"));
               TransformerFactory fc = TransformerFactory.newInstance();
               Transformer transformer = fc.newTransformer( xslt );
            } catch (Exception e){
               System.err.println(e);
        } } }

        --------------------test.xslt--------------------

        <?xml version="1.0" encoding="UTF-8"?>
        <xsl:stylesheet version="1.0"
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:xlink="http://www.w3.org/1999/xlink"
           >
              <xsl:output omit-xml-declaration = "yes" />
        <xsl:template match="mo" >
           <xsl:choose>
              <xsl:when test="not(preceding-sibling::* or following-sibling::*)" >
              </xsl:when>
            </xsl:choose>
        </xsl:template>
        </xsl:stylesheet>



        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        javac Test.java
        java Test


        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        java Test
        ERROR: 'Syntax error in 'not(preceding-sibling::* or following-sibling::*)'.'
        FATAL ERROR: 'Could not compile stylesheet'
        javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        -----------------Test.java------------------
        import java.io.*;
        import javax.xml.transform.*;
        import javax.xml.transform.stream.*;

        public class Test {
           public static void main(String[] args)
                throws TransformerConfigurationException,
                      TransformerException {
            try{
               StreamSource xslt = new StreamSource(new File("test.xslt"));
               TransformerFactory fc = TransformerFactory.newInstance();
               Transformer transformer = fc.newTransformer( xslt );
            } catch (Exception e){
               System.err.println(e);
        } } }

        --------------------test.xslt--------------------

        <?xml version="1.0" encoding="UTF-8"?>
        <xsl:stylesheet version="1.0"
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:xlink="http://www.w3.org/1999/xlink"
           >
              <xsl:output omit-xml-declaration = "yes" />
        <xsl:template match="mo" >
           <xsl:choose>
              <xsl:when test="not(preceding-sibling::* or following-sibling::*)" >
              </xsl:when>
            </xsl:choose>
        </xsl:template>
        </xsl:stylesheet>


        ---------- END SOURCE ----------

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  joehw Joe Wang
                  Reporter:
                  ndcosta Nelson Dcosta (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: