Lainaus Thomas Zastrow <[EMAIL PROTECTED]>:

< 
< Hi there, 
< 
< I've got a simple question but I was trying for hours and nothing works
< ...
< 
< I've some documents in Xindice looking like this:
< 
< ....
< <token>
< something
< </token>
< .... 
< 
< 
< This here works fine for querying attributes:
< 
< xindice xpath_query -c /db/corpora/taz -q "/corpus//[EMAIL PROTECTED]'NN']"
< 
< But I want to access the content of the token-tag not the attributes ...
< so, how can I build a query like "Give me all structures where the CONTENT
< of the tag token is "something"" ...
< 
< Thank you,
< 
< Tom
< 

You could use contains() see below XSLT example

<?xml version="1.0"?><!--filename.xsl-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                 version="1.0">
<xsl:output method="xml"/>
 
<xsl:template match="/">                         <!--root rule-->
<xsl:for-each select="elements/element[contains(.,'Jarkko')]">
        <xsl:copy-of select="."/>
</xsl:for-each>
 
</xsl:template>
 
</xsl:stylesheet>

<?xml version="1.0"?>
<elements>
<element>Jarkko</element>
<element>Moilanen</element>
<element>Foobar</element>
</elements>


[EMAIL PROTECTED] development]$ xsltproc contains.xsl contains.xml
<?xml version="1.0"?>
<element>Jarkko</element>

Cheers,
jarkko





***************************************************
* Jarkko Moilanen                                 *
* Project Manager, ITCM (www.itcm.org)            *
* Profound XML technology Expert                  *
* University of Tampere                           *
* Hypermedia Laboratory                           *
***************************************************

Reply via email to