OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]
  • From: Curt Arnold <CurtA@techie.com>
  • To: xml-dev@lists.xml.org
  • Date: Sat, 15 Jul 2000 11:33:17 -0500

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).




 

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

Copyright 2001 XML.org. This site is hosted by OASIS