XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
NVDL Question: validate one part of a compound document, independent of other parts?

Hi Folks,

Suppose that I have an XML Schema that declares a Book element:

    <element name="Book">
        <complexType>
            <sequence>
                <element name="Title" type="string"/>
                <element name="Author" type="string"/>
                <element name="Date" type="string"/>
                <element name="ISBN" type="gYear"/>
                <element name="Publisher" type="string"/>
            </sequence>
        </complexType>
    </element>

Here's a sample instance document:

    <Book>
        <Title>The Wisdom of Crowds</Title>
        <Author>James Surowiecki</Author>
        <Date>2005</Date>
        <ISBN>0-385-72170-6</ISBN>
        <Publisher>Anchor Books</Publisher>
    </Book>

I can successfully validate the instance document against the schema.

Note that the schema does not permit any elements within <Book> other
than those listed.

Now suppose I want to inject into the instance document a chunk of
markup:

    <Book>
        <Title>The Wisdom of Crowds</Title>
        <Author>James Surowiecki</Author>
        <other:NewYorkTimes>
            <other:role>Staff writer</other:role>
            <other:column>The Financial Page</other:column>
        </other:NewYorkTimes>
        <Date>2005</Date>
        <ISBN>0-385-72170-6</ISBN>
        <Publisher>Anchor Books</Publisher>
    </Book>

Suppose this new chunk of markup conforms to another schema (NYT.xsd)

This instance document is called a compound document, right?

The Book schema was not designed to support the addition of this new
chunk of markup.  So, if I were to validate the instance against the
Book schema, it would fail.

NVDL to the rescue! (I think)

I "think" that NVDL enables me to express this: "Please validate the
new chunk of markup against NYT.xsd, and then validate the rest of the
instance document (excluding the new chunk) against the Book schema."

Is this true?  Does NVDL allow the validation of the Book markup, as
though the other markup wasn't even there?

/Roger


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS