How to parse XML in this way (an XML that is being an internal tag). I'm not trying to do simple Choice node when I try it to print it can always be shown to blank Anybody can help me.
& lt; ItemBody & gt; & Lt; P & gt; Look at the text given in the picture. & Lt; / P & gt; & Lt; P & gt; & Lt; Img src = "picture / sign-page" alt = "never loots" /> gt; & Lt; / P & gt; & Lt; ChoiceInternational ReactionDirector = "Response" alteration = "false" maxChoices = "1" & gt; & Lt; Prompt> What does this say? & Lt; / Prompt> & Lt; Common Choice Identifier = "Choice" & gt; You have to be with your luggage all the time. & Lt; / SimpleChoice & gt; & Lt; General Choice Identifier = "Choice B" & gt; Do not look after someone else for your stuff. & Lt; / SimpleChoice & gt; & Lt; Ordinary keys identifier = "Choice" & gt; When you leave, remember your stuff. & Lt; / SimpleChoice & gt; & Lt; / ChoiceInteraction & gt; & Lt; / ItemBody & gt;
Whatever I tried -
node list nodelist = doc.getElementsByTagName ("itemBody"); XMLParser parser = new XMLParser (); For (int i = 0; i & nt; nodlist.getlammith (); i ++) {element e = (element) node list.itim (i); Logs. I ("tag", "& lt; p & gt;:" + parser.getValue (e, "p")); //Log.i ("TAG"), "Number:" + parser.gate value (e, "choice interaction")); //Log.i(""ε "target =" _ blank ">" parser.getValue "(E," P ")); } Node list nodechain interaction list = doc.getElementsByTagName ("preference variation"); (Int j = 0; j and lt; nodeshoice interaction list. Tag lang (); j ++) {element echo interaction list = (element) nodechoice interaction list.itm (j); Logs. I ("tag", "& lt; sign>:" + parser.getValue (eChoiceInteractionList, "prompt")); } Nodelist Simple Selection List = doc.getElementsByTagName ("Simple Options"); For (int j = 0; jay lieutenant; simple chesslist.gate lamps (); j ++) {element e-simple charge = (element) list. Atom (j); Logs. I ("tag", "and lieutenant; simple option"; "+ parser.getValue (eSimpleChoice," simpleChoice "));}
You are looking for a child of the item body, so you have to do it again. NodeChoiceInteractionList is looking for a simple Choice node, as you do with a quick node. / P>
Also try to print your log time, this code repeats to give you an idea
for (int j = 0; j end Lt; nodeshoice int Reaction list. Tag gender (); J ++) {Element echo interaction list = (element) nodechoice interaction list.itm (j); log I ("tag", ":" + parser.getValue (EChoiceInteractionList, "prompt")); & gt; Log.I ("tag", "simple option"; "+ parser.gate value" (eSimpleChoice, "simple option"); & gt; ;> Log D. ("Either Number", J);}
Comments
Post a Comment