There are two reasons (in no particular order):
1) implementing SAC shares several mechanisms with SAX and relying on
Xerces-C simplify its implementation
2) applying a CSS style sheet on an XML document requires to search inside
the DOM and therefore needs an implementation of the DOM.

Much like with SAX, you could either parse "on the fly" or load the document
first and use it afterwards.
Having a DOM/CSS implementation inside Xerces-C would enable some queries
like: what are all the style attributes for a given element node?
SVG and XHTML allow an attribute called "style" to specify graphic
attributes or override rules.
For example, a toplevel CSS rule might say the H1 elements are in red with
the following rule:
H1 { color: red; }
Whereas a specific element may change that by saying <H1 style="color:
blue;">..
This mechanism is also used by SVG.
A user program that needs to compute the graphical/typographical attributes
for each element would then ask DOM/CSS to resolve the inherited and
overriden values itself.

Style attributes depend on the element names, their attributes and lots of
context computed by DOM-CSS that could be optimized when the internal
structure of the DOM is known.
If Xerces-C users want to implement "styled" DTDs, then SAC and DOM-CSS is a
great relief for them.  Others won't care.

I once thought about an "add-on" to Xerces-C, much like Xalan.  However,
DOM-CSS is much simpler than XSLT and could be -- in my opinion -- included
inside Xerces-C without growing it too much.

Also, note that DOM-CSS is part of the DOM specification so it makes sense
to have it inside Xerces-C that is advertised as implementing the DOM
interface in C++.

  Jean-Daniel Fekete
  Ecole des Mines de Nantes, 4 rue Alfred Kastler, La Chantrerie,
  BP 20722, 44307 Nantes Cedex 03, France
  Voice: +33-2-51-85-82-08  | Fax: +33-2-51-85-82-49
  [EMAIL PROTECTED] | http://www.emn.fr/fekete/


----- Original Message -----
From: "Curt Arnold" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 08, 2001 10:20 PM
Subject: Re: SAC and CSS


> Since I hadn't heard of SAC, I thought it might be reasonable that some
> others on the list hadn't either.  SAC is "Simple API for CSS" and was
> submitted as a W3C note last summer: http://www.w3.org/TR/SAC/
>
> I'm curious why a SAC implementation would need to be integrated into the
> XML parser and just an independent layer.  It would seem that a CSS parser
> would be called from an application specific SAX Document handler, for
> example, a DocumentHandler for SVG would know that a <svg:style
> type="text/css"> tag or a style attribute of <svg:rect> (and others) was a
> CSS fragment, however you might have another namespace where style meant
> something else.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to