51500

Parsing mixed text and xml nodes with Xstream

Question:

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)

Answer1:

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>

Recommend

  • NLTK Lemmatizer, Extract meaningful words
  • finding noun and verb in stanford parser
  • how can i send a xml through a url
  • How to get a parse in a bracketed format (without POS tags)?
  • Fetching data from Microsoft Access database using SELECT QUERY WITH WHERE CLAUSE in python
  • Processing input before giving input to parser
  • How to move object to arrangement?
  • JSON to Objects in java?
  • Regular expression for apostrophes/ single quotes with double
  • Python Programming 3.4.2, Naughts and Crosses. Best way to check how to see if game is won?
  • Splitting string into groups of specific length
  • non-conformable arrays when passing numpy array to R via rpy2
  • How to predict a new value using simple linear regression log(y)=b0+b1*log(x)
  • Haskell: List Created Evaluating List Elements
  • get equation of linear SVM regression line
  • Xstream to map “choice” elements of XML
  • Email format validation in mvc3 view
  • C# - Is there a limit to the size of an httpWebRequest stream?
  • How to add date and time under each post in guestbook in google app engine
  • How to show dropdown in excel using jrxml (jasper api)?
  • Importing jscolor library in angular 2
  • Release, debug version and Authorization Google?
  • Websockets service method fails during R startup
  • Alternatives to the OPTIONAL fallback SPARQL pattern?
  • How to get next/previous record number?
  • Apache 2.4 - remove | delete | uninstall
  • Matrix multiplication with MKL
  • Proper way to use connect-multiparty with express.js?
  • CSS Applying specific rule for a specific monitor resolution with only CSS is posible?
  • What are the advantages and disadvantages of reading an entire file into a single String as opposed
  • Trying to get generic when generic is not available
  • coudnt use logback because of log4j
  • embed rChart in Markdown
  • How to get Windows thread pool to call class member function?
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • UserPrincipal.Current returns apppool on IIS
  • Converting MP3 duration time
  • java string with new operator and a literal