Re: An alternative syntax for aux-list

[email protected] Wed, 7 Jan 2004 21:31:22 -0800 (PST)
Newsgroups gmane.lisp.scheme.ssax-sxml
Message-ID <[email protected]>
Hello!

>   2. SXML Specification version 2.5 allows aux-lists for SXML attributes:
> [4]  <attribute> ::=  ( <name> "value"? <aux-list>? )
> How this feature will be modelled under the new proposal?

It seems

> [4']  <attribute> ::=  ( <name> "value"? <aux-sublist>? )

should be a consistent extension. For example:
  (a (@ 
       (href "http://somewhere/" 
         (@ (*parent* a-node)) ; <aux-sublist> of the attribute href
       )
       (@ (*parent* a-parent-node)))   ; <aux-sublist> of the element 'a'
   "link")

The SXPath expression (sxpath '(@ href *text*))
returns the value of the href attribute -- currently and under the
proposal. So, an application that uses SXPath to fetch attribute
values should not be affected by the proposal. Furthermore, no changes
to SXPath are necessary.

Incidentally, to fetch the values of the *parent* aux-nodes, we would
use (sxpath '(@ @ *parent* *)) or (sxpath '(@ href @ *parent* *)). It
works already, even in the old version of SXPath. In
the current version of SXPath, the last * should probably be replaced
with *data*

>  1. Auxiliary information is often stored at the top-level '*TOP*' of the
> SXML document (for instance, recall namespace-id association and id-index).
> How do you suggest to represent top-level aux-lists under the new proposal?
> The following syntax:
>   (*TOP*
>    (@ (@ ...))
>    ...)

Hmm, that's a really good question...

>   b. From the point of visual representation, this syntax leads to the
> illusion that SXML attributes are allowed at the top-level of the document,
> which is not right.

I wonder why not. Wouldn't it be the answer?

What if the top-most aux-lists _are_ the attributes of the *TOP*
element?

(*TOP* (@ (id-collection id-hash)) (p (@ (id "id1")) "par1"))

This is not a contradiction with the Infoset: the Infoset
Recommendation specifically states that it is not intended to be
exhaustive. It also appears that this suggestion does not contradict
the XPath Recommendation. Besides, *TOP* per se does not correspond to
any proper XML element (rather, it is an abstract representation of
the whole document). Attributes are not considered children of their
parents, therefore, even with <aux-sublist>, the *TOP* element has
only one element child -- the root element.


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html