[xslt] Validation of path to file trouble



Good time of day!
Please help me to resolve following trouble.
I have two xml files: a.xml and b.xml

Listing of a.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test.xslt"?>
<rootA>
	<greeting>Hello, world!</greeting>
	<path_to_file>C:\Works\path_to_file\</path_to_file>
	<file_name>b.xml</file_name>
</rootA>

Listing of b.xml
<?xml version="1.0" encoding="UTF-8"?>
<rootB>
	<contentB>Hello, world!</contentB>
</rootB>

Also, I have XSLT file, that looks like as:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="html" omit-xml-declaration="yes" indent="no" />
<xsl:template match="/">
	This is a greeting from a.xml: <xsl:value-of
select="//root/greeting"/> <br />
	This is content of b.xml: <xsl:value-of
select="document(concat(//rootA/path_to_file, //rootA/file_name))"/>
</xsl:template>
</xsl:stylesheet>

... and applies to a.xml.

Question. How can I check existing of b.xml at some path (E.G.
C:\Works\path_to_file\b.xml) before using of document()?

Thanks...
Dmitry A. Kasabutsky
Minsk, Belarus




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]