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>

Matt,

     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
validation
AT ALL?  Or are you just documenting what is expected, so tools like XMLSpy
3.5
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
with
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
held
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>
cc:
Subject:  assigning schema to appInfo elements



Hello,

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
the
schema that is used by a de/serializer facility to move the XML into and
out
of java objects.

After examining the XML Schema schema, I've learned that the appInfo
element
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
element.

+ specifying appInfo like this:

    <appInfo xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
             xsi:noTargetNamspace="appInfoSchema.xsd">
        <className>org.foo.bar.MyClass</className>
        <mapping method="FirstName" element="firstName" type="boolean"/>
    </appInfo>

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
mapping
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
matt@avolent.com
Received on Thursday, 1 March 2001 22:27:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:20 GMT