DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12441>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12441

TCK: Should not throw exception in forward-compatible mode

           Summary: TCK: Should not throw exception in forward-compatible
                    mode
           Product: XalanJ2
           Version: CurrentCVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.transformer
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


>From Section 2.5 (Forwards-Compatible Processing) of the XSLT 1.0 spec:

An element enables forwards-compatible mode for itself, its attributes, its 
descendants and their attributes if either it is an xsl:stylesheet element 
whose version attribute is not equal to 1.0...

If an element is processed in forwards-compatible mode, then:
...
- if the element has an attribute that XSLT 1.0 does not allow the element to 
have or if the element has an optional attribute with a value that the XSLT 1.0 
does not allow the attribute to have, then the attribute must be ignored.

--------------------------------------------------------------------------

In forward-compatible mode, an unknown attribute should be ignored rather than 
throwing an exception.

Test program:

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

public class NewTransformerTest
{
   private static String XSL1 =  "<xsl:stylesheet version='2.0' "
                   + "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>"
                   + "<xsl:template a='1' match='/'>"
                   + "<H1><xsl:value-of select='//title'/></H1>"
                   + "</xsl:template>"
                   + "</xsl:stylesheet>";
                               
   public static void main(String[] args)
   {
        StreamSource source = new StreamSource(new StringReader(XSL1));
        
        Templates templates = null;
        try {
           TransformerFactory.newInstance().newTransformer(source);
           System.out.println("Passed");
        } 
        catch (TransformerException e) {
            System.out.println("Error: TransformerException is thrown");
        }
    }
}

Expected output:
Passed

Current output:
Error: TransformerException is thrown

Reply via email to