Re: [xsl] XML Embedded in XSL Embedded in XML

Subject: Re: [xsl] XML Embedded in XSL Embedded in XML
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 19 Feb 2004 13:07:32 -0500

In the XPath data model, each node has a "Base URI" associated with it, which you could use for this purpose if you could only get access to it. Unfortunately there's no function in XPath 1.0 that will give it to you.

There may be hacks or tricks you could use, or honest extension functions, to get this value, depending on your processor. But the easiest and most portable way to get the value into your stylesheet is simply to pass the file name in as a string parameter, at runtime.

Ask again if you can't figure out how to do this.

Oh, and, strictly speaking you're not allowed to use "xml" as an element name (though not all processors enforce this restriction).


At 12:48 PM 2/19/2004, you wrote:
I seem to have a catch-22 here that my mind can't get around, as I try to convert from hard-coded html to XSL. I've got an XML file with a ref to an XSL, eg.

<?xml-stylesheet type="text/xsl" href="Test.xsl"?>
<xml> ... </xml>

The stylesheet has all the usual stuff, but also this attribute:

<xml id="Info" src="h:\temp\dccase.xml" />

My problem is that I *want* the src to be is the very XML document that called the XSL in the first place. How would I do that?

Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

XSL-List info and archive:

Current Thread