You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Torben Wedekind <to...@cpg.it> on 2000/10/16 12:42:43 UTC

Problems with xsl-transformations using Xalan

I our application we use xalan to transform our results, formatted as
XML-DOM, into html to view them in a browser. Above is an example of the
xsl we write for this:

<xsl:template match="PartyData"> 
	<table bgcolor="lime" border="1">
		<xsl:apply-templates select="DataAttribute[@name='Nome']"/> 
		<xsl:apply-templates select="DataAttribute[@name='Cognome']"/><br>
		<xsl:apply-templates select="DataAttribute[@name='Indirizzo']"/></br>
		<xsl:apply-templates select="DataAttribute[@name='Cap']"/>&#160;
		<xsl:apply-templates select="DataAttribute[@name='Localita']"/> 
	</table>
</xsl:template>

Unfortunatly html is in some tags not xml-compatible ("<br>", "<li>"),
but the XSLTProcessor demands wellformed xsl-document and we would get a
Parseexception using these.
So we made the workaround writing instaead of "<br>" "<br></br>".
Because the XSLTProcessor transforms this into "<br/>" what was not
understood by the browser we used then "<br>&#160;</br>". But in this
case the browser interpreted it as two "<br>" instead one.
So no we found the solution above with the disatvantage to be able to
use "<br>" only in pairs. 
Another test using &lt;br&gt; did even fail because this expression
ended unchangeds in the html-document. 

Isn't there any opportunity to write just simple html-tags like <br>
using xalan??
Greetings,
Torben

-- 
Torben Wedekind, Dipl.-Ing., System Developer

Smarten Software / Italia
00135 Roma, Via della Camilluccia, 693
Phone: (+39)0636298427  Fax: (+39)0636290974
http://www.smarten.com    mailto:torben@cpg.it

Re: Problems with xsl-transformations using Xalan

Posted by Christian NENTWICH <c....@cs.ucl.ac.uk>.
> Isn't there any opportunity to write just simple html-tags like <br>
> using xalan??

Just write <br/>, xalan should transform it properly into <br> (if html
output is selected)

c.

RE: Problems with xsl-transformations using Xalan

Posted by Tako Schotanus <qu...@palacio-cristal.com>.

> Another test using &lt;br&gt; did even fail because this expression
> ended unchangeds in the html-document. 

But you can use:

	<xsl:text disable-output-escaping="yes">&lt;br&gt;</xsl:text>

(there is a similar attribute for <xsl:value-of>)

Cheers,
 -Tako


> 
> Isn't there any opportunity to write just simple html-tags like <br>
> using xalan??
> Greetings,
> Torben
> 
> -- 
> Torben Wedekind, Dipl.-Ing., System Developer
> 
> Smarten Software / Italia
> 00135 Roma, Via della Camilluccia, 693
> Phone: (+39)0636298427  Fax: (+39)0636290974
> http://www.smarten.com    mailto:torben@cpg.it
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org