Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: extract inner xml...

From: Loocek <Loocek@--.-->
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent