W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2001

Re: assigning schema to appInfo elements

From: Bob Schloss <rschloss@us.ibm.com>
Date: Thu, 1 Mar 2001 22:26:22 -0500
To: Matt Brown <matt@avolent.com>, "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Message-ID: <OF07FD9DEC.B742B773-ON85256A03.001224C7@pok.ibm.com>


     What do you want to happen if someone adds some appInfo information
in one of your schemas that violates the schema components you specify
that must apply to it?  Do you want a validator to refuse to do any
AT ALL?  Or are you just documenting what is expected, so tools like XMLSpy
will help you enter the <appInfo> content just the way you need?

     There might be a way of specifying your own element,
call it MattAppInfo, and specifying that it is in the substitution group
the appInfo element.  Then your element would have a complex type
which would have the grammar you want.

     I do not think this guarantees that all schema processors would
process this the way you want.  Some might.

     Another approach would be to insert some kind of XLink
element in the content of appInfo which would point to your instructions
in a parallel XML document.  You can then have a schema for
that parallel document.

               Bob Schloss
               IBM Watson Research Center

Matt Brown <matt@avolent.com>@w3.org on 03/01/2001 08:25:25 PM

Sent by:  xmlschema-dev-request@w3.org

To:   "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Subject:  assigning schema to appInfo elements


The project I am currently working on makes use of XML Schema. I am looking
at making significant use of the appInfo element to embed information in
schema that is used by a de/serializer facility to move the XML into and
of java objects.

After examining the XML Schema schema, I've learned that the appInfo
can contain any XML that is necessary. I am wondering if there is anyway to
impose a schema on the contents of the appInfo element.

I have tried various approaches, using both Xerces 1.3 and XMLSpy 3.5 for
validation. I was not able to find any way to do this. My failed approaches
include (please don't laugh):

+ including the XML Schema schema via "include" and extending the appInfo

+ specifying appInfo like this:

    <appInfo xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
        <mapping method="FirstName" element="firstName" type="boolean"/>

Am I on a fools quest, or is my relative inexperience with XML Schema
causing me to overlook the answer?

(More generally, if there is a better approach to associating object
information with a schema than embedding it in appInfo or storing it as a
separate XML document, I would welcome suggestions)

Any help is greatly appreciated.

Matt Brown
Received on Thursday, 1 March 2001 22:27:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:51 UTC