|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: fault tolerant saxon:parse()
>> The former needs parsing if you want to process the escaped markup,
>> but if you do that with the latter you get an error
>
> but if you just parsed with tagsoup (or probably the others as well0 it
> would work in both cases, because in super-lax html parsing modes an &
> not followed by some letters and a semicolon parses as itself rather
> than an error.
>
Given this XML:
<root>
<title><a href="foo.html">Today</a></title>
<title>Hammersmith & City</title>
</root>
and the need to process the <title> element to strip out the markup
(or some other requirement) - how would you incorporate tagsoup?
Currently I'm calling saxon:parse on the contents of the title
element, wrapped in a root node (as there's no guarantee of a single
root element):
<xsl:variable name="parsed-content"
select="saxon:parse(concat('<root>', saxon:parse(title),
'</root>'))/root"/>
<xsl:value-of select="$parsed-content"/>
Do I parse the entire XML using tagsoup?
thanks
--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








