W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2000

Namespace qualified attributes?

From: Norman Walsh <ndw@nwalsh.com>
Date: 11 Oct 2000 15:15:49 -0400
To: xmlschema-dev@w3.org
Message-ID: <87bswrdw9m.fsf@nwalsh.com>
User error again, I assume?

Given this document:

<?xml version="1.0" encoding="iso-8859-1"?>
<publoc xmlns='http://www.w3.org/2000/xmlspec'
        xmlns:xlink="http://www.w3.org/1999/xlink">
<loc xlink:type="simple" href="somehref">text</loc>
</publoc>

and this schema:

<!DOCTYPE schema SYSTEM "/share/doctypes/xmlschema/XMLSchema.dtd" [
<!ENTITY % schemaAttrs "
	xmlns:xsd	CDATA	#IMPLIED
	xmlns:spec	CDATA	#IMPLIED
	xmlns:xlink	CDATA	#IMPLIED
">
]>
<schema xmlns='http://www.w3.org/2000/10/XMLSchema'
        targetNamespace='http://www.w3.org/2000/xmlspec'
        xmlns:xsd='http://www.w3.org/2000/10/XMLSchema'
        xmlns:spec='http://www.w3.org/2000/xmlspec'
        xmlns:xlink='http://www.w3.org/1999/xlink'
        elementFormDefault='qualified'>

<attributeGroup name='common.att'>
  <attribute name='id' type='ID'/>
  <attribute name='role' type='NMTOKEN'/>
</attributeGroup>

<complexType name='publoc' mixed='true'>
  <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='spec:loc'/>
  </choice>
  <attributeGroup ref='spec:common.att'/>
</complexType>

<complexType name='loc' mixed='true'>
  <simpleContent>
    <extension base="string">
      <attributeGroup ref='spec:common.att'/>
      <attribute name='xlink:show' use='fixed' value='replace'/>
      <attribute name='xlink:type' use='fixed' value='simple'/>
      <attribute name='xlink:actuate' use='fixed' value='onRequest'/>
      <attribute name='href' use='required' type='string'/>
    </extension>
  </simpleContent>
</complexType>

<element name='publoc' type='spec:publoc'/>
<element name='loc' type='spec:loc'/>

</schema>

XSV complains:

file:///share/projects/w3c/spec-prod/schema/test.xml:4:1:undeclared
attribute {http://www.w3.org/1999/xlink}:type

But it looks to me like I've declared it. And I can use the 'href' and
'id' attributes so it looks like xsv sees the complex type definition
and doesn't object to it.

What'd I do wrong this time? :-)

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | There is a great difference between
http://nwalsh.com/            | seeking how to raise a laugh from
                              | everything, and seeking in everything
                              | what may justly be laughed at.--Lord
                              | Shaftesbury
Received on Wednesday, 11 October 2000 15:18:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:47 UTC