G
gimme_this_gimme_that
What xpath expression would return the category-item having uid sps002
?
<category-list>
<category>
<uid>GRIDS_MAIN_CATEGORY_UID</uid>
<uid-type>Categories</uid-type>
<category-item-list>
<category-item>
<uid>sps0002</uid>
<uid-type>Grids</uid-type>
</category-item>
<category-item>
<uid>sps0005style0003</uid>
<uid-type>Grids</uid-type>
</category-item>
</category>
<category>
<uid>GRIDS_MAIN_CATEGORY_UID</uid>
<uid-type>Categories</uid-type>
<category-item-list>
<category-item>
<uid>sps0002</uid>
<uid-type>Grids</uid-type>
</category-item>
<category-item>
<uid>sps0005style0003</uid>
<uid-type>Grids</uid-type>
</category-item>
</category>
</category-list>
I've tried the following Xpath expression ... :
<xsl:when
test="'sps0002'=//category-list/category/category-item-list/category-item/uid">
<xsl:value-of select="./uid"/>
Which doesn't work. (Help!)
But actually, what I'd really like is an Xpath expression
that would fetch this node directly without using a xsl:when.
What I'm actually doing is checking if a node with an id of sps002
exists in a JDOM Element using it's the JDOM XPath object. This returns
either an Element or an Attribute. But right now I'm having to
fetch all the category-item Elements and iterate through them to
determine
if one with an sps002 id exists.
Thanks.
?
<category-list>
<category>
<uid>GRIDS_MAIN_CATEGORY_UID</uid>
<uid-type>Categories</uid-type>
<category-item-list>
<category-item>
<uid>sps0002</uid>
<uid-type>Grids</uid-type>
</category-item>
<category-item>
<uid>sps0005style0003</uid>
<uid-type>Grids</uid-type>
</category-item>
</category>
<category>
<uid>GRIDS_MAIN_CATEGORY_UID</uid>
<uid-type>Categories</uid-type>
<category-item-list>
<category-item>
<uid>sps0002</uid>
<uid-type>Grids</uid-type>
</category-item>
<category-item>
<uid>sps0005style0003</uid>
<uid-type>Grids</uid-type>
</category-item>
</category>
</category-list>
I've tried the following Xpath expression ... :
<xsl:when
test="'sps0002'=//category-list/category/category-item-list/category-item/uid">
<xsl:value-of select="./uid"/>
Which doesn't work. (Help!)
But actually, what I'd really like is an Xpath expression
that would fetch this node directly without using a xsl:when.
What I'm actually doing is checking if a node with an id of sps002
exists in a JDOM Element using it's the JDOM XPath object. This returns
either an Element or an Attribute. But right now I'm having to
fetch all the category-item Elements and iterate through them to
determine
if one with an sps002 id exists.
Thanks.