<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.8.1">
</HEAD>
<BODY>
HI George,<BR>
<BR>
Thanx for the info. I'll check deeply the specifications.<BR>
<BR>
<BR>
On Thu, 2005-12-01 at 15:05 +0200, George Cristian Bina wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Dear Helder,</FONT>
<FONT COLOR="#000000">I think this is an error in the spec. If you read a few lines above that </FONT>
<FONT COLOR="#000000">you will see that if no namespace attribute is specified then the </FONT>
<FONT COLOR="#000000">imported schema is for no namespace components:</FONT>
<FONT COLOR="#000000">***</FONT>
<FONT COLOR="#000000">If that attribute is absent, then the import allows unqualified </FONT>
<FONT COLOR="#000000">reference to components with no target namespace.</FONT>
<FONT COLOR="#000000">***</FONT>
<FONT COLOR="#000000">So clearly there should not be a targetNamespace attribute present in </FONT>
<FONT COLOR="#000000">that schema, because having such an attribute will place the components </FONT>
<FONT COLOR="#000000">defined in that schema in that namespace.</FONT>
<FONT COLOR="#000000">Oxygen uses Xerces-J 2.7.1 for XML Schema validation. If you test also </FONT>
<FONT COLOR="#000000">with other schema processors you will see that they report this error, I </FONT>
<FONT COLOR="#000000">tried Schema Quality Checker, MSXML.NET and MSXML 4.0, Saxon SA and XSV </FONT>
<FONT COLOR="#000000">and they all complain about this.</FONT>
<FONT COLOR="#000000">Best Regards,</FONT>
<FONT COLOR="#000000">George</FONT>
<FONT COLOR="#000000">---------------------------------------------------------------------</FONT>
<FONT COLOR="#000000">George Cristian Bina</FONT>
<FONT COLOR="#000000"><oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger</FONT>
<FONT COLOR="#000000"><A HREF="http://www.oxygenxml.com">http://www.oxygenxml.com</A></FONT>
<FONT COLOR="#000000">Helder Rossa wrote:</FONT>
<FONT COLOR="#000000">> Hi,</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> I Will investigate the second error like you say. but in XML Spy no </FONT>
<FONT COLOR="#000000">> error is reported.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> The first one I think is an error because the targetNamespace in the </FONT>
<FONT COLOR="#000000">> imported file, and like the error says, has a targetNamespace </FONT>
<FONT COLOR="#000000">> 'uri:namespace' so no 'namespace' attribute needs to be included in the </FONT>
<FONT COLOR="#000000">> import directive.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Here is the RIGHT specification in the W3C:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> 1 The appropriate *case* among the following must be true: </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> 1.1 *If *the namespace [attribute]</FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xml-infoset/#infoitem.element">http://www.w3.org/TR/xml-infoset/#infoitem.element</A>> is present,</FONT>
<FONT COLOR="#000000">> *then *its · <<A HREF="http://www.w3.org/TR/xmlschema-1/#key-vv">http://www.w3.org/TR/xmlschema-1/#key-vv</A>>actual value</FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xmlschema-1/#key-vv">http://www.w3.org/TR/xmlschema-1/#key-vv</A>>·</FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xmlschema-1/#key-vv">http://www.w3.org/TR/xmlschema-1/#key-vv</A>> must not match the ·</FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xmlschema-1/#key-vv">http://www.w3.org/TR/xmlschema-1/#key-vv</A>>actual value</FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xmlschema-1/#key-vv">http://www.w3.org/TR/xmlschema-1/#key-vv</A>>·</FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xmlschema-1/#key-vv">http://www.w3.org/TR/xmlschema-1/#key-vv</A>> of the enclosing <schema></FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xmlschema-1/#element-schema">http://www.w3.org/TR/xmlschema-1/#element-schema</A>>'s targetNamespace</FONT>
<FONT COLOR="#000000">> [attribute] <<A HREF="http://www.w3.org/TR/xml-infoset/#infoitem.element">http://www.w3.org/TR/xml-infoset/#infoitem.element</A>>. </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> 1.2 *If *the namespace [attribute]</FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xml-infoset/#infoitem.element">http://www.w3.org/TR/xml-infoset/#infoitem.element</A>> is not present,</FONT>
<FONT COLOR="#000000">> *then *the enclosing <schema></FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xmlschema-1/#element-schema">http://www.w3.org/TR/xmlschema-1/#element-schema</A>> must have a</FONT>
<FONT COLOR="#000000">> targetNamespace [attribute]</FONT>
<FONT COLOR="#000000">> <<A HREF="http://www.w3.org/TR/xml-infoset/#infoitem.element">http://www.w3.org/TR/xml-infoset/#infoitem.element</A>> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> So, the namespace is NOT present in the <import> and I HAVE a </FONT>
<FONT COLOR="#000000">> targetNamespace in the <import>ed schema.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> On Wed, 2005-11-30 at 23:11 +0200, George Cristian Bina wrote:</FONT>
<FONT COLOR="#000000">>> Dear Helder Rossa,</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> One of the nice features that you can find in oXygen is that it reports </FONT>
<FONT COLOR="#000000">>> XML Schema errors in most cases not only with a descriptive message but </FONT>
<FONT COLOR="#000000">>> also with a pointer to the XML Schema specification, pointing to the </FONT>
<FONT COLOR="#000000">>> exact location related with that error.</FONT>
<FONT COLOR="#000000">>> In your case it poins you to</FONT>
<FONT COLOR="#000000">>> <A HREF="http://www.w3.org/TR/xmlschema-1/#src-import">http://www.w3.org/TR/xmlschema-1/#src-import</A></FONT>
<FONT COLOR="#000000">>> The error code is src-import.3.2 which related with the pint 3.2 from </FONT>
<FONT COLOR="#000000">>> the above URL:</FONT>
<FONT COLOR="#000000">>> ***</FONT>
<FONT COLOR="#000000">>> 3 The appropriate case among the following must be true:</FONT>
<FONT COLOR="#000000">>> 3.1 If there is a namespace [attribute], then its ·actual value· must be </FONT>
<FONT COLOR="#000000">>> identical to the ·actual value· of the targetNamespace [attribute] of SII.</FONT>
<FONT COLOR="#000000">>> 3.2 If there is no namespace [attribute], then SII must have no </FONT>
<FONT COLOR="#000000">>> targetNamespace [attribute]</FONT>
<FONT COLOR="#000000">>> ***</FONT>
<FONT COLOR="#000000">>> So as you can see, if no namespace attribute is specified then the </FONT>
<FONT COLOR="#000000">>> imported schema must have no targetNamespace and this is not true in </FONT>
<FONT COLOR="#000000">>> your case.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Your email does not describes the exact details of the second error but </FONT>
<FONT COLOR="#000000">>> I think that you want to say that oXygen does not allow the use </FONT>
<FONT COLOR="#000000">>> attribute in a global attribute declaration but allows this in an </FONT>
<FONT COLOR="#000000">>> attribute inside a complex type for instance. The oXygen behavior is </FONT>
<FONT COLOR="#000000">>> correct and the explanation is that in one case we have an attribute </FONT>
<FONT COLOR="#000000">>> declaration that can be used differently from different places and in </FONT>
<FONT COLOR="#000000">>> the other case an attribute use. The error code s4s-att-not-allowed </FONT>
<FONT COLOR="#000000">>> means that this is not allowed by the schema for schemas (s4s). And if </FONT>
<FONT COLOR="#000000">>> you look into the schema for schemas you can see that the attribute </FONT>
<FONT COLOR="#000000">>> element is of type topLevelAttribute that restricts the attribute type </FONT>
<FONT COLOR="#000000">>> making the use of the "use" attribute prohibited.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> <xs:element id="attribute" name="attribute" </FONT>
<FONT COLOR="#000000">>> type="xs:topLevelAttribute"></FONT>
<FONT COLOR="#000000">>> </xs:element></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> <xs:complexType name="topLevelAttribute"></FONT>
<FONT COLOR="#000000">>> <xs:complexContent></FONT>
<FONT COLOR="#000000">>> <xs:restriction base="xs:attribute"></FONT>
<FONT COLOR="#000000">>> <xs:sequence></FONT>
<FONT COLOR="#000000">>> <xs:element minOccurs="0" ref="xs:annotation"/></FONT>
<FONT COLOR="#000000">>> <xs:element minOccurs="0" name="simpleType" </FONT>
<FONT COLOR="#000000">>> type="xs:localSimpleType"></FONT>
<FONT COLOR="#000000">>> </xs:element></FONT>
<FONT COLOR="#000000">>> </xs:sequence></FONT>
<FONT COLOR="#000000">>> <xs:attribute name="ref" use="prohibited"/></FONT>
<FONT COLOR="#000000">>> <xs:attribute name="form" use="prohibited"/></FONT>
<FONT COLOR="#000000">>> <xs:attribute name="use" use="prohibited"/></FONT>
<FONT COLOR="#000000">>> ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> <xs:attribute name="name" type="xs:NCName" use="required"></FONT>
<FONT COLOR="#000000">>> </xs:attribute></FONT>
<FONT COLOR="#000000">>> <xs:anyAttribute namespace="##other" </FONT>
<FONT COLOR="#000000">>> processContents="lax"/></FONT>
<FONT COLOR="#000000">>> </xs:restriction></FONT>
<FONT COLOR="#000000">>> </xs:complexContent></FONT>
<FONT COLOR="#000000">>> </xs:complexType></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Hope things are clear now.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Best Regards,</FONT>
<FONT COLOR="#000000">>> George</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Helder Rossa wrote:</FONT>
<FONT COLOR="#000000">>> > Hi,</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > I’ve got several errors validating a correct xsd file in oXygen Eclipse </FONT>
<FONT COLOR="#000000">>> > Plug-In.</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > *Importing a XSD File*</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > Error:</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > src-import.3.2: An <import> element information item that had no </FONT>
<FONT COLOR="#000000">>> > namespace attribute was found, so the imported document cannot have a </FONT>
<FONT COLOR="#000000">>> > targetNamespace attribute. However, the targetNamespace 'uri:namespace' </FONT>
<FONT COLOR="#000000">>> > was found in the imported document.</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > @see: <A HREF="http://www.w3.org/TR/xmlschema-1/#src-import">http://www.w3.org/TR/xmlschema-1/#src-import</A></FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > Occurs when:</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > <xs:import schemaLocation="anotherfile.xsd" /></FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > Only works when:</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > <xs:import namespace=”uri:namespace” schemaLocation="anotherfile.xsd" /></FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > This is incorrect!!</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > *Use Attribute in a Element*</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > Error:</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > s4s-att-not-allowed: Attribute 'use' cannot appear in element 'attribute'.</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > Occurs when:</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > <xs:attribute name="type" type="xs:string" use="required" /></FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > Only Works when:</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > <xs:attribute name="type" type="xs:string" use="required" /></FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > This is incorrect because use attribute is OK.</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > What I have to configure for oXygen work corrrectly?!</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > Thanx</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > ------------------------------------------------------------------------</FONT>
<FONT COLOR="#000000">>> > </FONT>
<FONT COLOR="#000000">>> > _______________________________________________</FONT>
<FONT COLOR="#000000">>> > oXygen-user mailing list</FONT>
<FONT COLOR="#000000">>> > <A HREF="mailto:oXygen-user@oxygenxml.com">oXygen-user@oxygenxml.com</A> <mailto:<A HREF="mailto:oXygen-user@oxygenxml.com">oXygen-user@oxygenxml.com</A>></FONT>
<FONT COLOR="#000000">>> > <A HREF="http://www.oxygenxml.com/mailman/listinfo/oxygen-user">http://www.oxygenxml.com/mailman/listinfo/oxygen-user</A></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>