Thanks for helping me through all this xpath guys. I am slowly getting it. I now have a doc that is a little different from those that I have been working with. It looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<xmp:document
xmlns:xmp=" documentDate="2001-09-11">
<xmp:comment>Good Financial Standing</xmp:comment>
<Applicant xmp
hone="919.595.6765">
<name>James Smith</name>
<location>65th Street</location>
<city>San Fransisco</city>
<state>CA</state>
</Applicant>
<Applications>
<Approvals approvalNumber="3346">
<date>2004-09-04</date>
<loanAmount>1000</loanAmount>
<interestRate>07</interestRate>
</Approvals>
<Approvals approvalNumber="7632">
<date>2005-05-01</date>
<loanAmount>2000</loanAmount>
<interestRate>05</interestRate>
</Approvals>
</Applications>
<bank xmp
hone="919.565.1111">
<name>First Bank</name>
<location>123 Bank Place</location>
<city>San Fransisco</city>
<state>CA</state>
</bank>
</xmp:document>
I am trying to select all of the loanAmounts from the document. I have tried to isolate the node to just Applications and then work with the approvals child node. However, the various parent/child nodes are giving me trouble. This is what I have tried:
<xsl:template match="document">
<html>
<body>
<xsl:apply-templates select="document/Applications/Approvals"/>
</body>
</html>
</xsl:template>
<xsl:template match="Applications">
<p>
<xsl:for-each select="Applications">
<xsl:value-of select="@loanAmount"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</p>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xmp:document
xmlns:xmp=" documentDate="2001-09-11">
<xmp:comment>Good Financial Standing</xmp:comment>
<Applicant xmp
<name>James Smith</name>
<location>65th Street</location>
<city>San Fransisco</city>
<state>CA</state>
</Applicant>
<Applications>
<Approvals approvalNumber="3346">
<date>2004-09-04</date>
<loanAmount>1000</loanAmount>
<interestRate>07</interestRate>
</Approvals>
<Approvals approvalNumber="7632">
<date>2005-05-01</date>
<loanAmount>2000</loanAmount>
<interestRate>05</interestRate>
</Approvals>
</Applications>
<bank xmp
<name>First Bank</name>
<location>123 Bank Place</location>
<city>San Fransisco</city>
<state>CA</state>
</bank>
</xmp:document>
I am trying to select all of the loanAmounts from the document. I have tried to isolate the node to just Applications and then work with the approvals child node. However, the various parent/child nodes are giving me trouble. This is what I have tried:
<xsl:template match="document">
<html>
<body>
<xsl:apply-templates select="document/Applications/Approvals"/>
</body>
</html>
</xsl:template>
<xsl:template match="Applications">
<p>
<xsl:for-each select="Applications">
<xsl:value-of select="@loanAmount"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</p>
</xsl:template>
</xsl:stylesheet>