#include <libxslt/xsltutils.h>
#include <libxslt/extensions.h>
-#include <libexslt/exsltconfig.h>
+#include <libexslt/exslt.h>
#ifndef HAVE_STAT
const char *ID,
xmlParserCtxtPtr ctxt);
+#define LIBXML_DEBUG_ENABLED
+//#define DEBUG
+
static int debug = 0;
static int novalid = 0;
static int noout = 0;
{ '$', "\\$" },
{ '%', "\\%" },
{ '&', "\\&" },
- { '<', "\\verb+<+" },
- { '>', "\\verb+>+" },
+ { '<', "$<$" },
+ { '>', "$>$" },
{ '\\', "$\\backslash$" },
- { '^', "\\verb+^+" },
+ { '^', "$\\wedge$" },
{ '_', "\\_" },
{ '{', "\\{" },
+ { '|', "$\\mid$" },
{ '}', "\\}" },
- { '~', "\\verb+~+" },
+ { '~', "$\\sim$" },
{ 160, "~" },
{ 161, "!`" },
{ 162, "..." },
xmlXIncludeProcessFlags(doc, XSLT_PARSE_OPTIONS);
+#ifdef DEBUG
+ xmlDebugDumpDocument(stdout, doc);
+#endif
+
if (latex)
{
LatexEscape(xmlDocGetRootElement(doc));
void LatexEscape(xmlNodePtr node)
{
xmlNodePtr child;
+ xmlAttrPtr attribute;
xmlChar *byte;
int unicode;
int textlen;
int i;
+#ifdef DEBUG
+ fprintf(stderr, "\n-------- Node type %d\n", node->type);
+#endif
if (xmlNodeIsText(node))
{
#ifdef DEBUG
}
else
{
+ for (attribute = node->properties; attribute != 0; attribute = attribute->next)
+ {
+ LatexEscape(attribute->children);
+ }
for (child = node->children; child != 0; child = child->next)
{
- if (strcmp(child->name, "verbatim") != 0 )
+ if (strcmp(child->name, "verbatim") != 0 && strcmp(child->name, "example") != 0)
{
LatexEscape(child);
}