W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

Re: Schema for XSLT (concerns mixed content, content attribute)

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 20 Apr 2000 17:18:32 +0100
To: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
Cc: "'xml-dev@xml.org'" <xml-dev@xml.org>, "'dbox@develop.com'" <dbox@develop.com>, "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>, "'xml-dev-temp@egroups.com'" <xml-dev-temp@egroups.com>
Message-ID: <f5bg0sglp9j.fsf@cogsci.ed.ac.uk>
"Arnold, Curt" <Curt.Arnold@hyprotech.com> writes:

> My interpretation of derivedBy='extension' is that any content
> defined in the derived type appears after the content in the base
> type.  (I looked but couldn't see any definition of special behavior
> if the base complexType was mixed) So that your definitions would
> allow template content then <xsl:sort> or <xsl:param> elements.

Correct.

> However, since the only mechanism to get mixed content is through a
> content='mixed' attribute on a <complexType> element and that the
> only mechanism to build a content model off of a complexType is
> restriction or extension, there does not seem to be a mechanism for
> doing what you would really want.

I'd do it by defining template with a disjunction, and then
restricting one or the other branch of the disjunction out of
existence for the derived types.

> That lead me to look at the content attribute of complexType which
> appears to only provide information in a very few places and has
> substantial potential to be inconsistent with other parts of the
> type declaration.  Elimination of the content attribute would seem
> to eliminate some complexity.
> 
> The content attribute can have values of elementOnly, textOnly,
> mixed and empty.

Your discussion below seems to assume that 'content' is an attribute
on <element>, when in fact it belongs on <attribute>.

> textOnly can usually be implied by the type attribute referencing a
> simple type or a <simpleType> child element.  The equivalent of
> content='textOnly' would be nothing more would be type='string'.
> There doesn't seem to be a case where content='textOnly' adds value.

There's one corner case:

  <xs:element name='foo'>
    <xs:complexType content='textOnly'/>
  </xs:element>

is weaker than base='string' (or type='string' on the xs:element), in
that it can be restricted by a complex type with _any_ simple type as
its base

> elementOnly can be implied by a type attribute referencing a
> complexType or a <complexType> child element.

How can we distinguish mixed from element only in that case?

> If we had the <mixed> group tag, then mixed content is just a
> particular flavor of complex type.

If we had such a group tag, it would re-introduce the pernicious mixed
content bug from SGML.

> That leaves empty.  Either an <empty/> element like in previous
> drafts or better yet defining an "empty" complex type in the schema
> for schema that is the default base type if no type is defined and
> would be the default base type for complexType elements.

I think we're open to re-designs in this area, but this one isn't
quite there yet.

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, 20 April 2000 12:19:03 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:52 UTC