Hi Jeff,

I'm not sure about your first problem, but I've a pretty good idea what's
going on with your second.  You've ref'd in a globally-declared
attribute--an attribute with a namespace!  Now dhe default namespace
doesn't carry ovre to attribute in xml documents, so you'd need to do
something like:

<foo:root = "your schema vars etc."
     xmlns:foo="http://example.com";>
     foo:foo="test"/>

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



[EMAIL PROTECTED] on 08/17/2001 12:40:33 AM

Please respond to [EMAIL PROTECTED]

To:   <[EMAIL PROTECTED]>
cc:
Subject:  Attribute References and Groups


I have been using Xerces like mad lately and it is great!-- I ran across
what appear to be a couple of bugs-- hopefully someone can confirm:

(1) Indirect Circular attributeGroup reference

att.XML
======
<?xml version="1.0"?>
<root xmlns="http://www.example.com";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation="http://www.example.com att.xsd"/>

att.XSD
======
<?xml version="1.0"?>
<schema
  xmlns="http://www.w3.org/2001/XMLSchema";
  xmlns:target="http://www.example.com";
  targetNamespace="http://www.example.com";
  elementFormDefault="qualified">
  <!-- Indirect circular reference -->
  <attributeGroup name="AttGroup1">
    <attributeGroup ref="target:AttGroup2"/>
  </attributeGroup>
  <attributeGroup name="AttGroup2">
    <attributeGroup ref="target:AttGroup1"/>
  </attributeGroup>

  <element name="root">
    <complexType>
      <attributeGroup ref="target:AttGroup1"/>
    </complexType>
  </element>
</schema>

===
The src for attributeGroup representation point 3 does not disallow
indirect
resolution per se-- but it should be implied. It looks as though the parser
is trying to use the declaration when it should raise an error. It
correctly
raises an error when the attributeGroup refers to itself. [1]

(2) Attribute Ref doesn't work?

att2.XML
=======

<?xml version="1.0"?>
<root xmlns="http://www.example.com";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation="http://www.example.com att.xsd"
      foo="test"/>

att2.XSD
=======
<?xml version="1.0"?>
<schema
  xmlns="http://www.w3.org/2001/XMLSchema";
  xmlns:target="http://www.example.com";
  targetNamespace="http://www.example.com";
  elementFormDefault="qualified">
  <!-- Indirect circular reference -->
  <attribute name="foo" type="string"/>
  <element name="root">
    <complexType>
      <attribute ref="target:foo"/>
    </complexType>
  </element>
</schema>

Error
====
[Error] Attribute "foo" must be declared for element type "root". line 5
column 19 - att2.xml

Foo is declared-- it uses the ref model to utilize the global declaration.

[1]
http://www.w3.org/TR/xmlschema-1/#section-Constraints-on-XML-Representations

-of-Attribute-Group-Definitions

These aren't causing huge problems for me right now, but they may affect
someone down the road...

Thanks again!
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting



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





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

Reply via email to