Parsing mixed text and xml nodes with Xstream

2019-09-01 01:05发布

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)

1条回答
乱世女痞
2楼-- · 2019-09-01 01:41

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>
查看更多
登录 后发表回答