Xacobeo
view release on metacpan or search on metacpan
TAG("boolean",
"family", "Courier 10 Pitch",
"foreground", "black",
"weight", PANGO_WEIGHT_BOLD
);
TAG("number",
"family", "Courier 10 Pitch",
"foreground", "black",
"weight", PANGO_WEIGHT_BOLD
);
TAG("attribute_name",
"foreground", "red"
);
TAG("attribute_value",
"foreground", "blue"
);
TAG("comment",
"foreground", "#008000",
"style", PANGO_STYLE_ITALIC,
"weight", PANGO_WEIGHT_LIGHT
);
TAG("dtd",
"foreground", "#558CBA",
"style", PANGO_STYLE_ITALIC
);
TAG("element",
"foreground", "#800080",
"weight", PANGO_WEIGHT_BOLD
);
TAG("pi",
"foreground", "#558CBA",
"style", PANGO_STYLE_ITALIC
);
TAG("pi_data",
"foreground", "red",
"style", PANGO_STYLE_ITALIC
);
TAG("syntax",
"foreground", "black",
"weight", PANGO_WEIGHT_BOLD
);
TAG("text",
"foreground", "black"
);
TAG("literal",
"foreground", "black"
);
TAG("cdata",
"foreground", "red",
"weight", PANGO_WEIGHT_BOLD
);
TAG("cdata_content",
"foreground", "purple",
"weight", PANGO_WEIGHT_BOLD,
"style", PANGO_STYLE_ITALIC,
"weight", PANGO_WEIGHT_LIGHT
);
TAG("namespace_name",
"foreground", "red",
"style", PANGO_STYLE_ITALIC,
"weight", PANGO_WEIGHT_LIGHT
);
TAG("namespace_uri",
"foreground", "blue",
"style", PANGO_STYLE_ITALIC,
"weight", PANGO_WEIGHT_LIGHT
);
TAG("entity_ref",
"foreground", "red",
"weight", PANGO_WEIGHT_BOLD
);
}
//
// Parses the XML document. Returns an XML document if the parsing was
// successful otherwise NULL.
//
// The document has to be freed with xmlFreeDoc();
//
static xmlDoc* my_parse_document (const gchar *filename) {
// Construct a parser contenxt
xmlParserCtxt *parserCtxt = xmlCreateFileParserCtxt(filename);
parserCtxt->loadsubset = XML_DETECT_IDS;
// Parse the document
xmlDoc *document = NULL;
if (xmlParseDocument(parserCtxt) == 0) {
document = parserCtxt->myDoc;
parserCtxt->myDoc = NULL;
}
xmlFreeParserCtxt(parserCtxt);
return document;
}
( run in 2.404 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )