Altova Mailing List Archives


Re: Schema validation question

From: "Priscilla Walmsley" <nospam@-------.--->
To: NULL
Date: 4/23/2004 2:56:00 PM
Well, "xmlns" is not an attribute - it's a namespace declaration.  And it
has nothing to do with what's the root element.

You need to use prefixes in your instances, as in:

<filing xmlns:foo="http://www.xxx.org/yyy.xsd">
 <foo:zzz  foo:a="asdf" foo:b="asdfs">
 ...
 </foo:zzz>

But again, this only matters if your instance has attributes in it (besides
xmlns) such as foo:a and foo:b above.  Otherwise, it's irrelevant and XML
Spy should not be giving you an error message.

Priscilla


"Eric Gurney" <egurney@i...> wrote in message
news:e8edkHWKEHA.3184@T......
> I'm not, I getting the schema from somebody else.
> So since the xmlns is an attribute of the root element it must be
qualified?
>
> "Priscilla Walmsley" <nospam@d...> wrote in message
> news:Ojntr8VKEHA.624@T......
> > Eric
> >
> > If you don't have any attributes in your schema then it's irrelevant,
and
> > XMLSpy">XMLSpy should not require you to have a prefix for the namespace.
> >
> > But, if you do have any attributes, and you use
> > attributeFormDefault='qualified', all of the attributes in your instance
> > MUST be prefixed.  That is because default namespace declarations like
the
> > one you have won't apply to attribute names.
> >
> > Why are you using attributeFormDefault='qualified'?  That's pretty
> unusual.
> >
> > Hope that helps,
> > Priscilla
> >
> > ----------------------------------------------------------------
> > Priscilla Walmsley
> > Author, Definitive XML Schema  /  XML in Office 2003
> > http://www.datypic.com
> > ---------------------------------------------------------------- 
> >
> >
> > "Eric Gurney" <egurney@i...> wrote in message
> > news:OkEUh2VKEHA.2452@T......
> > > I have a schema that was given to me that looks like this:
> > >
> > > <?xml version="1.0" ?>
> > > - <xs:schema id="Filing" targetNamespace="http://www.xxx.org/yyy.xsd"
> > > xmlns="http://www.xxx.org/yyy.xsd"
> > > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > attributeFormDefault="qualified"
> > > elementFormDefault="qualified">
> > > <xs:element name="zzz">
> > > ....
> > > </xs:elemment>
> > >
> > > and a cooresponding XML file that looks like this:
> > >
> > > <?xml version="1.0" encoding="us-ascii"?>
> > > <filing xmlns="http://www.xxx.org/yyy.xsd">
> > > <zzz>
> > > ...
> > > </zzz>
> > >
> > > when I attempt to validate using XmlValidatingReader is validates
fine,
> > but
> > > when I try to validate using XmlSpy, I get the following error:
> > > "Your schema uses attributeFormDefault='qualified' - you must specify
a
> > > prefix for your schema namespace 'http://www.xxx.org/yyy.xsd'"
> > >
> > > Which of there is correct and why?
> > >
> > > Thanks,
> > > Eric
> > >
> > >
> >
> >
>
>


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.