Re: [Moderator Action] Defining an attribute in the different namespace

"Milan Trninic" <mtrninic@galdosinc.com> writes:

> I am trying to define an attribute in the namespace different than the target
> one for the schema. So it would look like:
> 
>  
> 
> <attribute name="newns:attrName" type="string"/>
> 
>  
> 
> I do not want to reference it <attribute ref="newns:attrName"/> since it is
> not defined there.
> 
> The xsv parser doesn't recognize the "newns:" as the namespace prefix, but as
> the part of the name.

You can't define qualified names directly -- you must define a schema
for the namespace in question, and import the definition from there:

<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
targetNamespace="http://www.example.com/News">
 <attribute name="attrName" type="string"/>
</schema>

<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
targetNamespace="http://www.example.com/Other"
   xmlns:newns="http://www.example.com/News"
   xmlns:my="http://www.example.com/Other">
 <import namespace="http://www.example.com/News"/>
 <complexType name="foo">
  . . .
  <attribute ref="newns:attrName"/>
</schema>

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-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/

Received on Thursday, 28 September 2000 04:15:12 UTC