[jdom-announce] FW: xerces and jdom-beta5 question

Sibon Barman sibon at ss8networks.com
Tue Oct 24 15:05:43 PDT 2000


-----Original Message-----
From: Sibon Barman [mailto:sibon at ss8networks.com]
Sent: Tuesday, October 24, 2000 5:52 PM
To: xerces-j-dev at xml.apache.org; jdom-interest-request at jdom.org;
jdom-announce-request at jdom.org
Subject: xerces and jdom-beta5 question


Hi all,
I am trying to generate a document with root element as follows:
<document xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
	    xsi:noNamespaceSchemaLocation='slp.xsd'>
</document>
I declare my root element in the above way so that I can use Xerces for
later parsing and validating with schema --- unless the Xerces gurus know a
different way of specifying the schema location.

I use the following piece of code for generating the above (using jdom-beta5
API):
new Element("document")
            .addAttribute(new Attribute("xsi",
            "http://www.w3.org/1999/XMLSchema-instance",

Namespace.getNamespace("http://www.w3.org/1999/XMLSchema-instance")))
            .addAttribute(new Attribute("noNamespaceSchemaLocation",
            "slp.xsd", Namespace.getNamespace("xsi", "slp.xsd")));

and what I get out of this code snippet is:

<document xmlns="http://www.w3.org/1999/XMLSchema-instance"
	    xsi="http://www.w3.org/1999/XMLSchema-instance"
          xmlns:xsi="slp.xsd"
          xsi:noNamespaceSchemaLocation="slp.xsd">
</document>

So you can see that's not what I need  ---- is there anyone with ideas on
how to accomplish the  generation of the root element as specified at the
begining of the email using jdom.

Cheers,
Sibon.




More information about the jdom-announce mailing list