Hi,
If you have
<xsl:output method="html"/>
in your template it should have worked - however there is a bug with
this (at least when used with JDK 1.1). I posted a patch for it to this
group last Friday. It works for me - I haven't heard if anyone is going
to check the fix in to cvs.
I'm repeating my post in case you wish to patch your own copy of Xalan.
==========================================================
Hi,
I had problems with an XSL output method of html using JDK 1.1. I
checked that the output method had been set on the transformer but it
still output with XML format tags (e.g. <BR/>).
I dubugged through the code and found that when the
output_html.properties file was being loaded the key names were not
being fixed up correctly.
The relevant entry is :
{http\u003a//xml.apache.org/xslt}content-handler=org.apache.xalan.serialize.SerializerToHTML
JDK 1.x didn't properly expand Unicode escape sequences in Property
key names, so
org.apache.xalan.templates.OutputProperties has some code in the
loadPropertiesFile method to fix these references.
The code gets an Enumerator for the Properties and enumerates through
each key. If the key needs fixing it removes the old key and then adds
it back with the correct key. However the Enumerator is not valid after
the modification and some of the original values (including
{http\u003a//xml.apache.org/xslt}content-handler) were being skipped as
a result and not patched.
I changed it to Enumerate a clone of the Properties object and this
seems to work.
I'm including the patch. Could a committer please review this patch
and if it is valid make the change in cvs ?
Thanks very much,
Regards,
Padraig
==========================================================
--- OutputProperties.java.orig Wed May 23 08:43:14 2001
+++ OutputProperties.java Fri May 25 17:32:43 2001
@@ -237,7 +237,7 @@
// Note that we're working at the HashTable level here,
// and not at the Properties level! This is important
// because we don't want to modify the default properties.
- Enumeration keys = props.keys();
+ Enumeration keys = ((Properties)props.clone()).keys();
while(keys.hasMoreElements())
{
String key = (String)keys.nextElement();
==========================================================
MOLINIER David Pages Jaunes wrote:
>Hi there !
>
>Suppose I want to generate a <BR> tag from an XSL document, in order to
>make line breaks in my HTML document.
>
><BR> is not allowed, because the closing tag is missing. So I tried
><BR/>, but in that case, the HTLM document generated contains also a
><BR/> tag, which is not understood by Netscape browser (not HTML 4.0
>compliant I guess).
>
>Is that a bug or what ? The only solution I found is to force Xalan to
>generate a <BR> tag by using xsl:text tag, as follow :
>
><xsl:text disable-output-escaping="yes"><BR></xsl:text>
>
>but even if that works, it is not "nice".
>
>Thanks for replying.
>
>
>Part of my XSL document :
>...
><xsl:value-of select="Address"/><br/>
><xsl:value-of select="PostalCode"/><b><xsl:text> </xsl:text>
><xsl:value-of select="Town"/><br/></b>
>...
><xsl:template match="LINE">
> <xsl:value-of select="."/>
> <br/>
></xsl:template>
>
>Part of my XML document
>...
><Address>
> <LINE>24 ruelle des ames perdues</LINE>
></Address>
><PostalCode>92310</PostalCode>
><Town>S�vres</Town>
>...
>
--- OutputProperties.java.orig Wed May 23 08:43:14 2001
+++ OutputProperties.java Fri May 25 17:32:43 2001
@@ -237,7 +237,7 @@
// Note that we're working at the HashTable level here,
// and not at the Properties level! This is important
// because we don't want to modify the default properties.
- Enumeration keys = props.keys();
+ Enumeration keys = ((Properties)props.clone()).keys();
while(keys.hasMoreElements())
{
String key = (String)keys.nextElement();