Best way to read Namespace from XML stream (using Java) -


i wondering if people had opinions on following.

i have xml segments like:

<?xml version="1.0" encoding="utf-8"?> <clashes:matchingelementandattribute xmlns:clashes="http://example.com/attribelemclashes" clash="123">         <clash>strval</clash> </clashes:matchingelementandattribute> 

and want able extract namespace of xml fragment.

what best way of doing (within java) - , performant.

thanks , suggestions

rob

you can use stax parser woodstox perform large xmls. loads xml stream , event start of element. provides way qname (qualified name) of element object has namespace available property.

have @ http://www.xml.com/pub/a/2003/09/17/stax.html


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -