Hi Tony,

I couldn't reproduce what you are seeing using the following:

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

public class IdentityTransform
{
    public static void main(String[] args) throws Exception {
        if (args.length != 1) {
            System.out.println("USAGE: java IdentityTransform <input file 
name>");
        }
        TransformerFactory tFactory = TransformerFactory.newInstance();
        Transformer transformer = tFactory.newTransformer();
        transformer.setOutputProperty(OutputKeys.METHOD, "html");
        transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
        transformer.transform(new StreamSource(args[0]), new 
StreamResult(System.out));
    }
}

Can you send me the java code you are using to run the identity 
transformation?  Also can you double check the version of Xalan by 
entering 'java org.apache.xalan.Version" on the command line?

Thanks.


Erin Harris





"Tony Thompson" <[EMAIL PROTECTED]> 
04/09/2007 11:23 AM

To
<xalan-j-users@xml.apache.org>
cc

Subject
HTML Serialization Issue






I am using Xalan 2.7.0 and I am having an issue when trying to serialize
an HTML document.  Below I have 2 examples of source documents that have
a comment in the style.  For both cases, I have the output method set to
"html".  In the first case, the serialized document is fine.  In the
second case, the comments in the style have been replaced with entity
references.  If I change the output to "xml", I get the same results
with the first source document (it breaks).  The transformer that is
being used is org.apache.xalan.transformer.TransformerIdentityImpl.  Is
there anything I can do to correct this or might it be an issue with the
Xalan transformer?

Thanks.
Tony


Source #1:
 
<html>
<head>
 
<style>
<!--
body { background-color: #FFFF88; }
-->
</style>
 
</head>
<body>
<!-- comment -->
Test page.
</body>
</html>


Output #1:
 
<html>
<head><META http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
 
<style>
<!--
body { background-color: #FFFF88; }
-->
</style>
 
</head>
<body>
<!-- comment -->
Test page.
</body>
</html>



Source #2:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>

<style>
<!--
body { background-color: #FFFF88; }
-->
</style>

</head>
<body>
<!-- comment -->
Test page.
</body>
</html>


Output #2:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml";>
<head>

<style>
&lt;!--
body { background-color: #FFFF88; }
--&gt;
</style>

</head>
<body>
<!-- comment -->
Test page.
</body>
</html>
 
This message (and any associated files) is intended only for the 
use of the individual or entity to which it is addressed and may 
contain information that is confidential, subject to copyright or
constitutes a trade secret. If you are not the intended recipient 
you are hereby notified that any dissemination, copying or 
distribution of this message, or files associated with this message, 
is strictly prohibited. If you have received this message in error, 
please notify us immediately by replying to the message and deleting 
it from your computer. Messages sent to and from Stoneware, Inc.
may be monitored.

Reply via email to