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

Re: need help writing an XML schema - where to turn?

From: Martin Gudgin <marting@develop.com>
Date: Wed, 29 Nov 2000 00:18:19 -0800
Message-ID: <00dc01c059dc$f7957be0$5cf36f3f@greyarea>
To: "Donald Ball" <balld@webslingerZ.com>, <www-xml-schema-comments@w3.org>
Hi Donald,

I do a bit of work with Cocoon... I'd be happy to help... I've not got an
instance document to go on but how does this look?

<schema xmlns='http://www.w3.org/2000/10/XMLSchema'

  <!-- some elements in the esql namespace ( I made these up :-) ) -->
  <element name='a' />
  <element name='b' />
  <element name='c' />

  <complexType name='row-results'>
    <complexContent mixed='true' > <!-- Allow text to appear between
elements -->
      <choice minOccurs='0' maxOccurs='unbounded' > <!-- The stuff inside
here can appear as many times as you like -->
        <any namespace='##other' /> <!-- Allow elements from other
namespaces -->
        <element ref='tns:a' /> <!-- Allow the a,b and c elements from the
esql namespace -->
        <element ref='tns:b' />
        <element ref='tns:c' />
      <anyAttribute namespace='##any' /> <!-- Allow attributes from any
namespace -->
  <element name='row-results' type='tns:row-result' />


This would allow the following instance ( and others of course... );

<esql:row-results xmlns:esql='namespace-uri-for-esql'

  <x1:elem_x>blah blah blah</x1:elem_x>
  <x1:elem_x>blah blah blah</x1:elem_x>
  Some text
  <x1:elem_x>blah blah blah</x1:elem_x>
  Some more text

Is this the kind of thing you were after?

Martin Gudgin

----- Original Message -----
From: "Donald Ball" <balld@webslingerZ.com>
To: <www-xml-schema-comments@w3.org>
Sent: Sunday, November 26, 2000 7:15 PM
Subject: need help writing an XML schema - where to turn?

> hi guys. i'm trying to write some xml schemas for portions of the apache
> cocoon project and i'm having some trouble figuring out how to write some
> of it. i tried searching around for an xml schema user's list, but to no
> avail so far. can someone direct me towards an appropriate forum?
> if this _is_ in fact an appropriate forum, my biggest problem is this: i
> have an element, esql:row-results, which can contain text, arbitrary
> elements and attributes from other namespaces, and a specific set of
> elements in the esql namespace, in arbitrary order. the elements in the
> esql namespace may appear any number of times. i can't see any way to
> describe this in xml schema. any suggestions?
> - donald
Received on Wednesday, 29 November 2000 03:20:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:49 UTC