This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xsl:param as a global
- To: XSL List <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] xsl:param as a global
- From: Amy Kaizerman <amy dot j dot kaizerman at lmco dot com>
- Date: Fri, 14 Sep 2001 13:25:39 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi. I've never tried to use xsl:param before and I was having problems
finding a
good example of how to use it. Basically, I have some Java code that is
transforming
my XML and I'm passing in a parameter (I'm using XALAN).
What I'm getting is:
<tr>
<td>harness 2</td><td>GE4</td><td>r20358</td>
<td>Aps:AsBuiltd/Aps:TestResults/Aps:Name</td>
</tr>
and what I want is:
<tr>
<td>harness 2</td><td>GE4</td><td>r20358</td>
<td>GE-4-tpe-rai-data.zip</td>
</tr>
In other words I want the actual value of
Aps:AsBuiltd/Aps:TestResults/Aps:Name.
I can see why what I'm doing doesn't work, but how do I get it to do
what I
want?
My XSL and XML are below. I'd really appreciate any help you can give.
Thanks!
Amy
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:Aps="http://www.assist.com/aps/"
exclude-result-prefixes="Aps">
<xsl:output method="html" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="Name" select="."/>
<xsl:template match="/">
<xsl:for-each select="//Aps:ProductStructure">
<tr>
<td><xsl:value-of select="Aps:Name"/></td>
<td><xsl:value-of select="Aps:AssemblyName"/></td>
<td><xsl:value-of select="Aps:PartNumber"/></td>
<td><xsl:value-of select="$Name"/></td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
<!DOCTYPE Aps:VpmResultSet SYSTEM
"http://localhost/assist/config/dtd/ApsVpmProductStructure.dtd">
<Aps:VpmResultSet xmlns:Aps="http://www.assist.com/aps/">
<Aps:ProductStructure xmlns:Aps="http://www.assist.com/aps/">
<Aps:AssemblyName>GE4</Aps:AssemblyName>
<Aps:PartNumber>r20358</Aps:PartNumber>
<Aps:Name>harness 2</Aps:Name>
<Aps:AsBuilt>
<Aps:TestResults>
<Aps:Name>GE-4-tpe-rai-data.zip</Aps:Name>
</Aps:TestResults>
</Aps:AsBuilt>
</Aps:ProductStructure>
</Aps:VpmResultSet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list