问题
I'm trying to parse xml done like this:
<foreign lang="gre">‘<LM lemma="auieo" catg="fg">auieo</LM>’</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)
回答1:
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>
来源:https://stackoverflow.com/questions/10065648/parsing-mixed-text-and-xml-nodes-with-xstream