OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Schema Namespace name, schemaLocation,and Schema Versionin

[ Lists Home | Date Index | Thread Index ]

1) You are not using the correct namespace for xml schemas.  Use

xmlns:xs="http://www.w3.org/2001/XMLSchema";

and

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

These namespaces are unique strings that are used as identifiers of their
namespaces.  They have to be correct.

2) You do not need connectivity to use them.  Nothing is looked up for them,
they are just unique strings in the (required) form of a URI.

Cheers,

Tom P

[Naren Koka]


The schmalocation itself is pretty confusing.  For example I have the
following xml and xsd

[s.xsd]

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/1/XMLSchema";>
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="grade" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

[s.xml]

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="s.xsd" >
<grade>a</grade>
</root>

It does not matter what I change the values of xmlns:xsi and the location I
get the same errors.  I have s.xsd in the same directory.  Even if I change
the file name, there is no effect.  How can I make it look at the schema
defined in the same dierctory?

[Error] s.xml:2:103: Element type "root" must be declared.
[Error] s.xml:3:9: Element type "grade" must be declared.
s.xml: 280 ms (2 elems, 1 attrs, 0 spaces, 4 chars)

What is the purpose of the reference to w3.org?  Is the parser going to
connect to the website and check the definitions?  Does this require
connectivity to the web site for working?

Thanks,
Naren

>

-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>







 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS