Re: Want serialized (rather than DOM-tree) output from XSL transforma tions

Subject: Re: Want serialized (rather than DOM-tree) output from XSL transforma tions
From: "Oren Ben-Kiki" <oren@xxxxxxxxxxxxx>
Date: Thu, 24 Dec 1998 10:34:04 +0200
"Duffy, Bruce" <Bruce.Duffy@xxxxxxxxxxxxx> writes:

> My question is this: At West, we want to apply an XSL style sheet to
> an XML document to produce a result that *is not a tree*, but is
> instead a string or stream in West's "WestPro" data stream format.

And Henry S. Thompson <ht@xxxxxxxxxxxxxxx> answered:

>
>Sorry, won't happen.  XSL is a companion standard to XML.  The draft
>recommendation makes clear that serialisation of the output is
>allowed, but not required.  By definition the output is XML,
>whether tree or character sequence.


Here's a technical issue wrt. transformation vs. formatting language :-)

XSL as it stands today can be used to generate arbitrary text - almost. The
only lack I'm aware of is that the output is littered with XML character
markup (e.g., "<" is always emitted as "&lt;"). If there was a markup='none'
modifier to <xsl:text> and <xsl:value-of>, you could generate anything at
all. This is marginally useful for readability of things like generated
JavaScript code in normal XSL-to-XML transformations, so theoretically it
could become part of the standard. Don't hold your breath, though :-)

There's a simple workaround - all you need to do today is pass the output
through an XML character markup interpreter. If you are using any Java based
XSL processor, for example, you could write a filtering output stream doing
the job and give that to the processor; your program would then emit the
exact text you want.

Is there some transformation problem you encountered at West which
couldndn't be resolved this way?

Share & Enjoy,

    Oren Ben-Kiki.


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


Current Thread