node test

G

glk127

Hi,

Having a hard time with an XPath function and I need some help.

I have the following rdf:

<bdl:source rdf:parseType="Resource">
<bdl:sourceName>Bilbo, Baggins</bdl:sourceName>
<bdl:sourceEmail>[email protected]</bdl:sourceEmail>
<bdl:sourceHomepage></bdl:sourceHomepage>
<bdl:location rdf:parseType="Resource">
<bdl:city>Chicago</bdl:city>
<bdl:state>IL</bdl:state>
<bdl:country>United States</bdl:country>
<bdl:region>NorthCentral</bdl:region>
</bdl:location>
<bdl:academicAffiliation>None</bdl:academicAffiliation>
</bdl:source>

I have a bunch of params set at the top of my stylsheet, including the
following parameter: <xsl:param name="city"/> I've verified that city
is getting the correct value before running the function and that the
rest of the stylesheet is working as it should. When I run the XPath
function for bdl:city, however, nothing is returned (should have five
hits for Chicago). It is contained in a long for-each call that sets a
variable to true|false. Can someone tell me what is wrong with the
location path below (or is it the function):

<xsl:for-each select="bdl:foo">
<xsl:variable name="bar">
....
....

<!-- THIS WORKS -->

<xsl:if test="string-length(normalize-space($academicaffl)) > 0">
<xsl:if test="not(bdl:source/bdl:academicAffiliation[contains(text(),$academicaffl)])">
<xsl:value-of select="false()"/>
</xsl:if>
</xsl:if>

<!-- THIS DOESNT WORK -->

<xsl:if test="string-length(normalize-space($city)) > 0">
<xsl:if test="not(bdl:source/bdl:location/bdl:city[contains(text(),$city)])">
<xsl:value-of select="false()"/>
</xsl:if>
</xsl:if>

</xsl:variable>
</xsl:for-each>

Using xalan 2.6.0

Thanks in advance,

Gerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top