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

RE: assigning schema to appInfo elements

From: Matt Brown <matt@avolent.com>
Date: Thu, 1 Mar 2001 21:42:26 -0800
Message-ID: <DF6475EAFC16D411A05B0008C786680B01908682@homer.justintime.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Cc: "'Bob Schloss'" <rschloss@us.ibm.com>
Bob,

I want to add information to a schema that can be used for both validation
and authoring tool hints. In a sense, I want to define my own annotation
type that can be validated against another schema. In the end, I want to
ensure that when our application looks at the appInfo tag, that we can get
part of it and know that it conforms to a schema we imposed.

Specific applications may want to define specific requirements for the
appInfo tag. If the appInfo tag could be partitioned with each partition
having its own schema definition, applications could augment schema
information with the assurance that the data conforms to a specific
structure.

I admit that my understanding of appInfo might be a bit narrow. Maybe more
of my thoughts on this topic might reveal this narrowness and help me
understand appInfo better. :)

I am contributing to a large scale application that is extremely modular and
configurable. Each server is based off of a tree of XML documents that
define configuration data and java classes that comprise the server.

In previous versions of the application, we used the term "meta information"
to refer to a subset of functionality that is can now provided by XML
Schema. However, because we created this meta information that defined the
structure and semantics of XML documents, we could include whatever we
wanted in the meta information. XML Schema is far superior to our meta info
in many ways. For these reasons, we hope to fully utilize XML Schema.
However, we're having a hard time coming to terms with areas where we cannot
express things like class mappings with XML Schema.

Obviously XML Schema can't be everything to everyone. I had hoped (and it
may still be possible) that XML Schema's appInfo would allow applications to
define schema-based extensions to XML Schema's capabilities.

It may be necessary for us to define the class mapping information in
separate XML documents. We would prefer to inline this with schemas, but
that may be a trade off for stepping up to XML Schema.

Anyways, any suggestions are welcome.

Bob, thanks for your input. I will definitely experiment with your
suggestions. XLink is an interesting possibility, although it seems like
there isn't a lot of application-level support for it yet (i.e. Xerces 1.3,
XML Spy... I think).

Thanks all
matt

-----Original Message-----
From: Bob Schloss [mailto:rschloss@us.ibm.com]
Sent: Thursday, March 01, 2001 7:26 PM
To: Matt Brown; 'xmlschema-dev@w3.org'
Subject: Re: assigning schema to appInfo elements



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.
Received on Friday, 2 March 2001 00:42:29 GMT

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