[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Yet Another Entity Ref question!

Subject: Re: Yet Another Entity Ref question!
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 20 Dec 2002 13:02:22 -0500
xslt entity ref
Marco,

At 07:48 AM 12/20/2002, you wrote:
But I ask to myself (and to you): "Does it exist a method of outputting &
in resulting doc without using d-o-e, so that I can use my originally
solution?"
Yes I know, I'm asking for outputting a non-well-formed XML doc!!

This is not an uncommon requirement: to have special characters in your output represented by entities, not numeric character references.


The thing is, it is far less common in the scenario for which XSLT was (primarily) designed, namely "styling a document" (i.e. transforming it into an output format to be rendered by a formatter, not necessarily into any arbitrary XML). It comes up frequently in part because XSLT is being used to do other sorts of transformations (such as a "medial" transformation into a form that will later be edited by a human being: people tend to like named entities better than numeric character refs, after all). Given this gap between its 1.0 design and what have turned out to be common use cases, it's more understandable why XSLT lacks a feature to do this directly.

(I think XSLT 2.0 has one? If not, I shouldn't think it would be hard to implement a serializer that would be able to do this, when called on from a 1.0 stylesheet.)

Yes probably, to use original solution, the only way is using d-o-e in
xsl:text and xsl:value-of.

Yes -- but this is best implemented as a *post-process*, that is a *separate pass* over your data. This keeps the two processes -- node transformation and data massaging -- separate, thereby preserving your ability to use them separately (which you might). Nor does the data-massaging post-process have to be written in XSLT -- there are other tools that are arguably better for the job.


Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.