Re: [xsl] XSLT and XML in the same document

Subject: Re: [xsl] XSLT and XML in the same document
From: "M. David Peterson" <m.david@xxxxxxxxxxxxx>
Date: Sun, 27 May 2007 15:08:17 -0600
On Sun, 27 May 2007 03:02:54 -0600, Michael Kay <mike@xxxxxxxxxxxx> wrote:

If you mean, can you put the stylesheet inside the source document you are
trying to transform, the answer is yes (see "Embedded Stylesheets" in the
spec), but not all XSLT processors support it.

Coming from the other direction, you can embed your XML data into your XML-based XSLT file, and then access it via the document() function (e.g. document('')/*/ext:my-embedded-data would gain you access to the node-set inside of your XSLT file who's parent element was ext:my-embedded-data**)


The above will work on any XSLT 1.0 processor.

Except Opera.

But looking at the bright side, I've been including in my prayers each and every morning and night that the Opera God's will send some document() function love to this Opera loving heart of mine. Maybe I have a bad connection? Don't know. Maybe I'll try another service provider and see if maybe that is indeed the problem. In the mean time you'll have to make do with one of the other *standards conforming* XSLT processors on the market. Last time I checked there were several to choose from. ;-)

** requires you declare a separate namespace with the desired extension prefix.

--
/M:D

M. David Peterson
http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155


Current Thread