[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

  • From: ht@c... (Henry S. Thompson)
  • To: "Arnold, Curt" <Curt.Arnold@h...>
  • Date: 20 Apr 2000 17:18:32 +0100

xslt mixed content
"Arnold, Curt" <Curt.Arnold@h...> 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.


> 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'/>

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.

  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@c...
		     URL: http://www.ltg.ed.ac.uk/~ht/

This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.