|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Fallback from document() error
Being quite often plagued by problems with
document('foo.xml') function when foo() does not exist
I was wandering about means how to solve it.
XSLT1.1 draft still says:
If there is an error retrieving the resource, then the XSLT processor
may signal an error; if it does not signal an error, it must recover by
returning an empty node-set.
So you will either get an error from the processor or
you will be unable to distinguish if the file is missing
or there is no required node in the retrieved document.
It looks to me that such problems would solve if
xsl:fallback is permited as a child of
elements wite select attribute (e.g. apply-templates)
e.g.:
<xsl:apply-templates select="document('no-file.xml')">
<xsl:fallback>
The file does not exist
</xsl:fallback>
</xsl:apply-templates>
I think that it would also circumvent problems with old processors when
there is a new vesions of XPath and the
stylesheet would otherwise parsed without problems not to be there a
"wrong" new XPath.
Is there some flaw in this argument?
--
******************************************
<firstName> Miloslav </firstName>
<surname> Nic </surname>
<mail> nicmila@xxxxxxxxx </mail>
<support> http://www.zvon.org </support>
<zvonMailingList>
http://www.zvon.org/index.php?nav_id=4
</zvonMailingList>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








