[
Lists Home |
Date Index |
Thread Index
]
- From: David Megginson <david@megginson.com>
- To: "'XML Developers' List'" <xml-dev@ic.ac.uk>
- Date: Mon, 10 Aug 1998 10:20:22 -0400
Sam Gentile writes:
> Thanks for your answers. I'm still a little confused.
>
> > > We have a spec called "XML-Data W3C Note 05 Jan 1998", which
> > > discusses schemas. It is not clear from the document what a
> > > schema is used for or what it's purpose is. Is it for designing
> > > the XML buffer only or is it read by the parser? Is it an
> > > extension to XML? Are they even necessary in basic XML?
>
> >>>XML-Data is a note that was submitted to the W3C by Microsoft and a
> >>>couple of partners -- it has no official status (a W3C "Note" means
> >>>roughly "here's a neat idea from one of our members").
>
> Ok, that's clear.
>
> >>XML 1.0 DTDs and proposed replacements/enhancements such as
> >>Microsoft's XML-Data and XML-Dev's XSchema perform three distinct
> >>roles:
>
> >>1. Provide a schema for validating the *logical structure*
> >> (element/attribute/data) structure of an XML document; as a side
> >> effect, structural schemas can also provide enough information to
> >> control a guided XML authoring tool.
>
> How is this different from what DTDs do? Don't DTDs validate the *logical
> structure* of an XML document?
Yes -- as I mentioned above, these are roles that both DTDs and their
proposed replacements can play. XML-Data proposes some additional
types of validation, including validation for data content (is it an
integer? etc.).
> >>2. Declare the entities (internal strings or external objects) that
> >> make up the *physical structure* of an XML document.
>
> Don't DTDs do this?
Yes (see above).
> 3. Provide default logical content for an XML document (such as
> default values for attributes, though XML-Data goes further).
>
> Some people have argued -- quite convincingly, I think -- that these
> roles should be kept separate: they are mixed together right now for
> historical compatibility with ISO 8879:1986 DTDs.
> >>>
>
> How about the question of namespaces? Is this legal XML?
> <1>
> <1>data</1>
> <2>data</2>
> </1>
>
> or do you need namespaces?
Actually, this is never valid XML 1.0 (with or without namespaces)
because XML names are not allowed to begin with numbers, so let me
recast your example:
<a>
<a>data</a>
<b>data</b>
</a>
Yes, this is good, simple, well-formed XML 1.0: elements are allowed
to recurse. If you were using a DTD, you might make the following
declarations:
<!ELEMENT a (#PCDATA|a|b)*>
<!ELEMENT b (#PCDATA)>
All the best,
David
--
David Megginson david@megginson.com
http://www.megginson.com/
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)
|