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

Re: XML Schemas: elementFormDefault - to qualify or not?

  • From: Curt Arnold <CurtA@t...>
  • To: xml-dev@l...
  • Date: Sat, 15 Jul 2000 11:33:17 -0500

elementformdefault example
My interpretation is that 2 is the closest to correct.  The only way to
"reach" a local element is in the context of the content model it was
defined, but you can bring its context into another namespace.

I think that the following would be schema valid (allowing for types)
(if
sample has an <any/> content model).

<sample xmlns="http://www.example.org"
xmlns:pub="http://www.publishing.org">
    <!--  non URI would be not schema valid   -->
    <pub:title>http://www.example.org/titles/catch22.xml</pub:title>
</sample>

<exam:sample xmlns:exam="http://www.example.org"
xmlns="http://www.publishing.org">
    <title>http://www.example.org/titles/catch22.xml</title>
</exam:sample>

<exam:sample xmlns:exam="http://www.example.org"
xmlns="http://www.publishing.org">
    <BookCatalog>
        <Book>
            <Title><--  any string content allowed here -->Les
Miserables</Title>
            <Author>Victor Hugo</Author>
            <Date></Date>
            <ISBN></ISBN>
            <Publisher></Publisher>
        </Book>
    </BookCatalog>
<exam:sample>

<sample xmlns="http://www.example.org"
xmlns:pub="http://www.publishing.org">
    <pub:BookCatalog>
        <pub:Book>
            <pub:Title><--  any string content allowed here -->Les
Miserables</exam:Title>
            <pub:Author>Victor Hugo</exam:Author>
            <pub:Date></exam:Date>
            <pub:ISBN></exam:ISBN>
            <pub:Publisher></exam:Publisher>
        </pub:Book>
    </pub:BookCatalog>
<sample>

If elementForm was unqualified, the following would be legal (and the
previous two illegal)

<exam:sample xmlns:exam="http://www.example.org"
xmlns="http://www.publishing.org">
    <pub:BookCatalog  xmlns="" xmlns:pub="http://www.publishing.org">
        <Book>
            <Title><--  any string content allowed here -->Les
Miserables</Title>
            <Author>Victor Hugo</Author>
            <Date></Date>
            <ISBN></ISBN>
            <Publisher></Publisher>
        </Book>
    </pub:BookCatalog>
<exam:sample>

<sample xmlns="http://www.example.org"
xmlns:pub="http://www.publishing.org">
    <pub:BookCatalog>
        <Book>
            <Title><--  any string content allowed here -->Les
Miserables</exam:Title>
            <Author>Victor Hugo</exam:Author>
            <Date></exam:Date>
            <ISBN></exam:ISBN>
            <Publisher></exam:Publisher>
        </Book>
    </pub:BookCatalog>
<sample>

There is no way to use the Book, local Title, Author, Date, ISBN, and
Publisher elements from another schema (except in the context of an
BookCatalog element).

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.