XSL newbie question

A

Andreas Baus

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?

--
 
A

Arto Viitanen

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

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top