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

Re: Can unparsed-text() consume an in-memory XML docu

Subject: Re: Can unparsed-text() consume an in-memory XML document? Can a string version of an XML document be converted into XML?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 14 Aug 2012 09:56:49 +0100
Re:  Can unparsed-text() consume an in-memory XML  docu
On 14/08/2012 05:00, Graydon wrote:
On Tue, Aug 14, 2012 at 12:12:42AM +0100, David Carlisle scripsit:
On 13/08/2012 21:15, Costello, Roger L. wrote:
Is there a way in XSLT to convert a string to XML?

That's called parsing. As Michael said XPath 3 drafts include a parse-xml function, or many xslt 1 and 2 processors have such an extension function, or, if you are feeling strange you could write a parser in xslt.

Is there any possibility of getting the XPath 3 functions to _not_ require balanced trees?

I suspect xpath3 is virtually done but you can put in a feature request via bugzilla for xpath n (I'm not on the working group, so can't say how well received that would be:-)

In practice you can do something along those lines already as (as for
top level document parsing) many products allow the xml parser to be
specified external to the xslt, and as long as the parser returns
xml-like sax parse events xpath doesn't really care what the input
syntax looks like, so you can supply an html parser (tag soup for
example for java xslt processors) which will consume (and "fix up")
markup that is not well formed.

The only time I've had to use this kind of functionality, it was to take a horrible mess of semi-colon-space separated link-like things embedded in a mass of text where the text could be decorated with various bits of markup -- bold, italic, "term", actual link markup of various flavours -- and serialize it so it could be split at the semi-colon spaces.

The results of tokenization had to go back into XML and be
processed, and the tokens certainly weren't balanced trees.

It's not that hard to write a function to do this, but it would be
nice to not have to.


David



-- google plus: https:/profiles.google.com/d.p.carlisle

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________


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.