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

Kesav Kumar kesavk at voquette.com
Tue Oct 24 16:29:18 PDT 2000


Use the following code

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

It works there is no problem with namespaces after the Brett fix.

Kesav Kumar
Software Engineer
Voquette, Inc.
650 356 3740
mailto:kesavk at voquette.com
http://www.voquette.com


-----Original Message-----
From: Sibon Barman [mailto:sibon at ss8networks.com]
Sent: Tuesday, October 24, 2000 3:06 PM
To: jdom-announce at jdom.org; jdom-interest at jdom.org
Subject: [jdom-interest] FW: xerces and jdom-beta5 question




-----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.

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list