Re: xsi:type for multiref targets.

See Scott Cantor's answer.  xsd:integer is what schemas calls a "simple" 
type.  When used on an element, it allows no attributes, except for 
xsi:type itself, xsi:nil, maybe xsi:schemaLocation (I can't remember and 
don't have the spec here).  So, ID= is not valid on an element of any 
simple type.  You need something like:

 <xsd:complexType name="integerWithID">
   <xsd:simpleContent>
     <xsd:extension base="xsd:integer"> 
       <xsd:attribute name="ID" type="xsd:id" />
     </xsd:extension>
   </xsd:simpleContent>
 </xsd:complexType>

Again, I'm doing this from memory, so I may have some details in the above 
schema wrong.  You could also make the ID attribute optional.  It's an 
extension because it allows elements not allowed by integer itself (I.e. 
it allows the attribute too.)  Anything with attributes is by definition a 
complex type.  Integer is a simple type.

------------------------------------------------------------------
Noah Mendelsohn                              Voice: 1-617-693-4036
IBM Corporation                                Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142
------------------------------------------------------------------







Rich Salz <rsalz@zolera.com>
03/01/2002 03:16 AM

 
        To:     noah_mendelsohn@us.ibm.com
        cc:     xml-dist-app@w3.org
        Subject:        Re: xsi:type for multiref targets.


>       <target id="x" xsi:type="xsd:integer">25</target>
> Well, that doesn't work!  The element named target is not of type 
integer,
> because it has an attribute (id=").

I must be dense.  Why?  Please use little words.
-- 
Zolera Systems, Securing web services (XML, SOAP, Signatures,
Encryption)
http://www.zolera.com

Received on Saturday, 2 March 2002 14:27:42 UTC