File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XSL problem - Most urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL problem - Most urgent" Watch "XSL problem - Most urgent" New topic

XSL problem - Most urgent

Rajagopal Sundarrajan

Joined: Apr 23, 2003
Posts: 5

I'm creating a DOM like this:

<AttributeName>D-H Customer description</AttributeName>
<AttributeName>D-H Customer code</AttributeName>
<AttributeName>Country Of Vehicle Assembly</AttributeName>

I'm trying to display the <AttributeName> in a list using the XSL code.

<select name="attribute" style="width:200px" multiple="true" size="3">
<xsl:for-each select="../View/Adhoc/Attributes/Attribute">
<xsl:element name="option">
<xsl:attribute name="value">
<xsl:value-of select="AttributeID"/>
<xsl:value-of select="AttributeName"/>

But the list loaded with zero items. Plz. help to resolve this..

Bajji Pat
Ranch Hand

Joined: Apr 05, 2005
Posts: 50
Hi Sundar,

Pls change the XPATH to the following

/View/Adhoc/Attributes/Attribute instead of ../View/Adhoc/Attributes/Attribute

Alternatively //Attribute would also work..

The problem i guess was .. since it does a selection from the current node, so as u traverse the dom tree such a condition i.e. matching the XPATH /View/Adhoc/Attributes/Attribute does not occur

Pls let me know if this solves your problem

Balaji Pattabhiraman

[ May 04, 2005: Message edited by: Bajji Pat ]
[ May 04, 2005: Message edited by: Bajji Pat ]
I agree. Here's the link:
subject: XSL problem - Most urgent
It's not a secret anymore!