Chris Peppas wrote:
>>How can I print this xml (with JDOM using Xpath or any other
>>methods) without its tags.
>>
>><?xml version='1.0' encoding='ISO-8859-1'?>
>><words>
>> <word id="word_1">Annotation</word>
>> <word id="word_2">tool</word>
>> <word id="word_3">in</word>
>> <word id="word_4">Java</word>
>> <word id="word_5">.</word>
>></words>
>>
>>I would like to get in a string the sentence that will look like this:
>>
>>Annotation tool in Java.
>>Thank you
How about this XSLT?
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns

sl="http://www.w3.org/1999/XSL/Transform">
<xsl

utput method="text"/>
<xsl:template match="words">
<xsl:for-each select="word">
<xsl:value-of select="concat(.,' ')"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Just use the Xalan libraries from Apache to run it.