Re: [libcroco-list] XML+CSS annotator example



Hey Bjoern,

The code looks nice to me.
Could I add it to the docs/examples directory of the libcroco project ?

Thank you for your time.

Dodji.

Selon Bjoern Hoehrmann <derhoermi gmx net>:

> Hi,
> 
>   I wrote a quick hello world example using libxml2 and libcroco, see
> http://lists.w3.org/Archives/Public/www-archive/2004Jun/att-0000/cssanno.c
> 
>   /*
>     cssanno.c -- annotate XML documents with CSS declarations
>   
>     Usage:
>   
>       cssanno file.xml file.css
>   
>     cssanno takes an XML document and a CSS style sheet and
>     annotates the elements with new attributes representing
>     the style declarations for the current element. Example:
>   
>       <?xml version='1.0' encoding='utf-8'?>
>       <foo><bar/><baz/></foo>
>   
>     with a style sheet
>   
>       foo           { display: block }
>       bar           { color: red }
>       baz           { font-family: "Arial Unicode MS" }
>       *:first-child { white-space: normal }
>   
>     would result in an XML document like
>   
>       <?xml version="1.0" encoding="utf-8"?>
>       <foo xmlns:css           = "http://example.org/css#";
>            css:display         = "block"
>            css:white-space     = "normal">
>           <bar css:color       = "red"
>                css:white-space = "normal" />
>           <baz css:font-family = "&quot;Arial Unicode MS&quot;" />
>       </foo>
>   
>   ...
>   
>   */
> 
> It's not perfect, but it might be useful for beginners. Maybe something
> similar would be useful for testing...
> 
> regards.
> _______________________________________________
> Libcroco-list mailing list
> Libcroco-list gnome org
> http://mail.gnome.org/mailman/listinfo/libcroco-list
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]