Re: assigning schema to appInfo elements


     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 <> on 03/01/2001 08:25:25 PM

Sent by:

To:   "''" <>
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=""
        <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