SV: Automatic XML Schema/DTD generation?

A very quick look at the XML source, the Element interface, gives the
following result: there is no obvious way of generating the schema as far as
exceptions are concerned, since they are given just as text content in a
<p/> node.

/Dimitris


<method name="setAttributeNode" id="ID-887236154">
 <descr>
  <p>Adds a new attribute. If an attribute with that name is already present
in the element, it is replaced by the new one.</p> 
  </descr>
 <parameters>
 <param name="newAttr" type="Attr" attr="in">
 <descr>
  <p>
  The 
  <code>Attr</code> 
  node to add to the attribute list. 
  </p>
  </descr>
  </param>
  </parameters>
 <returns type="Attr">
  <descr>
 <p>
  If the 
  <code>newAttr</code> 
  attribute replaces an existing attribute with the same name, the
previously existing 
  <code>Attr</code> 
  node is returned, otherwise 
  <code>null</code> 
  is returned. 
  </p>
  </descr>
  </returns>
 <raises>
 <exception name="DOMException">
 <descr>
 <p>
  WRONG_DOCUMENT_ERR: Raised if 
  <code>newAttr</code> 
  was created from a different document than the one that created the
element. 
  </p>
  <p>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.</p> 
 <p>
  INUSE_ATTRIBUTE_ERR: Raised if 
  <code>newAttr</code> 
  is already an attribute of another 
  <code>Element</code> 
  object. The DOM user must explicitly clone 
  <code>Attr</code> 
  nodes to re-use them in other elements. 
  </p>
  </descr>
  </exception>
  </raises>
  </method>

-----Ursprungligt meddelande-----
Från: Jeroen van Rotterdam [mailto:jeroen@x-hive.com]
Skickat: den 29 maj 2001 18:34
Till: www-dom-ts@w3.org
Kopia: Dimitris Dimitriadis
Ämne: Re: Automatic XML Schema/DTD generation?


> 3. we can point to the right part of the spec, since the spec generated
the
> test
>
> However, we need to have more granularity in the DOM Specification format,
> which is being looked into.

The generation of  the DTD or Schema for the testsuite is what Freek means
not the test itself.

I believe al the info is already available within the XML source of the DOM
Specs.
Take a look at f.i. the fragment of the LS spec (included below) turning
that into:

<!ELEMENT parseCMURI EMPTY>
<!ATTLIST parseCMURI
 obj CDATA #REQUIRED
 var CDATA #REQUIRED
 uri CDATA #REQUIRED
>

wouldn't be hard I think..

Jeroen



- <method name="parseCMURI" id="ID-LS-DOMBuilder-parseCMURI">
    <parameters>
-    <param name="uri" type="DOMString" attr="in">...</param>
</parameters>
-   <returns type="CMModel">...  </returns>
-   <raises>
     ......
     </raises>
- </method>

Received on Tuesday, 29 May 2001 12:48:39 UTC