[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl:param as a global
The parameter must be a value, not an expression that is evaluated to return a value. If you want to treat a string as an XPath expression, you can use the saxon:evaluate() or xalan:evaluate() extension function. Mike Kay > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of > Amy Kaizerman > Sent: 14 September 2001 21:26 > To: XSL List > Subject: xsl:param as a global > > > 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 > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|