bennyboy79
Programmer
hi there. ok. here is the problem...
i have a main database xml file that looks like this
<CODE>
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="sort.xsl" ?>
<!DOCTYPE list SYSTEM "maindb.dtd">
<list>
<taxpayer id="js" file="johnsmith.xml"/>
<taxpayer id="dj" file="davejones.xml"/>
<taxpayer id="rt" file="roberttilley.xml"/>
<taxpayer id="ec" file="edchinn.xml"/>
<taxpayer id="sm" file="sammorton.xml"/>
<taxpayer id="pd" file="philderuyter.xml"/>
<taxpayer id="ck" file="chantelleknoetze.xml"/>
<taxpayer id="bm" file="benmorton.xml"/>
<taxpayer id="pp" file="peterparker.xml"/>
<taxpayer id="am" file="alexmoody.xml"/>
</list>
</CODE>
and each taxpayer refers to another external file file as shown, like
<CODE>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE taxpayer SYSTEM "taxpayer.dtd">
<taxpayer id="bm" >
<name>
<family>morton</family>
<given>ben</given>
</name>
<address number="27" postcode="RH110LN">
<line1>cherrytree lane</line1>
<line2>filed close</line2>
<city>crawley</city>
</address>
<phone>01293521336</phone>
<email>benmorton@home.com</email>
<income salary="3000" allowance="6000"/>
</taxpayer>
</CODE>
now, the xsl file associated with the main database xml file is used to sort the taxpayers names alphabetically and output the result to a new xml file. i just cant seem to get it to see the external files and process the names in them!!!!! its really doing my head in. the sort xsl file looks like this:
<CODE>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xslutput method="xml"/>
<xsl:include href="resultstyle.xsl"/>
<!-- Template for root rule -->
<xsl:template match="/">
<!-- call the stylesheet for the resulting table-->
<xsl:call-template name="resultstyle"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="list">
<h1>Sorting taxpayers by name in ascending order</h1>
<!-- Table Header Creation -->
<table border="1">
<tr>
<th>Surname</th>
<th>Firstname</th>
</tr>
<xsl:for-each select="document(@file)//taxpayer/name">
<xsl:sort order="ascending" select="family"/>
<tr>
<td>
<xsl:value-of select="family"/>
</td>
<td>
<xsl:value-of select="given"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
</CODE>
please please can someone help me asap.
thanks alot in advance
bennyboy79
i have a main database xml file that looks like this
<CODE>
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="sort.xsl" ?>
<!DOCTYPE list SYSTEM "maindb.dtd">
<list>
<taxpayer id="js" file="johnsmith.xml"/>
<taxpayer id="dj" file="davejones.xml"/>
<taxpayer id="rt" file="roberttilley.xml"/>
<taxpayer id="ec" file="edchinn.xml"/>
<taxpayer id="sm" file="sammorton.xml"/>
<taxpayer id="pd" file="philderuyter.xml"/>
<taxpayer id="ck" file="chantelleknoetze.xml"/>
<taxpayer id="bm" file="benmorton.xml"/>
<taxpayer id="pp" file="peterparker.xml"/>
<taxpayer id="am" file="alexmoody.xml"/>
</list>
</CODE>
and each taxpayer refers to another external file file as shown, like
<CODE>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE taxpayer SYSTEM "taxpayer.dtd">
<taxpayer id="bm" >
<name>
<family>morton</family>
<given>ben</given>
</name>
<address number="27" postcode="RH110LN">
<line1>cherrytree lane</line1>
<line2>filed close</line2>
<city>crawley</city>
</address>
<phone>01293521336</phone>
<email>benmorton@home.com</email>
<income salary="3000" allowance="6000"/>
</taxpayer>
</CODE>
now, the xsl file associated with the main database xml file is used to sort the taxpayers names alphabetically and output the result to a new xml file. i just cant seem to get it to see the external files and process the names in them!!!!! its really doing my head in. the sort xsl file looks like this:
<CODE>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xslutput method="xml"/>
<xsl:include href="resultstyle.xsl"/>
<!-- Template for root rule -->
<xsl:template match="/">
<!-- call the stylesheet for the resulting table-->
<xsl:call-template name="resultstyle"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="list">
<h1>Sorting taxpayers by name in ascending order</h1>
<!-- Table Header Creation -->
<table border="1">
<tr>
<th>Surname</th>
<th>Firstname</th>
</tr>
<xsl:for-each select="document(@file)//taxpayer/name">
<xsl:sort order="ascending" select="family"/>
<tr>
<td>
<xsl:value-of select="family"/>
</td>
<td>
<xsl:value-of select="given"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
</CODE>
please please can someone help me asap.
thanks alot in advance
bennyboy79