Subject: Re: [xsl] Document function -- document may not exist From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Wed, 03 Jul 2002 17:06:32 -0400 |
I was wondering if there is a way of getting around the exception that is thrown by most parsers if the document function is called for a file that does not exist. I would just like to continue on in the processing. For example, I would like to do something like the following:
<xsl:variable name="FILE_A" select="document('A.xml')"/> <xsl:variable name="FILE_B" select="document('B.xml')"/>
<xsl:for-each select="$FILE_A"> <!-- If it exists, do some processing --> ... </xsl:for-each> <xsl:for-each select="$FILE_B"> <!-- Same.... --> </xsl:for-each>
(1) - if I get a non-empty node set for the URL my licensee gives me, I synthesize a local backup copy of the document by using the processor extension to write out a node tree as XML (2) - if I get an empty node set for the URL my licensee gives me, I pass the local backup copy of the document to the document() function so at least I have the latest information that was available from my licensee the last time it was successful
-- Upcoming: 3-days XSLT/XPath and/or 2-days XSL-FO:Sep 30-Oct 4,2002
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-07-1 Practical Formatting Using XSLFO XSL/XML/DSSSL/SGML/OmniMark services, books (electronic, printed), articles, training (instructor-live,Internet-live,web/CD,licensed) Next public training: 2002-08-05,26,27,09-30,10-03
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Document function -- docu, J.Pietschmann | Thread | Re: [xsl] Document function -- docu, Joerg Heinicke |
RE: [xsl] The Future of Browser-Bou, Wendell Piez | Date | Re: [xsl] call-template with dynami, Joerg Heinicke |
Month |