[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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@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
|