XPath filter not empty attribute
Posted
by Marcos Buarque
on Stack Overflow
See other posts from Stack Overflow
or by Marcos Buarque
Published on 2010-04-19T19:41:38Z
Indexed on
2010/04/19
19:43 UTC
Read the original article
Hit count: 266
xpath
Hi, I need to filter a XPath expression to grab only a certain attribute as not empty.
I tried this:
<xsl:template match="DocumentElement/QueryResults[string(@FileName)]">
and this:
<xsl:template match="DocumentElement/QueryResults[string-length(@FileName)>0]">
but it did not work. I need the same kind of data returning from the folloing XPath expression...
<xsl:template match="DocumentElement/QueryResults">
... but filtered to avoid items with empty attribute @FileName.
Thanks!
© Stack Overflow or respective owner