This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Non-well-formed HTML in XSL


> Ok so how does all of this explain how you can have output
> HTML or Text? I mean neither of those can be described as XML
> unless we talk XHTML - which we're not. 

You produce in XSLT an XML tree representation of the document and then
serialise it as XML, HTML, or text. So any document must have an XML
representation.


In the case of HTML the XML representation is the fairly obvious one,
using XML elements and attributes to denote HTML ones.

In the case of text what you get is the string value of the document
node of the result document, ie all the character data with no markup.

> <xsl:param name="itemsephtml" select="'&lt;img
> src=&quot;/wdp/images/spc.gif&quot; alt=&quot;&quot;
> height=&quot;1&quot;&gt;'"/>

which is horrible, and as often stated won't work as often as not in
XSLT pipelines.

> which used to be
> <xsl:param name="itemsephtml"><img src="/wdp/images/spc.gif" alt=""
> height="1"/></xsl:param>

much better!

> but I found when I passed a parameter with a text more or less similar
> to the <img tag the <xsl:copy-of/> that I used to use to show
> the parameter no longer worked so I was forced to this solution with
> <xsl:value-of D-O-E/>

You presumably had a coding error, but unless you show us the example, I
don't see what other help we can give.

If by passed a parameter you ment something like on the command line

saxon file.xml file.xsl  itemsephtml='<img src="/wdp/images/spc.gi"/>'

then that is not passing an element in as a parameter but a string.
Most XSLT systems only let you pass in strings from their command line
interface, and you have to use an API from some other language to pass
in node sets. In particular starting from <img
src="/wdp/images/spc.gi"/> you've got to get an XML parser into the loop
somewhere.


David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]