Simple XML Framework - Adding XSI Location in JAVA -


issue: no annotation provided adding xsi location root. stackoverflow question detailed same problem in c#. i'm not quite sure how covert on java. need update xml in flat file , thought of using string manipulation add xsi locations hoping there might cleaner approach.

reference question: c# stackoverflow same issue

sample xml:

<?xml version="1.0" encoding="utf-8"?> <ns0:mysample xmlns:ns0="someurl" xsi:schemalocation="someotherurl"> <othertag/> </ns0:mysample> 

since schemalocation attribute , not namespace can parse using @attribute annotation.

@attribute private string schemalocation; 

do not forget declare namespace of root element:

@namespace(prefix="xsi", reference="http://www.w3.org/2001/xmlschema-instance"), 

this worked fine me.


Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -