Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: extract inner xml... >Thread Next - Re: extract inner xml... Re: extract inner xml...To: NULL Date: 3/17/2009 5:51:00 PM Hi again, Martin Honnen wrote: > Loocek wrote: > >> I need to find and extract inner xml and save as String. >> I cannot find that functionality in any [DOM,SAX,STAX] xml parser in >> java... >> I was able to do it in DOM by serializing Node - but is stupid >> solution.... > > I am not sure why it is a stupid solution. A "raw" input stream of data is read by parser. It creates objects in memory, next base on the object - we create a new "raw" stream that is exactly substring of original string. It waste memory and cpu.... If you want the inner XML > then you will have to serialize the child nodes, unless the object model > is not already providing properties like InnerXml (as for instance the > .NET framework's DOM model does: > http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.innerxml.aspx) I know it is simple. One method call ... > > If you are using the W3C DOM then Level 3 has serialization features > http://www.w3.org/TR/DOM-Level-3-LS/ > I think Java 5 and 6 implement that. In the browser world of the DOM > only Opera supports it but Mozilla has XmlSerializer and IE/MSXML have > the xml property on XML DOM nodes. Thanks for fast answer. Regards Pawel Zawora | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
