Search code examples
xmlparsingxstream

Parsing mixed text and xml nodes with Xstream


I'm trying to parse xml done like this:

<foreign lang="gre">&lsquo;<LM lemma="auieo" catg="fg">auieo</LM>&rsquo;</foreign>

I'm using Xstream, and I tried to write a specific Converter, but it does not work :( I don't understand how to split the content of foreign in 'text' blocks and in the Lemma xml (I've a specific Converter for that)


Solution

  • Xstream is not able to parse mixed content. I preprocessed the xml with xslt and transfored it to unmixed xml, with this command:

    <xsl:template match="text()">
         <t> <xsl:value-of select="."/> </t>
    </xsl:template>