Re: XLink attributes in a Schema

"Axel Billen" <axel.billen@web.de> writes:

> Hi!
>
> I am working on a projekt and i have to integrate XLink attributes in several Schema. I imported the xlink namespace and used the following tag: 
>
> <xs:anyAttribute namespace="http://www.w3.org/1999/xlink"/>  
>
> That worked fine. But sometimes i wanted to use only one attribute, like xlink:href. In this case i tried to use
>
> <xs:attribute ref="xlink:href" use="required" />.
>
> If i used this tag, my validator would throw an error, because of
> the namespace prefix. Why didnīt this tag work? Can you help me?

You need to include an ordinary namespace declaration for the xlink
prefix, e.g.

  <xs:attribute ref="xlink:href" use="required"
                 xmlns:xlink="http://www.w3.org/1999/xlink"/>

You probably want to put it higher up in your schema document.

You probably also want to specify a location where a schema document
with a declaration for that attribute can be found -- you can either
produce a tiny trivial one of your own, or use one of several that
have been produced and can be found on the web, e.g.

  http://www.cs.vassar.edu/XCES/schema/xcesLink.xsd
  http://examples.oreilly.com/xmlschema/examples/xlink.xsd

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]

Received on Thursday, 4 December 2003 04:05:21 UTC