Re: [xsl] Fallback from document() error

Subject: Re: [xsl] Fallback from document() error
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 3 Jan 2001 14:17:26 GMT
  I can have:


  with foo.xml:


  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"/>

(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.


This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit

 XSL-List info and archive:

Current Thread