Hi Cath,

Not sure how this got by me, but it turns out you're also using old-style
syntax; complexType has no content attribute in the Schema CR draft--you'll
need to use complexContent or simpleContent elements inside the complexType
as appropriate.  Take a look at the personal-schema example shipped with
the parser; this should give you a template to work with when reshaping
your schema.

Hope that helps,
Neil

Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  416-448-3519, T/L 778-3519
E-mail:  [EMAIL PROTECTED]



ibrahim <[EMAIL PROTECTED]> on 02/12/2001 11:09:46 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: TargetNamespace Problem


Hi Andy, Neil :)

I tried putting the xsd for targetNamespace and elementFormDefault, but
DOMParser gives
General Schema error: Schema in TNS.xsd has a different target namespace
from
the one specified in the instance document: http://MyDomain.com/TNS.

in TNS.xsd
 xsd:targetNamespace="http://MyDomain.com/TNS";
 xsd:elementFormDefault="qualified">

I changed 1999 into 2000/10 but DOMParser also gives General Schema error :
Grammar with uri 2:http://MyDomain.com/TNS can not found.

in TNS.xsd :
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema";

in TNS.xml:
 xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance";

btw, better ask again to make sure. This namespace (http://MyDomain.com/TNS
in
this case) does not need to be a truly existing url right... ?

thx :)
cath

Andrew Newton wrote:

> Cath,
>
> Just a guess, but try "xsd:targetNamespace" and
> "xsd:elementFormDefault" in your schema.
>
> -andy
>
> On Mon, Feb 12, 2001 at 03:47:17PM +0100, ibrahim wrote:
> > Hi,
> >
> > I'm trying to use namespace for my XML document here. I tried putting
in
> > the example of TNS documents plus binding and elementFormDefault to be
> > 'qualified' :
> >
> > TNS.xml:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <dv:main
> >     xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
> >     xmlns:dv="http://MyDomain.com/TNS";
> >     xsi:schemaLocation="http://MyDomain.com/TNS TNS.xsd">
> >   <dv:child />
> > </dv:main>
> >
> > TNS.xsd:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsd:schema
> >   xmlns:xsd="http://www.w3.org/1999/XMLSchema";
> >   xmlns="http://MyDomain.com/TNS";
> >   targetNamespace="http://MyDomain.com/TNS";
> >   elementFormDefault="qualified">
> >
> > <xsd:element name="main" >
> >   <xsd:complexType content="elementOnly">
> >     <xsd:element name="child" type="child" minOccurs="0"
> > maxOccurs="unbounded" />
> >   </xsd:complexType>
> > </xsd:element>
> >
> > <xsd:complexType name="child" content="empty" />
> >
> > </xsd:schema>
> >
> > But the parser gives erros saying that "dv:main" and "dv:child" must be
> > declared. What's wrong?
> >
> > thanks a lot for your help,
> > cath
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> Andrew Newton
> [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Reply via email to