Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Validating XML against Schema

From: "Priscilla Walmsley" <nospam@-------.--->
To: NULL
Date: 7/2/2004 6:13:00 PM
Hi Murali,

If you specify a target namespace for a schema document, the globally
declared elements in that document are in that namespace.  (Globally
declared elements are the ones where the xs:element element is a direct
child of the xs:schema element. )  This means that in your XML instance
document, those elements must be qualified with a namespace, using a
namespace declaration.

If you specify elementFormDefault="qualified", locally declared elements are
also in that target namespace.  (Locally declared elements are the ones that
are declared within a complex type.)  If you specify
elementFormDefault="unqualified", or leave this attribute off entirely, the
locally declared elements are in NO namespace.

In your case, your root element AccountUpdate was declared in a schema
document that has no target namespace, so it is in no namespace.  The other
elements are all locally declared, and you used
elementFormDefault="unqualified", so they too are in no namespace.  Even
though some of them were declared in a schema that had a target namespace.

So, since all your elements are in no namespace, you did not need any
namespace declarations in your instance XML.

Hope that helps,
Priscilla




------------------------------------------------------------------
Priscilla Walmsley
Author, Definitive XML Schema  /  XML in Office 2003
http://www.datypic.com
------------------------------------------------------------------

"Murali Maddali" <maddalimurali@y...> wrote in message
news:ukyuw$HYEHA.3012@t......
> Thank you Priscilla for all your help, noNamespaceSchemaLocation and
> removing xmlns:cisGlobals did the trick. Now the xml file validates
> according to schema.
>
> I have one final question, what does targetNamespace do? and what does
> elementFormDefault="unqualified" imply?
>
> Thank you.
> murali.
>
>
>
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent