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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: parser for xml-data?

[ Lists Home | Date Index | Thread Index ]
  • From: Charles Frankston <cfranks@microsoft.com>
  • To: xml-dev@ic.ac.uk
  • Date: Tue, 19 May 1998 11:19:10 -0700

> -----Original Message-----
> From: rbourret@dvs1.informatik.tu-darmstadt.de
> [mailto:rbourret@dvs1.informatik.tu-darmstadt.de]
> Sent: Tuesday, May 19, 1998 1:34 AM
> To: xml-dev@ic.ac.uk; Charles Frankston
> Subject: RE: parser for xml-data?
> 1) How do you use multiple namespaces in a valid document?  
> That is, if you have 
> two separate DTDs (schemas), neither of which references 
> elements in the other, 
> how do you build a single valid document with both of them?  
> Elements from the 
> first DTD can't nest inside elements from the second DTD 
> (because they aren't in 
> the second DTD's grammar) and vice versa.  The example in 
> section 3.1 of the 
> namespaces spec is well-formed, but the spec doesn't explain 
> how it can be 
> valid.  Presumably, it doesn't match any of the DTDs 
> presented as namespaces.

DTDs are not well-equipped to handle namespaces.  It can technically be
done: for example, you could allow your outer DTD to have 'ANY' content.

XML-Data schemas are designed to integrate with namespaces:

<!-- Schema for xyz namespace -->
<elementType id="a">
  <string/>
</elementType>

<!-- Schema for zyx namespace (in a separate file) -->
<?xml:namespace ns="xyz" prefix="x"?>
<elementType id="b">
   <element type="x:a">
</elementType>

<!-- Instance file -->
<?xml:namespace ns="zyx" prefix="z"?>
<?xml:namespace ns="xyz" prefix="x"?>
<z:b>
  <x:a/>
</z:b>


> 
> 2) The src attribute in your namespace declaration does not 
> point to a DTD; it 
> points to an XML-Data file.  While the namespace spec does 
> not prohibit this, I 
> had simply assumed that the schema would be a DTD.  It would 
> be nice if the 
> namespace spec clarified that it does not impose any rules on 
> the format of a 
> namespace schema.  This is important for validating parsers, 
> as it means that 
> namespace declarations are dependent on the parser's ability 
> to read the  
> particular schema format that is used.  (And if a parser can 
> read multiple 
> schema formats, how does it know which one to use?)
> 

Most of the XML-Data spec describes the rules of the XML-Data schema file.
The schema happens to use XML instance syntax, rather than the separate
grammar approach of DTDs.  We think this is a big advantage -- you can use
all the tools you have for editing XML instance data to edit XML-Data
schemas.


> 3) Why is production [1] in the namespace spec:
> 
>   [1] NamespacePI ::= '<?xml:namespace' (S (PrefixDef | NSDef 
> | SrcDef))+ '?>'
> 
> instead of:
> 
>   [1] NamespacePI ::= '<?xml:namespace' S PrefixDef S NSDef 
> (S SrcDef)? '?>'
> 
> Is the ambiguity of the production, which needs to be 
> qualified with the  
> Required Parts constraint, worth the flexibility in the order 
> of PrefixDef, 
> NSDef, and SrcDef?  My opinion is no.

The ns, prefix, and src parameters to a namespace PI look a lot like
attributes (although they are not in a formal sense).  Since attributes in
XML do not have to be in a particular order, it would certainly be
surprising for people to discover that attributes in a namespace have to be
a particular order.  You're suggesting that the syntax be made harder to use
in order to make the productions easier to author.  I think this is a bad
tradeoff.

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)





 

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

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