forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Noels <stev...@outerthought.org>
Subject Re: [RT] Entities in XML docs
Date Fri, 27 Dec 2002 17:02:16 GMT
Jeff Turner wrote:

> On Fri, Dec 27, 2002 at 03:02:28PM +0100, Steven Noels wrote:

>>Seems OK to me - fairly similar to the LinkMapTransformer. I'm still 
>>stuck with the obsession we shouldn't use element names as lookup keys, 
>>however, so:
> 
> 
> :) Think of site.xml as a small database:
> 
> PAGE_ID   LABEL        HREF           TIMESTAMP
> -------   -----        ----           ---------
> dreams    Dream list   dreams.html       ...
> faq       FAQs         faq.html
> toc       ToC          doclist.html
> changes   Changes      changes.html
> todo      Todo         todo.html
> 
> PAGE_ID is the primary key, and therefore deserves greater syntactic
> importance than all the other attributes.  Seems most natural to make the
> primary key the element name:

OK on the key thing.

>  <dreams label="Dream list" href="dreams.html"/>
>  <faq label="FAQs" href="faq.html"/>
>  <toc label="ToC" href="doclist.html"/>
>  <changes label="Changes" href="changes.html"/>
>  <todo label="Todo" href="todo.html"/>
> 
> Looking at the definition for NMTOKEN, this also provides some convenient
> restrictions to the primary key value, which otherwise we'd have to enforce
> with regexps:
> 
> Nmtoken  ::= (NameChar)+
> NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender

Hm... we somehow collectively know we'll use RelaxNG instead of DTDs for 
the validation of 'technical' resources (i.e. not documents), and given 
the prospect of pluggable datatypes in RNG, we can force any type of 
validation we want for both element content and attributes values.

An attribute type of NMTOKEN also exists. I'm not sure whether you can 
declare 'any' attribute in RNG while still specifying the type being 
NMTOKEN or something similar, but 'someone will tell me' ;-)

> Finally, we could never have a RNG or DTD for site.xml, because it is intended
> to be arbirtarily extended, vertically by whatever page classification scheme
> the user wants, and horizontally with whatever page metadata the user wants.
> There could be attributes for timestamps, access levels, difficulty levels,
> related pages, bogosity readings, anything.  At best, we could have a
> Schematron enforcing the presence of minimal metadata, ie @href.  Even @label
> is optional, eg:
> 
>   <primer label="Forrest Primer" href="primer.html">
>     <cvs href="#cvs"/>
>   </primer>

In my mind and practice, I only use Schematron for things which can't be 
expressed in other grammar languages, i.e. context- or value-dependent 
values or models, like:

the contentmodel for element c depends on the value of the attribute b 
attached to some element a

and even then, I wonder how that would like in Schematron :-s

>><shortcut name="xml4j">Xerces-Java</shortcut>
>>
>>These are shortcuts, aren't they? - http://radio.userland.com/shortcuts
> 
> 
> Yes, shortcuts, macros etc.  If we go with ${foo} syntax, 'variable' sounds
> most natural.

${} is everywhere... I don't mind, but maybe {{}} would be kewl too...? 
We should define escape characters too, if only for our own documentation.

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at              http://radio.weblogs.com/0103539/
stevenn at outerthought.org                stevenn at apache.org


Mime
View raw message