~/talk

An Analytical Approach to Writing XSLT Transformations for Converting Documents...

Talkat XML Prague 2020 · 2020-02-13..02-15· [data-engineering]
name:Liam Quin
links:none on file
slides:none on file

Tool called Eddy parses and flattens DTDs via a SAX API, compares source and destination (JATS examples), and generates a 5 MB identity XSLT plus a simple config file that tracks which elements are handled. Error messages reference the DTDs so thousands of sample files converge to validation in hours rather than days; element-level reports and sortable XSLT messages let users fix the top ~10 validation causes quickly. Prototype in Perl, on private GitLab, intended for rewrite and public release.

AI-written summary · about

  1. 0:00Intro
  2. 0:51Outline Converting XML to a new version of a DTD • Or an older, or different, version A big DTD • With lots of elements and attributes
  3. 1:56What has changed in the DTD What would no longer validate with an identity transformation • What might no longer validate with an identity transform?
  4. 4:09Text Diffs • You can use the Unix/Linux diff command on the DTDs, but this is line-based, not declaration- based
  5. 6:10DTD Comparator Part of a Java-based DTD-Analyzer package that includes also a DTD Hattener tool; • Produces an HTML report and an initial XSLT stylesheet that you edit; • I didn't find this before writing Eddic, but...
  6. 7:52All these approaches suck! • They are based on a waterfall model in which you analyse the differences, understand them, then write code to transform documents. • But DTD, like most requirements, evolte continuously. . And you don't need to handle all changes ...
  7. 9:46Common cycle: - Write a transformation - Run it on test documents
  8. 15:26The Generated XSLT • Eddie 2 makes a template for each element in the source DTD, with comments comparable to the report. • The template also produces messages
  9. 16:09Messages • Element sock contains blister not in source DTD • Element sock has price attribute not in source DTD • Element sock has fabric attribute with incompatible value list • Element sock has xmlns:xlink attribute declared as CDATA in source but #FIXED in destination
  10. 17:12Message Methodology • Messages from Eddie 2 don't contain filenames or line numbers, so you can sort them and count how many there are of each (sort | unig -c). • Use this to address the most common ones first. • The messages are in terms of the input DTD, not the input files or output XML.
  11. 19:22Does it Work? • A conversion from one or to another, previously unseen, without documentation (but with test input files) can be done in a few hours, with repeated runs of Eddie 2 and addressing the most common messages. • The report provides a useful level of documentation. • But it doesn't make it trivial: ...
  12. 21:47When it doesn't help • If your input is BITS and your output is HTML (say), the only use is the report to see content models and make a to-do list. • Doesn't know about DTD-specific items, such as JATS date representation
  13. 22:38DTD-specific plugins • Turn from working prototype to production code; • Some XSLT coverage reporting . Element renaming • Parameter Entities in the report? Support RNG and XSD? Hard!
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.