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

RE: Serializing external XML documents

Subject: RE: Serializing external XML documents
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 10 Oct 2001 15:11:33 +0100
kate external tool xml
> 1) I am using "document()" function (maybe abusing of it) to
> talk HTTP with
> an external application: Tamino DB.
>
> Question: Is there any other XSLT standard way of talking
> HTTP from inside a stylesheet ?

No, the document() function is the only way of communicating with the
outside world, other than using an extension function.
>
> 2) One of the possible calls to Tamino is a "_process"
> function for content
> updating purposes. The syntax for this function is:
>
> DB-URL?_process=<XML object> (XML object stands for a text
> serialized XML fragment)

If you use the document() function with a URL that has side-effects, you're
in the same kind of dangerous territory as using an extension function with
side-effects. In general, you don't know the order in which XSLT
instructions are executed, or whether they are executed once or many times.
If you don't use the value returned by document(), you don't know whether
the command will be executed at all. (Actually, with document(), it's pretty
certain that if you call document() twice with the same URL, the underlying
HTTP request will only happen once).
>
> Question: What is the most practical way of reading an
> external XML-file
> with the desired target XML information and serialize it as
> non-escaped XML
> markup text and insert it into the "document()" function to
> perform the HTTP call ?
>
I think the answer to that is to use a JAXP URIResolver. Don't try to
include the actual XML in the URI passed to document(), instead use some
kind of abstract URI, and convert this to the real HTTP request in your
URIResolver.

Mike Kay


 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.