[jdom-interest] Namespace declaration

Sachin Keshavan Sachin.Keshavan at symphserv.com
Thu Aug 8 01:48:59 PDT 2002

Hello all,

I am using the following code snippet to create a Namespace for validating
the xml file.
Element pDetails = new
Attribute schemaVal = new Attribute("noNamespaceSchemaLocation",

This generates the xml file in the following format
<xsi:Personal_Details xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

How ever my XML editor declares this XML document as an invalid one (I use
XMLSpy). Its says the Root Element is not defined in the DTD/Schema

The XML editor generates a sample XML file based on the Schema. Which is:
<Personal_Details xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

This file is valid (XML Editor says so). The only differenece between both
the files is the "xsi" tag which comes in the Personal_Details tag. 

Is there any other way of setting the namespace attributes, so that XMLSpy
identifies it as a correct file.

Thanks in advance,

More information about the jdom-interest mailing list