[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

NVDL Question: validate one part of a compound document, independent of

  • From: "Costello, Roger L." <costello@m...>
  • To: <xml-dev@l...>
  • Date: Fri, 18 Apr 2008 08:31:30 -0400

NVDL Question: validate one part of a compound document
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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.