[ http://issues.apache.org/jira/browse/XALANJ-1172?page=all ]
Morris Kwan closed XALANJ-1172:
-------------------------------
Assign To: (was: Xalan Developers Mailing List)
> TCK: Output method is not set to html when it should
> ----------------------------------------------------
>
> Key: XALANJ-1172
> URL: http://issues.apache.org/jira/browse/XALANJ-1172
> Project: XalanJ2
> Type: Bug
> Components: transformation, Xalan-interpretive
> Versions: Latest Development Code
> Environment: Operating System: All
> Platform: All
> Reporter: Morris Kwan
>
> From Section 16 (for xsl:output) of the XSLT 1.0 spec:
> The default for the method attribute is chosen as follows. If
> 1. the root node of the result tree has an element child,
> 2. the expanded-name of the first element child of the root node (i.e. the
> document element) of the result tree has local part html (in any combination
> of
> upper and lower case) and a null namespace URI, and
> 3. any text nodes preceding the first element child of the root node of the
> result tree contain only whitespace characters,
> then the default output method is html; otherwise, the default output method
> is
> xml.
> -------------------------------------------------------------------------------
> In the following example program, the output method should be set to "html".
> It
> is currently set to "xml".
> Demonstration code:
> import javax.xml.transform.*;
> import javax.xml.transform.stream.*;
> import java.util.*;
> import java.io.*;
> public class OutputPropertiesTest
> {
> private static String XSL1 = "<?xml version='1.0'?>\n"
> + "<xsl:stylesheet version='1.0'"
> + "
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>\n"
> + " <xsl:template match='/'>\n"
> + "\n"
> + "<html>\n"
> + " <body><xsl:copy-of select='/info/*'/></body>\n"
> + "</html>\n"
> + "\n"
> + " </xsl:template>\n"
> + "</xsl:stylesheet>\n";
>
> public static void main(String[] args)
> {
> StreamSource source = new StreamSource(new StringReader(XSL1));
>
> Templates templates = null;
> try {
> templates = TransformerFactory.newInstance().newTemplates(source);
> }
> catch (TransformerException e) {
> System.out.println("Error: TransformerException is thrown");
> }
>
> Properties properties = templates.getOutputProperties();
> String method = properties.getProperty("method");
> System.out.println("The method property is: " + method);
> }
> }
> =====================================================================
> Expected output:
> The method property is: html
> Current output:
> The method property is: xml
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]