This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Array XSL PROb
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] Array XSL PROb
- From: P Vikram <vikram_good_boy at yahoo dot com>
- Date: Fri, 14 Sep 2001 17:50:29 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi
Iam using javax.xml.Transform for transformation.My
XML is like
<testnode><top><NAME>myname</NAME><top></testnode>.
My XSL is like below:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" />
<xsl:template match="testnode">
myarray = [
<xsl:apply-templates select="//top"/>
]
</xsl:template>
<xsl:template match="top">
"<xsl:value-of select="NAME"/>",
</xsl:template>
</xsl:stylesheet>
Now in the array myarray two rows are getting
populated.one myname and second undefined.
How to make only the array gets populated with myname.
Using xsl:if gives an error:
"testnode" attribute is not allowed on the xsl:if
element!
Thanks
Vikram
--- David Carlisle <davidc@nag.co.uk> wrote:
>
> > is giving and error...any ideas
> it's hard to say if you don't tell us what the error
> was but
> I'll note that if you are using a system that
> produces messages like the
> one you quoted:
>
> > "test" attribute is not allowed on the xsl:if
> > element!
>
> then it isn't an XSLT system so sending correct XSLT
> might not work.
>
> Other than that I'll note that you said:
>
> > <id> & <name> .
>
> but your code had
>
> > "<xsl:value-of select="ID"/>""<xsl:value-of
> > select="NAME"/>",
>
> ID does not mach <id> XML is case sensitive. However
> that should not
> produce an error it should just produce nothing.
>
> David
>
>
_____________________________________________________________________
> This message has been checked for all known viruses
> by Star Internet
> delivered through the MessageLabs Virus Scanning
> Service. For further
> information visit http://www.star.net.uk/stats.asp
> or alternatively call
> Star Internet for details on the Virus Scanning
> Service.
>
> XSL-List info and archive:
> http://www.mulberrytech.com/xsl/xsl-list
>
__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list