ngallagher / simplexml

Simple XML
Apache License 2.0
97 stars 38 forks source link

element with element or text #12

Open sagar15795 opened 8 years ago

sagar15795 commented 8 years ago

I want to parse XML which can have two forms:

<?xml version="1.0" encoding="UTF-8"?> 
<workflow uri="http://www.myexperiment.org/workflow.xml?id=2770" resource="http://www.myexperiment.org/workflows/2770" id="2770"version="1">Disability estimates by year</workflow>

or:


<workflow uri="http://www.myexperiment.org/workflow.xml?id=12" resource="http://www.myexperiment.org/workflows/12" id="12" version="2">
<id>12</id>
<title>Transcribe a DNA sequence into an RNA sequence</title>
</workflow>

How can I do this? When I try to declare both @Element and @Text in class responsible for Workflow parsing then the exception is thrown when I try to parse XML to the instance of this class.

I am using it with Retrofit 2.0.2