XML+CSS annotator using libcroco

Hi,

/*
  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>

  Copyright (c) 2004 Bjoern Hoehrmann <bjoern@hoehrmann.de>.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  $Id$

*/

regards.

Received on Tuesday, 1 June 2004 03:00:45 UTC