Mark Wrote:-

> Hello,
> 
> can somebody tell me where you can use the attributes "schemaLocation" and
> "noNamespaceSchemaLocation"? 

To use schemaLocation, it takes two values "Namespace & schema filename" & can 
take N no of pairs (i don't know exactly, if there is any limit based on 
parser(s)), you need to have targetNamespcae defined in your schema like:-

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                      targetNamespace="http://www.xyz.org";
                      xmlns="http://www.xyz.org";
                      elementFormDefault="qualified">
 
then, create XML Doc instance like:-

<foo xmlns ="http://www.xyz.org";
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                    xsi:schemaLocation="http://www.xyz.org foo.xsd">
  .....
  .....
</foo>                            
                                                         
                                                         
To use noNamespaceSchemaLocation, you need not to have targetNamespace defined,
like:-

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                      elementFormDefault="qualified">
 
then, create XML Doc instance like:-

<foo xmlns ="http://www.xyz.org";
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                    xsi:noNamespaceSchemaLocation="foo.xsd">
  .....
  .....
</foo>
                                                      
> Do you only can use it in the rootelement or also
> anywhere in the document? I have already look for this in the
> w3c-definitions, but didn't find anything.
>                                                         
  
schemaLocation attribute is also used in <xsd:redefine>, <xsd:import> & 
<xsd:include> etc (As per my info).
 
I think, it will help ..

Cheers

Gopal
-----------------------
SUN Microsystems, India
                                                         
                                                         
                                                         
                                                         
                                                         
                                                         
                             


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

Reply via email to