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

Re: Problem with ampersands

Subject: Re: Problem with ampersands
From: Rashmi Rubdi <dev_subscriptions@xxxxxxxxx>
Date: Tue, 26 Sep 2006 07:16:56 -0700 (PDT)
rashmi rubdi
If you have control over the original XML you can use 
<!CDATA[[  &  or &amp;  ]]>



--- andrew welch <andrew.j.welch@xxxxxxxxx> wrote:

> On 9/26/06, Jeff Sese <jsese@xxxxxxxxxxxx> wrote:
> > Hi,
> >
> > I have this requirement from a client to retain
> all the entity
> > references in their xml files after transformation
> so what i did was
> > collect all the entities in the DTD and then
> created a character-map for
> > single-character entities. For multi-character
> ones, i created a used a
> > function to search and replace all occurrences in
> a text node. My
> > problem is when i use the function and return the
> value, xslt escapes
> > the ampersand symbol as &amp; and i don't know how
> i can unescape it
> > without unescaping the real ampersand character.
> 
> The client shouldn't care whether the characters are
> entities or not
> unless they plan on hand editing the files - once
> the client parses
> the XML you give them using an XML parser they won't
> know whether the
> characteres were represented on disk as entities,
> character references
> or the characters themselves - the information isn't
> contained in the
> infoset.  XSLT deals with infosets, which is why
> what you are trying
> to isn't possible without resorting to d-o-e or
> extensions.
> 
> If you really must deliver XML with the entities in
> place I would
> suggest using a placeholder element (eg <entityA/>)
> to represent it in
> the output and the post process the result with a
> suitable language to
> replace the placeholder elements with the entity
> references.
> 
> cheers
> andrew
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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.