xsl-list
[Top] [All Lists]

RE: [xsl] presenting xml elements as they appear in the source file

2010-04-27 13:37:11

If you're using Saxon there's saxon:serialize() which returns a string
representation of the lexical XML, which you can insert into your HTML
output.

Another trick that works in most environments, despite being deprecated, is
to use the old <xmp> tag in HTML:

<xmp>
 <xsl:copy-of select="$element"/>
</xmp>

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

-----Original Message-----
From: Rod Kane [mailto:rkane(_at_)claritysystems(_dot_)com] 
Sent: 27 April 2010 18:55
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] presenting xml elements as they appear in the 
source file

Hello,

In general can anyone suggest how to display xml nodes as 
they appear in the source file? If there is an easy way of 
doing this it will assist with this problem:
 
I'd like to use xsl to prepare an html document but at 
certain points the xml becomes an arbitrary mix of nodes, 
think of a number of a number of legal/valid elements that 
can be arranged in arbitrary ways, such as a nested query.
 
Since the composition of the query is unpredictable it is 
necessary to just present the nodes as they are in the source 
xml, complete with the < > brackets, to make things easy.
 
I see that there are examples of presenting xml in trees and 
that may be a bit time consuming for a beginner to implement 
so simply listing the elements verbatim is fine for now.
 
Thank you
 
Rod


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--