XSL newbie question

Andreas Baus

Usenet Archive
Joined
Aug 1, 2001
Messages
4
Reaction score
0
I've onlyy just begun learing about XSL, and there's one question that I've not been able to find an answer for: is it possible to transform XML documents into output that itself is *not* a valid XML document? For a simple example, is it somehow possible to use XSL to render the data in a given XML document into a plain text representation, which may be formatted in a certain way for readability, but contains no traces of XML or other markup?
 

Arto Viitanen

Usenet Archive
Joined
Dec 1, 2000
Messages
62
Reaction score
0
Andreas> I've onlyy just begun learing about XSL, and there's one question Andreas> that I've not been able to find an answer for: is it possible to Andreas> transform XML documents into output that itself is *not* a valid Andreas> XML document? For a simple example, is it somehow possible to use Andreas> XSL to render the data in a given XML document into a plain text Andreas> representation, which may be formatted in a certain way for Andreas> readability, but contains no traces of XML or other markup?

Yes.

xsl:eek:utput element takes attribute method. It can be (atleast) xml, html or text. You can output text with xsl:text element, but I have found (I use XSL to generate program sources) that <xsl:value-of select="concat('text',element,@attribute,$variable)"/> is needed quite alot. You might also need variable newline as the last parameter to concat, which is defined like

<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>

(Since I wrote Java programs and I use K&R kind formatting, I also defined variables indent1, indent2 etc. containing four or eight spaces)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top