This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Fallback from document() error
I can have:
document('foo.xml')//aaa
with foo.xml:
<bbb/>
this bit will return empty node-set but I cannot
find out that the document exists.
Yes but if the spec was changed to make returning an empty node set
mandatory rather than just an option, then you could go
<xsl:if test="document('foo.xml')">
<xsl:apply-templates select="document('foo.xml')//aaa"/>
</xsl:if>
(which would look nicer if xpath had an if expression)
> 1.1 I will not have problems with restrictions
> result tree fragment use, so I can reuse the part from case 2)
You could do that anyway, even under xslt 1.0, if you go
<xsl:variable name="x select="document('foo.xml')"/>
then $ is a node set not an rtf.
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list