Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Defining recursive elements?

From: "Andrew Welch" <andrew.j.welch@-----.--->
To: "noah_mendelsohn@--.---.---" <----_----------@--.---.--->
Date: 5/18/2007 10:36:00 AM
This is all great information - thanks.  It does go against most of
what I've read recently on the pros and cons of the various styles....

>From all the replies I've read, the preferred pattern appears to be
the original "all globals" approach (unfortunately called salami slice
elsewhere), with the adviso that the root element can be application
defined.



On 5/17/07, noah_mendelsohn@u... <noah_mendelsohn@u...> wrote:
> Andrew Welch writes:
>
> > With global definitions some documents will be valid that you might
> > not want, for example an XML document of just <header/> would validate
> > using that schema.
>
> That's a bit of an oversimplification.  The schema recommendation says th=
e
> following about the ways in which a schema may be used to validate an
> instance document [1]:
>
> -------------
> With a schema which satisfies the conditions expressed in Errors in Schem=
a
> Construction and Structure (=A75.1) above, the schema-validity of an elem=
ent
> information item can be assessed. Three primary approaches to this are
> possible:
> 1 The user or application identifies a complex type definition from among
> the {type definitions} of the schema, and appeals to Schema-Validity
> Assessment (Element) (=A73.3.4) (clause 1.2);
> 2 The user or application identifies a element declaration from among the
> {element declarations} of the schema, checks that its {name} and {target
> namespace} match the [local name] and [namespace name] of the item, and
> appeals to Schema-Validity Assessment (Element) (=A73.3.4) (clause 1.1);
> 3 The processor starts from Schema-Validity Assessment (Element) (=A73.3.=
4)
> with no stipulated declaration or definition, and either =B7strict=B7 or =
=B7lax=B7
> assessment ensues, depending on whether or not the element information an=
d
> the schema determine either an element declaration (by name) or a type
> definition (via xsi:type) or not.
> -------------
>
> If you choose to use a processor that implements the third option, then
> your statement is correct.  If you want to ensure that the root element i=
s
> "component", then you should get a processor that implements option #2,
> and designate the declaration for element "component" as the one from
> which validation is to start.
>
> By the way, among the reasons that option 3 is provided, is to facilitate
> the creation of incremental validators.  Let's say you have an editor
> that's helping you enter these documents.  Even though you want the
> document as a whole to be rooted at <part>, it's possible that you are
> editing a "header".  Rule 3 allows such an editor to revalidated just the
> <header> element as it is changed, even though it is not the root of the
> document.
>
> Noah
>
> [1] http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/#validation_outcom=
e
>
> --------------------------------------
> Noah Mendelsohn
> IBM Corporation
> One Rogers Street
> Cambridge, MA 02142
> 1-617-693-4036
> --------------------------------------
>
>
>
>
>

From petexmldev@t... Fri May 18 09:43:16 2007
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org wi


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent