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@xxxxxxxxx> 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
| Current Thread |
- RE: XSL Javascript prob, (continued)
- Chris Bayes - Thu, 13 Sep 2001 05:06:20 -0400 (EDT)
- P Vikram - Thu, 13 Sep 2001 11:45:36 -0400 (EDT)
- P Vikram - Thu, 13 Sep 2001 14:53:41 -0400 (EDT)
- David Carlisle - Thu, 13 Sep 2001 17:07:38 -0400 (EDT)
- P Vikram - Sat, 15 Sep 2001 12:10:13 -0400 (EDT) <=
- Jeni Tennison - Tue, 18 Sep 2001 06:00:38 -0400 (EDT)
- P Vikram - Tue, 18 Sep 2001 12:08:32 -0400 (EDT)
- Michael Kay - Sat, 15 Sep 2001 16:23:58 -0400 (EDT)
- Thomas B. Passin - Sat, 15 Sep 2001 00:04:43 -0400 (EDT)
|
|