Re: complex/simple tyeps

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 UTC