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

anonymous element

From: Kassahun, Ayalew <Ayalew.Kassahun@wur.nl>
Date: Fri, 1 Dec 2006 10:19:20 +0100
Message-ID: <9C00C2F0ECEC594580FCF26CA09DFF521B9856@scomp0040.wurnet.nl>
To: <xmlschema-dev@w3.org>
anonymous element
Hi;

 

How can I define anonymous elements (elements without names) in XML
schema?

 

What I would like to achieve is a schema in which the following
statements are true:

1.       An XML document based on the schema can contain any XML
element.

2.       All XML elements should have "id" and "name" attributes. 

 

In short something like this:

 

<xsd:schema targetNamespace="http://www.bla"
xmlns:xsd=http://www.w3.org/2001/XMLSchema>

    <!-- anonymous element  -->

    <xsd:complexType name="Anonymous.Type">

        <xsd:attribute name="id" type="xsd:string"/>

        <xsd:attribute name="name" type="xsd:string"/>

    </xsd:complexType>

 

     <xsd:element name="*" type=" Anonymous.Type"/>

</xsd:schema>

 

Assuming "*" indicates an "anonymous element", but such a thing doesn't
exist in Schema definition.

 

How do I achieve this?

 

Regards;

Ayalew

 
Received on Saturday, 2 December 2006 01:45:16 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.