grails - groovy XmlSlurper not parse my xml file -


I have an XML, and I can not parse the file with xmlslurper Here is a copy of my XML file :

  & lt; Entrezgene-Set & gt; & Lt; Entrezgene & gt; & Lt; Entrezgene_summary & gt; This gene is the plasma glycoprotein of the unknown function of the encoded protein. Some immunoglobulin supergene family member shows the sequence similarity to the variable areas of protein. [Provided by RefSeq] & lt; / Entrezgene_summary & gt; & Lt; / Entrezgene & gt; & Lt; / Entrezgene set & gt;   

Just call me & lt; Entrezgene_summary & gt; to

/eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi? " Def qs = [] qs & lt; & Lt; "DB = Gene" QS & LT; & Lt; "Id = 1" qs & lt; & Lt; "Retmode = xml" def url = new URL (base + qs.join ( "& amp;") def connection = url.openConnection () Diif result = [] if (connection.responseCode == 200) {def xml = Connection.content.text def eFetchResult = new XmlSlurper (). ParseText (xml) result.geneSummary = eFetchResult.Entrezgene-Set.Entrezgene.Entrezgene_summary} and {log.error ("PubmedEfetchParserService.PubmedEsearch FAILED") log.error (url) Log.error (connection.responseCode) log.error (connection.response message)} render result}

and my error message:

  Error 500: Groovy .lang.MissingPropertyException: No such property: Entrezgene for class: java.util.Set Servlet: grails y Uarai: /geneInfo/grails/genes/pubmedEfetch.dispatch exception message: No such property: to square Entrezgene: java.util.Set caused by: GroovyklangkMissingPropertyException: No such property: Class Entrezgene for: Java .util.Set Class: Jane's Controller  

I do not know where the meter is Y fault?

I'll try: result.geneSummary = is eFetchResult./Entrezgene-Set/.Entrezgene.Entrezgene_summary

An idea anyone? Thank you

You do not need the absence of the top tag (Anscense-Set>). In the Groovyconsole, the following works for me:

  xml = "" " Entrezine-Set> Antiszenea> Antiszane_Samuri> This gene contains encoded proteins unknown function plasma glycoprotein protein immunoglobulin supergene family is provided by the sequence shows similarity. [RefSeq variable regions of member protein] & lt; / Entrezgene_summary & gt; & lt; / Entrezgene & gt; & lt; / Entrezgene- set & Gt; df ift resolt = new xa Melslr () Kpiarsiitekst (XML) X = Ifet Risltkintrejineantrejine_smuri Printlan "X [$ {x}]"  

Biteedblu, your error message a property name with a property name Due to using Dash


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -