Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Problem creating the right namespace.

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Christian-Josef Schrattenthaler" <hotline AT software-agentur.com>
  • To: <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Problem creating the right namespace.
  • Date: Wed, 25 Feb 2009 10:05:11 +0100

Hi!



I have to use xml files for a little Java project. These files are
generated over the Java application itself, but I have to use an
external xml schema.



The root element must look like:



<rootelement xmlns=http://... xmlns:xsi=http://...
xsi:schemaLocation="http://...";>



I did:



Element xmlRoot = new Element("onlv",
"http://www.oenorm.at/schema/A2063/2009-01-15";);

xmlRoot.addNamespaceDeclaration("xsi",
"http://www.w3.org/2001/XMLSchema-instance";);



But now I don't know how to add 'xsi:schemaLocation="http://...";', and I
have an empty (xmlns="") attribute on each child element I add to the
root element.



This generates an error, while validating the xml file against the
external xml schema.



I tried also to add a second parameter "" while creating the element,
but this doesn't work.



I googled for the problem, but I didn't find anything useful



Kind greetings,

Christian.





Archive powered by MHonArc 2.6.24.

Top of Page