Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Problem validating a reference to xsd:schema
Problem validating a reference to xsd:schema [message #594571] Wed, 23 March 2005 13:37
Steve Speicher is currently offline Steve Speicher
Messages: 83
Registered: July 2009
Member

This is a multi-part message in MIME format.
--------------070100040301020706020400
Content-Type: multipart/alternative;
boundary="------------040406020303050409060001"


--------------040406020303050409060001
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I'm attempting to reference the global element "xsd:schema" within my
schema. But the editor/validator is complaining and I don't know why.

Here's my simple schema:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

<xsd:import namespace="http://www.w3.org/2001/XMLSchema"
schemaLocation="XMLSchema.xsd"/>

<xsd:complexType name="complexType">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:choice>
<xsd:element _ref="xsd:schema"_/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>

</xsd:schema>

src-resolve: Cannot resolve the name 'xsd:schema' to a(n) element
declaration component.

What am I doing wrong? I've attached my schemas too.

Thanks in advance,
Steve Speicher

--------------040406020303050409060001
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I'm attempting to reference the global element "xsd:schema" within my
schema.&nbsp; But the editor/validator is complaining and I don't know why.<br>
<br>
Here's my simple schema:<br>
<br>
<blockquote><tt>&lt;?xml version="1.0"?&gt;<br>
&lt;xsd:schema xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;xsd:import namespace=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
schemaLocation="XMLSchema.xsd"/&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;xsd:complexType name="complexType"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsd:sequence minOccurs="0" maxOccurs="unbounded"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsd:choice&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsd:element <font color="#ff0000"><u>ref="xsd:schema"</u></font>/&gt; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/xsd:choice&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/xsd:sequence&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/xsd:complexType&gt;<br>
<br>
&lt;/xsd:schema&gt;</tt><br>
</blockquote>
src-resolve: <font color="#ff0000">Cannot resolve the name
'xsd:schema' to a(n) element declaration component.<br>
<br>
<font color="#000000">What am I doing wrong?&nbsp; I've attached my schemas
too.<br>
<br>
Thanks in advance,<br>
Steve Speicher<br>
</font></font>
</body>
</html>

--------------040406020303050409060001--

--------------070100040301020706020400
Content-Type: text/xml;
name="embedded_schema.xsd"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="embedded_schema.xsd"

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

<xsd:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="XMLSchema.xsd"/>

<xsd:complexType name="complexType">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:choice>
<xsd:element ref="xsd:schema"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>

</xsd:schema>

--------------070100040301020706020400
Content-Type: text/xml;
name="XMLSchema.xsd"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="XMLSchema.xsd"

<?xml version='1.0' encoding='UTF-8'?>
<!-- XML Schema schema for XML Schemas: Part 1: Structures -->
<!-- Note this schema is NOT the normative structures schema. -->

<!-- The prose copy in the structures REC is the normative -->

<!-- version (which shouldn't differ from this one except for -->

<!-- this comment and entity expansions, but just in case -->

<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [

<!-- provide ID type information even for parsers which only read the
internal subset -->
<!ATTLIST xs:schema id ID #IMPLIED>
<!ATTLIST xs:complexType id ID #IMPLIED>
<!ATTLIST xs:complexContent id ID #IMPLIED>
<!ATTLIST xs:simpleContent id ID #IMPLIED>
<!ATTLIST xs:extension id ID #IMPLIED>
<!ATTLIST xs:element id ID #IMPLIED>
<!ATTLIST xs:group id ID #IMPLIED>
<!ATTLIST xs:all id ID #IMPLIED>
<!ATTLIST xs:choice id ID #IMPLIED>
<!ATTLIST xs:sequence id ID #IMPLIED>
<!ATTLIST xs:any id ID #IMPLIED>
<!ATTLIST xs:anyAttribute id ID #IMPLIED>
<!ATTLIST xs:attribute id ID #IMPLIED>
<!ATTLIST xs:attributeGroup id ID #IMPLIED>
<!ATTLIST xs:unique id ID #IMPLIED>
<!ATTLIST xs:key id ID #IMPLIED>
<!ATTLIST xs:keyref id ID #IMPLIED>
<!ATTLIST xs:selector id ID #IMPLIED>
<!ATTLIST xs:field id ID #IMPLIED>
<!ATTLIST xs:include id ID #IMPLIED>
<!ATTLIST xs:import id ID #IMPLIED>
<!ATTLIST xs:redefine id ID #IMPLIED>
<!ATTLIST xs:notation id ID #IMPLIED>
<!--
keep this schema XML1.0 DTD valid
-->
<!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'>

<!ELEMENT hfp:hasFacet EMPTY>
<!ATTLIST hfp:hasFacet
name NMTOKEN #REQUIRED>

<!ELEMENT hfp:hasProperty EMPTY>
<!ATTLIST hfp:hasProperty
name NMTOKEN #REQUIRED
value CDATA #REQUIRED>
<!--
Make sure that processors that do not read the external
subset will know about the various IDs we declare
-->
<!ATTLIST xs:simpleType id ID #IMPLIED>
<!ATTLIST xs:maxExclusive id ID #IMPLIED>
<!ATTLIST xs:minExclusive id ID #IMPLIED>
<!ATTLIST xs:maxInclusive id ID #IMPLIED>
<!ATTLIST xs:minInclusive id ID #IMPLIED>
<!ATTLIST xs:totalDigits id ID #IMPLIED>
<!ATTLIST xs:fractionDigits id ID #IMPLIED>
<!ATTLIST xs:length id ID #IMPLIED>
<!ATTLIST xs:minLength id ID #IMPLIED>
<!ATTLIST xs:maxLength id ID #IMPLIED>
<!ATTLIST xs:enumeration id ID #IMPLIED>
<!ATTLIST xs:pattern id ID #IMPLIED>
<!ATTLIST xs:appinfo id ID #IMPLIED>
<!ATTLIST xs:documentation id ID #IMPLIED>
<!ATTLIST xs:list id ID #IMPLIED>
<!ATTLIST xs:union id ID #IMPLIED>
]>
<xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema" blockDefault="#all" elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="EN" xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>

<xs:element name="schema" id="schema">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="include" type="xs:anyURI"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="targetNamespace" type="xs:anyURI"/>
<xs:attribute name="version" type="xs:normalizedString"/>
<xs:attribute name="id" type="xs:ID"/>
<xs:attribute ref="xml:lang"/>
</xs:complexType>

<xs:key name="element">
<xs:selector xpath="xs:element"/>
<xs:field xpath="@name"/>
</xs:key>

<xs:key name="attribute">
<xs:selector xpath="xs:attribute"/>
<xs:field xpath="@name"/>
</xs:key>

<xs:key name="type">
<xs:selector xpath="xs:complexType|xs:simpleType"/>
<xs:field xpath="@name"/>
</xs:key>

<xs:key name="group">
<xs:selector xpath="xs:group"/>
<xs:field xpath="@name"/>
</xs:key>

<xs:key name="attributeGroup">
<xs:selector xpath="xs:attributeGroup"/>
<xs:field xpath="@name"/>
</xs:key>

<xs:key name="notation">
<xs:selector xpath="xs:notation"/>
<xs:field xpath="@name"/>
</xs:key>

<xs:key name="identityConstraint">
<xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/>
<xs:field xpath="@name"/>
</xs:key>

</xs:element>

</xs:schema>

--------------070100040301020706020400--
Previous Topic:TextNode does not contain the TargetNamespace
Next Topic:Problem validating a reference to xsd:schema
Goto Forum:
  


Current Time: Fri Aug 22 06:04:15 EDT 2014

Powered by FUDForum. Page generated in 0.01770 seconds