W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2002

Re: complex/simple tyeps

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 04 Nov 2002 09:54:24 +0000
To: Max Jacob <Max.Jacob@ircam.fr> (by way of "C. M. Sperberg-McQueen" <cmsmcq@acm.org>)
Cc: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
Message-ID: <f5bznspvewf.fsf@erasmus.inf.ed.ac.uk>

Max Jacob <Max.Jacob@ircam.fr> (by way of "C. M. Sperberg-McQueen" <cmsmcq@acm.org>) writes:

> When I have a type or element declaration I'm still not able to build
> an xpath to the base type declaration, because I don't know if it's a
> complex or a simple type.

Supposing (a _big_ supposition, see below), your schema is described
by a single schema document, then why doesn't the following sketch
work:

     xsd:complexContent/*[self::xsd:restriction or
                           self::xsd:extension]/xsd:complexType | 
     /xsd:schema/xsd:complexType[@name=current-node()/xsd:complexContent/*[self::xsd:restriction or
                           self::xsd:extension]/@base] |
     xsd:simpleContent/*[self::xsd:restriction or
                           self::xsd:extension]/xsd:simpleType | 
     /xsd:schema/*[@name=current-node()/xsd:simpleContent/*[self::xsd:restriction or
                           self::xsd:extension]/@base and
                             (self::xsd:complexType or self::xsd:simpleType)]
     

It has to be said that navigating schema _documents_ when what you
really want is to navigate schema _components_ is a pain.  The XML
Schema WG is working on a story about Schema Component Designators, to
address this problem.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, 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/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Monday, 4 November 2002 04:54:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:01 GMT