From: Kostya <kma...@gm...> - 2009-12-02 23:09:32
|
Jimmy, thanks a lot for you answer. Just to recheck - the inserted writeVTD() class should be here: if (offset>= endOffset) throw new EOFException("permature EOF reached, XML document incomplete"); for (int i = 0; i < sl; i++) { if (XMLDoc[sos + i] != XMLDoc[temp_offset + i]) throw new ParseException( "Ending tag error: Start/ending tag mismatch" + formatLineNumber()); } depth--; writeVTD(temp_offset, length1, TOKEN_ENDING_TAG, depth); /// !!!!! HERE, RIGHT? ch = getCharAfterS(); if(ch != '>') throw new ParseException( "Ending tag error: Invalid char in ending tag " + formatLineNumber()); Kostya. jimmy Zhang wrote: > I think that feature exists in XMLModifier's class, the method is > called updateElementName(), but after calling the method > you have to call XMLModifier's output() to get a new XML document... > > if you want to get the ending tag of the VTD tokens, it's fairly easy > to do it yourself... just go to the source code of vtdGen's parse > method, go to where ending tag is processed, and turn on the writeVTD > method for ending tag > > add > > writeVTD(temp_offset, length1, TOKEN_ENDING_TAG, depth); > after line #1966 of VTDGen.java > > the VTD record for ending tag will just be available > > ----- Original Message ----- > *From:* Kostya Mashukov <mailto:kma...@gm...> > *To:* vtd...@li... > <mailto:vtd...@li...> > *Sent:* Wednesday, December 02, 2009 1:54 PM > *Subject:* [Vtd-xml-users] Closing tags > > Hi to everyone! > > Is it possible to see closing tags (TOKEN_ENDING_TAG) after parsing? > In the version I'm using (2.7, java), closing tags are just thrown > away. > I see some tracks of this functionality in source code, however. > > I'm implementing a simple XML-editor and the required feature is > the ability > to simultaneously change the name of starting and ending tags. > It is possible to locate the caret position of any opening tag, > say <a>, (using offset), but how to locate position of > corresponding closing tag </a> ? > Do any possible solutions exist? > > Kostya. > > ------------------------------------------------------------------------ > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > > ------------------------------------------------------------------------ > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |