parsing XML with HTML content without CDATA section using java xml parsers -


the xml files need parse have html tags inside nodes, there no cdata sections existing html content. there there way parsing xml file gives text along html tags using java xml parsers. , should not edit xml files.

following xml file trying parse using java xml parsers:

<assessmentitem xsi:schemalocation="http://www.imsglobal.org/xsd/imsqti_v2p0 imsqti_v2p0.xsd" identifier="choice" adaptive="false" timedependent="false" title="200007" xmlns="http://www.imsglobal.org/xsd/imsqti_v2p0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance">     <responsedeclaration identifier="response" cardinality="single" basetype="identifier">         <correctresponse>              <value>c</value>         </correctresponse>     </responsedeclaration>     <outcomedeclaration identifier="score" cardinality="single" basetype="integer"         <defaultvalue>             <value>0</value>         </defaultvalue>     </outcomedeclaration>     <stylesheet href="stylesheet/scip.css" type="text/css" />     <itembody>         <span class="class1">             <b>the graph shows how many children named different animals favorite pets.<br /><br /></b>         </span>         <div class="class2">             <span class="class1">                 <b><img src="images/15063.jpg" alt="" /></b>             </span>         </div>         <span class="class1">             <b>how many children liked dogs or cats favorite pets?</b>         </span>         <choiceinteraction responseidentifier="response" shuffle="false" maxchoices="1">             <simplechoice identifier="a">                 <span class="class1">30</span>                 <rubricblock>                     <span class="class1" >chose number of cats</span>                 </rubricblock>             </simplechoice>             <simplechoice identifier="b">                 <span class="class1">40</span>                 <rubricblock>                     <span class="class1" >chose number of dogs</span>                 </rubricblock>             </simplechoice>             <simplechoice identifier="c">                 <span class="class1">70</span>                 <rubricblock>                     <span class="class1" ><b>correct</b></span>                 </rubricblock>             </simplechoice>             <simplechoice identifier="d">                 <span class="class1">150</span>                 <rubricblock>                     <span class="class1" >chose sum of pets in table</span>                 </rubricblock>             </simplechoice>         </choiceinteraction>     </itembody>     <responseprocessing template="http://www.imsglobal.org/question/qti_v2p0/rptemplates/match_correct" /> </assessmentitem> 


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -