slanted W3C logo
Cover page images (keys)

XML Out - reducing the clutter.

Liam Quin, <liam@w3.org>

XML Out - reducing the clutter.

Why?

Whence 1

Whence 2

Whence 3

Who 1?

Who 2

RSS

Error

write($config, " <reg reg.1.displayName=\"$locmark\" reg.1.address=\"$stationid\" reg.1.label=\"$stationid\" reg.1.type=\"private\" reg.1.lcs=\"\" reg.1.csta=\"\" ...

Random Quote

The author represents, in string colours, the causes of error, arising from the disorders of the imagination and passions, the abuse of liberty, and an implicit confidence in the senses.

Problems

What can we do?

XMLout - a family of libraries

Multiple designs (goals)

Status

Library functionality

Example 1:

Example 2: existing C

char *writeConfig1()
{
    char *buffer = malloc(LOTS);

    sprintf(buffer, "<config version=\"1.2\">\n");
    strcat(buffer, "<name>");
    strcat(buffer, "<first>");
    strcat(buffer, "Liam");
    strcat(buffer, "</first>");
    strcat(buffer, "<last>");
    strcat(buffer, "Liam");
    strcat(buffer, "</last>");
    strcat(buffer, "</name>\n");
    strcat(buffer, "</config>\n");
    return buffer;
}

Example: better C

char *writeConfig()
{
    XMLOut *stuff;

    /* tree-based */
    stuff = XOelem("config", NULL);
    Xattr(stuff, "version", "1.0");

    Xcontent(stuff,
        "\n",
        Xelem("name",
            XOelem("first", "Liam", NULL),
            XOelem("last,   "Quin", NULL),
            NULL
        ),
        "\n",
        NULL
    );
    return XOtostring(stuff);
}

Some design issues

OO languages

Mixed Content and Escaping

Directions

Next Steps

EOF

SIGSEGV

Random Quote

The bits of paper upon which he had written these thoughts, were found, after his death, filed upon different pieces of string, without any order or connection; and being copied exactly as they were written, they were afterwards arranged and published.