This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Fallback from document() error
David Carlisle wrote:
>
> > One problem is where document() is used to retrieve a set of documents, e.g.
> > document(//a/@href). What happens if some of them exist and some don't?
>
> er, pass;-)
>
> But what would happen in Miloslav's xsl:fallback version in that case as
> well?
>
document(//a/@href)
<xsl:fallback>
<xsl:copy-of select='/..'/>
</xsl:fallback>
or some non-empty node-set which would be added instead of non-existent
file.
Another simple usercase if non-existent file always returns an error
and if there is at least one right filename in the source document:
<xsl:template name="open">
<xsl:param name="x"/>
<xsl:param name="y"/>
<xsl:apply-templates select="document($x)//aaa">
<xsl:fallback>
<xsl:call-template name="open">
<xsl:with-param name="x" select="//files[$y]"/>
<xsl:with-param name="y" select="$y + 1"/>
</xsl:call-template>
</xsl:fallback>
</xsl:apply-templates>
</xsl:template>
--
******************************************
<firstName> Miloslav </firstName>
<surname> Nic </surname>
<mail> nicmila@idoox.com </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