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

Re: Fwd: Parsing Entities

Subject: Re: Fwd: Parsing Entities
From: Gary Stewart <the.stewarg@xxxxxxxxx>
Date: Tue, 10 Jan 2006 15:52:56 +0000
gary stewart
On 10/01/06, Michael Kay <mike@xxxxxxxxxxxx> wrote:

> But if you're using saxon:parse then I'm not sure why you're also using
> d-o-e...?

Thanks for having the patience to work with me on this. I was going to
write "because it seemed to be working" along with an explanation but
it was only because I was being stupid in the first place.

The actual source read "&amp;lt;p&amp;gt;Some random letter text
:(.&amp;lt;/p&amp;gt;". Don't ask me why it is double escaped. I'll
look at that some time. Anyway I remember reading that saxon doesn't
do output escaping until the final document so I didn't try value-of
for a variable. My final solution looks like:

<xsl:variable name="letter_text">
<xsl:value-of select="saxon:parse(concat('&lt;e&gt;', letter_text,
'&lt;/e&gt;'))/e/child::node()" /></xsl:variable>

<xsl:copy-of select="saxon:parse(concat('&lt;e
xmlns=&quot;http://www.w3.org/2002/06/xhtml2&quot;&gt;',$letter_text,
'&lt;/e&gt;'))/html:e/child::node()" />

to get around the escaped characters. I added a namespace to the
second parse just to match the namespace of the output.

The other solution would be to regex the &amp; to & before processing
it. Sorry about taking up so much time and thank you all for your help
I wouldn't have reached a solution without it even if I had known that
my source was in a "special" format.

In future I'll read the source :).

Thank you all for all your help,

Gary

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.