wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL problem - Most urgent" Watch "XSL problem - Most urgent" New topic
Author

XSL problem - Most urgent

Rajagopal Sundarrajan
Greenhorn

Joined: Apr 23, 2003
Posts: 5
Hi,

I'm creating a DOM like this:

<View>
<Adhoc>
<report-title></report-title>
<report-date></report-date>
<report-template-id>null</report-template-id>
<report-template-name></report-template-name>
<report-script-id>null</report-script-id>
<report-script-name></report-script-name>
<report-selected-source-file>AUTOPART-1</report-selected-source-file>
<report-source-files/>
<Attributes>
<Attribute>
<AttributeID>333</AttributeID>
<AttributeName>D-H Customer description</AttributeName>
<AttributeAlias>dhcustdescr</AttributeAlias>
</Attribute>
<Attribute>
<AttributeID>444</AttributeID>
<AttributeName>D-H Customer code</AttributeName>
<AttributeAlias>dhcustcode</AttributeAlias>
</Attribute>
<Attribute>
<AttributeID>555</AttributeID>
<AttributeName>Country Of Vehicle Assembly</AttributeName>
<AttributeAlias>cva</AttributeAlias>
</Attribute>
<Attribute>
<AttributeID>666</AttributeID>
<AttributeName>Transmission</AttributeName>
<AttributeAlias>Trmn</AttributeAlias>
</Attribute>
<Attribute>
<AttributeID>777</AttributeID>
<AttributeName>Engine</AttributeName>
<AttributeAlias>ENGINE</AttributeAlias>
</Attribute>
</Attributes>
</Adhoc>
</View>

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:attribute>
<xsl:value-of select="AttributeName"/>
</xsl:element>
</xsl:for-each>
</select>

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

Regards
Sundar
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

Regards
Balaji Pattabhiraman

[ May 04, 2005: Message edited by: Bajji Pat ]
[ May 04, 2005: Message edited by: Bajji Pat ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSL problem - Most urgent
 
Similar Threads
xsl getNext to sort output
mouse hover on multiselect dropdown
Tool to build ANT or MAVEN scripts
xslt /xpath issue
xsl - need to select on attribute and limit output