httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Hyde <bh...@pobox.com>
Subject Re: Proposal: new config API
Date Wed, 16 Jun 1999 14:48:55 GMT

Greg Stein <gstein@lyra.org> writes:
> XML Attributes really don't need to be supported. ...

I think that would be a mistake.

While some XML subcultures (WebDav, RDF for example) have found it 
helpful to map XML into another object model this transformation,
in particular, strikes me as a little too agressive for my taste.

In particular after this transform you can't distinguish XSLT's
between from-children and from-attributes.

I might representing XML docs along these lines.

  typedef struct xml_element_s xml_element;
  typedef struct xml_attribute_s xml_attribute;
  typedef struct xml_text xml_attribute;

  struct xml_element_s {
     xml_element *parent;
     xml_element *next;
     xml_symbol *name;
     xml_attribute *attributes;
     union {
       xml_element *children;
       xml_text *text;
     }
     ...
    };

  struct xml_attribute_s {
     xml_element *parent;
     xml_attribute *next;
     xml_element *previous;
     xml_symbol *name;
     xml_text *value;
     ...
  }

  struct xml_symbol_s {
     xml_namespace *namespace;     
     xml_text *print_name;
     ...
  };
  ...

  struct xml_text_s { ... who knows ... };

This does map the XML object model into a somewhat different
by mapping text elements, processing instructions, comments
etc. into an xml_element who's name is an xml_symbol that resides
in a namespace the XML processor provides to support that mapping.
That's not as dense with the text elements as one might like,
but I'm attracted to the uniformity.

 - ben

That quote with more context...
Greg Stein <gstein@lyra.org> writes:
> Manoj Kasichainula wrote:
> > So, are these things worth the effort and complexity:
> > 
> > - partitions with independant change notification
> > - hashed config directives
> > - Supporting XML node attributes (I forget the actual term that the
> >   XML geeks use) as in <blah tree="deciduous" food="tasty">
> > - Supporting limiting what scopes directives can be used in.
> 
> XML Attributes really don't need to be supported. When you stop and
> consider it, there is a simple transformation that implies only elements
> are needed:
> 
> <elem attr="value"/>
> 
> becomes
> 
> <elem>
>   <attr>value</attr>
> </elem>
> 
> In other words, you can define an XML schema which requires no
> attributes. The DAV schema follows this rule/pattern.
> 
> Caveat: attributes are used for namespace declarations and specifying
> the natural language context. In this sense, you could view them as
> "addendums" to the data within the XML document.

Mime
View raw message