[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Abel Braaksma wrote:
There's an error in what I send above, it should of course be:
From what I understand from you all is the following (nr have no bearing with the above numbers):
1. If you place xml:base on xsl:stylesheet of your containing stylesheet xslt file, and that base location does NOT have your stylesheet physically, document('') will fail. In this scenario, it is NOT possible to resolve the original XSLT file that the xslt processor was calling.
2. If you place xml:base only on places where needed, you can use a global parameter with static-base-uri() to make sure it will be resolved against the uri of the stylesheet. It will return the stylesheet url.
3. If you do not use xml:base at all, or when it points to a location where your current xslt file is located as well, both document-uri(document('')) and static-base-uri() will return the same result.
Not sure I covered all scenarios. I am aware of URIResolver, or using the xslt as a parameter or as source document. I decided, for now, to put the name of the current xslt inside an entity reference. Not the best solution, I know, and it has to be repeated for each stylesheet, but good enough for the moment.
Colin, Dimitre, Michael, David, Andrew: thanks for the valuable insights!
Re: [xsl] Referring to stylesheet itself, possible in XSLT 1.0, but how in XSLT 2.0?
Subject: Re: [xsl] Referring to stylesheet itself, possible in XSLT 1.0, but how in XSLT 2.0? From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 17 Oct 2006 14:41:28 +0200 |
Abel Braaksma wrote:
This output:
------------
Error on line 1 column 1 of file:/D:/Workspaces/Eclipse/etc/:
SXXP0003: Error reported by XML parser: Content is not allowed in prolog.
Recoverable error on line 5 of file:/D:/Workspaces/Eclipse/etc/def/config/test.xslt:
FODC0005: org.xml.sax.SAXParseException: Content is not allowed in prolog.
<?xml version="1.0" encoding="UTF-8"?>
1)
2) file:/D:/Workspaces/Eclipse/etc/
3) file:/D:/Workspaces/Eclipse/etc/test.xml
There's an error in what I send above, it should of course be:
1) 2) file:/D:/Workspaces/Eclipse/etc/ 3) file:/D:/Workspaces/Eclipse/etc/def/config/test.xml
From what I understand from you all is the following (nr have no bearing with the above numbers):
1. If you place xml:base on xsl:stylesheet of your containing stylesheet xslt file, and that base location does NOT have your stylesheet physically, document('') will fail. In this scenario, it is NOT possible to resolve the original XSLT file that the xslt processor was calling.
2. If you place xml:base only on places where needed, you can use a global parameter with static-base-uri() to make sure it will be resolved against the uri of the stylesheet. It will return the stylesheet url.
3. If you do not use xml:base at all, or when it points to a location where your current xslt file is located as well, both document-uri(document('')) and static-base-uri() will return the same result.
Not sure I covered all scenarios. I am aware of URIResolver, or using the xslt as a parameter or as source document. I decided, for now, to put the name of the current xslt inside an entity reference. Not the best solution, I know, and it has to be repeated for each stylesheet, but good enough for the moment.
Colin, Dimitre, Michael, David, Andrew: thanks for the valuable insights!
Cheers, -- Abel Braaksma http://www.nuntia.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Referring to stylesheet i, Abel Braaksma | Thread | Re: [xsl] Referring to stylesheet i, David Carlisle |
RE: [xsl] [XSLT 2.0] Checking that , Costello, Roger L. | Date | Re: [xsl] Referring to stylesheet i, David Carlisle |
Month |