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

xml:base URI ignored by document()

Subject: xml:base URI ignored by document()
From: Lars Huttar <lars_huttar@xxxxxxx>
Date: Mon, 26 Jul 2010 20:52:52 -0500
 xml:base URI ignored by document()
Hello,

I have an XSLT 2.0 stylesheet that is using a document() call, whose
first argument is a relative URI:
                            select="document( $document-uri, if
(string-length($base-uri) > 0) then $base-uri-node else / )" />

I'm passing a second argument there to set the base URI for
$document-uri to be resolved against.
$base-uri is a parameter
    <xsl:param name="base-uri" select="/.." />
with a value of "file:c:/.../metamodel/data/validation/"

According to the XSLT 2.0 spec, "The second argument [to document()], if
present, is a node whose base URI is used to resolve any relative URI
references contained in the first argument."
So I construct a node whose base URI is set to the parameter $base-uri:
        <xsl:variable name="base-uri-node">
            <dummy xml:base="{$base-uri}" />
        </xsl:variable>

Is that correct, as a way to create a node whose base URI is a desired
value?
When I look at the value of this variable in a debugger, it's an XML
fragment. But I don't know how else to do this. Is there a better way?

When I actually do the document() call as shown above, it gives a "file
not found" warning:
SystemID: C:\...\test\process\iso_dsdl_include.xsl
Severity: warning
Description: java.io.FileNotFoundException:
C:\...\test\process\metamodel-bnf-fnf-rnf-cnf.sch (The system cannot
find the file specified)
Start location: 453:0
URL: http://www.w3.org/TR/2005/WD-xpath-functions-20050211/#ERRFODC0005

In particular, it's looking for the file relative to the base URI of the
XSLT stylesheet, instead of relative to the base URI of the node I
passed as the second argument.

Any suggestions are appreciated...

Lars

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.