From: Jimmy Z. <cra...@co...> - 2006-11-15 18:35:18
|
Yes, it is possible, there is a little mentioned class called textIterator that you can use for that purpose.. if there are more than one child text node for a given element, it is implicitly mixed content.... The basic syntax is as follows // assuming vn is an instance of VTDNav ti = new textIter(vn); while( (int i= ti.getNext())!= -1){ // i is the text node associated with the element at the cursor //position system.out.println("text node is ==> "+vn.toString(i)); } ----- Original Message ----- From: "Paul Tomsic" <pt...@gm...> To: <vtd...@li...> Sent: Wednesday, November 15, 2006 7:56 AM Subject: [Vtd-xml-users] mixed content? >i need a way, if given an XML document, to determine if a node was > marked as mixed=true in the schema. if it was, then return it's > children nodes as text. is this possible within vtd? > > The reason for this is b/c we've got "rich text" or "html" in XML > documents, and need a way to determine what is a child node, and > what's intended to be html. > > Something like > > <foo><em>emphasis</em> and some <b>bold</b> text as well</foo> > > So <foo> would be marked as mixed=true, then i'd return the contents > between the foo elements. > > is there a better/more standard way to do this (short of marking it > all as CDATA) ? > > i can't seem to find a decent way to do what i'm trying to do. > thanks > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |