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

Re: how to "save" a context?

Subject: Re: how to "save" a context?
From: S Woodside <sbwoodside@xxxxxxxxx>
Date: Tue, 14 Jan 2003 16:38:02 -0500
save xml to string

On Tuesday, January 14, 2003, at 02:34 PM, Mike Brown wrote:


S Woodside wrote:
I want to "save" a context, e.g., when I'm in a specific context node,
I want to be able to serialize the context node such that I can pass
that serialization as a string or what not, to another XSLT that
processes the same original XML. Then I could simply
select="deserialize(myserializedString)" and jump to the same node.
Assuming the XML hasn't changed.
[...]

You're right, there's no easy way.

Serializing a node tree into an XML string is something that most XSLT
processors can do via an extension function (though you may have to write it
yourself), and it's also possible to do "manually" with pure XSLT, as
demonstrated by Evan Lenz at http://www.xmlportfolio.com/xml-to-string/

Fortunately, I only want to serialize an XPath expression, not the XML subtree. I think Dimitre's code does that.


Deserializing an XML string back into a node-set will definitely require an
extension function, because you need to run it through a real XML parser and
construct whatever DOM-like structure the vendor's implementation requires.

But if it's just an XPath expression ...?


Simon

You can't reliably send serialized XML embedded in HTML form data unless you
use the multipart/form-data format (as is done for file uploads), and even
then, there is some risk. It is partly for this reason that things like SOAP
exist. Two years ago, I did a little writeup discussing the issues involved;
see http://skew.org/xml/misc/xml_vs_http/


Mike

--
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/

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


---
     anti-spam: do not post this address publicly
www.simonwoodside.com -- 99% Devil, 1% Angel


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.