[NTG-context] XML: mapping definiton on the fly?

Johannes Graumann johannes_graumann at web.de
Thu Feb 14 10:04:51 CET 2008


Dear XML-processing inclined,

I was wondering whether with MarkV it is possible to parse an XML file that
contains style definitions as well as there usage and create context
mappings for them on the fly. In the example fragment below this would
mean:
- scan the file until hitting the "<office:automatic-styles>" tag
- analyze the style definition, find it to be
        of family text
        of name T1
        requiring bold fonts
- construct a context/XML mapping along the lines of
    \startxmlsetups T1
      \bf{\xmlflush{#1}}
    \stopxmlsetups
- keep on scanning, when hitting the style invocation: use the dynamically
generated mapping.

Please excuse the hobbyists nomenclature. Thank you for your time and
insight,

Joh


<?xml version="1.0" encoding="UTF-8"?>
...
<office:automatic-styles>
  <style:style 
    style:name="T1" 
    style:family="text"
  >
    <style:text-properties 
      fo:font-weight="bold" 
      style:font-weight-asian="bold" 
      style:font-weight-complex="bold"
    />
  </style:style>
</office:automatic-styles>
<office:body>
  <office:text>
  ...
    <text:p 
      text:style-name="Standard"
    >
      Dies <text:span text:style-name="T1">ist</text:span> ein 
      Text.
    </text:p>
  </office:text>
</office:body>
...



More information about the ntg-context mailing list