Script to unmodularize DTDs

Hi,

  @echo off
  perl -e "print qq{<!DOCTYPE x [<!ENTITY \x25 x SYSTEM '$ARGV[0]'>\x25x;]><x/>}" %1 > %1.tmp
  xmllint --noent %1.tmp | perl -ne "local$/;$_=<>;s/^<!DOCTYPE x \[//;s/]>\s*<x\/>$//;s/<!--.*?-->//sg;s/<!ENTITY.*?>//sg; s/\n+/\n/g; print"
  del %1.tmp

regards.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Thursday, 17 February 2005 10:03:08 UTC