Page 1 of 1

Relative URI with no Base

Posted: Fri Nov 18, 2016 11:03 pm
by joshuao
Hello,

I am getting a warning when transforming an XML file with xsl 2.0 stylesheet. The error goes like this:

Code: Select all

Description: XTDE1162: Relative URI passed to document() function (); but no base URI is available
I'm wondering if someone might point me in the right direction as to what can cause it to say no base URI is available.

Thank you in advance

Joshua

Re: Relative URI with no Base

Posted: Mon Nov 21, 2016 9:24 am
by Radu
Hi Joshua,

As far as I know XSLT has this concept of "context node" which is usually the node on which the current XSLT template gets applied. But if you are inside an xsl:function or you call a template by name, there is no context node so you need to probably pass the context node as a parameter and send it to the document() function (the function can take a base context node as a second parameter).

Regards,
Radu

Re: Relative URI with no Base

Posted: Tue Nov 22, 2016 8:05 pm
by joshuao
Thank you this was a HUGE help. Simply adding a reference to a node in the second parameter of the document() function fixed it.