Stanimir is correct in saying that one can disable the HTML entities by
setting the Xalan specific transformer property:

     Transformer.setOutputProperty(
             "{http://xml.apache.org/xalan}entities";, "");

This property is documented at
http://xml.apache.org/xalan-j/usagepatterns.html#outputprops

It is documented as a property on the Xalan serializer, and it mentions
modifying the properties through editing output_html.properties It also
mentions setting Xalan specific properties via the <xsl:output ...>
element. It doesn't mention setting Xalan specific properties via JAXP, but
this is most likely just a hole in the documentation, I'll raise a JIRA
issue and get this resolved one way or the other.

Since you are already skating on the thin ice of non-portability involved
with Xalan-J.

That webpage also says that you can provide your own properties file with
entities.  The default value for the entities property, for HTML output, is
    org/apache/xml/serializer/HTMLEntities

So you could set this proerty to your own properties file (class), rather
than the empty string, and in that properties file map characters to entity
names. If you look into org/apache/xml/serializer/HTMLEntities.properties
you will see:
#
# Character entity references for markup-significant
#
quot=34
amp=38
lt=60
gt=62
...

The character '<' with codepoint  60  will be written out as &lt;  etc.  If
you choose to create your own properties file I think you get the idea.

However, one should be very careful here. The less deep you go into the
internals of Xalan the better.
- Brian

- - - - - - - - - - - - - - - - - - - -
Brian Minchau
XSLT Development, IBM Toronto
e-mail:        [EMAIL PROTECTED]

Reply via email to