W3C home > Mailing lists > Public > www-archive@w3.org > February 2005

Script to unmodularize DTDs

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 17 Feb 2005 11:02:48 +0100
To: www-archive@w3.org
Message-ID: <42156ba0.502357843@smtp.bjoern.hoehrmann.de>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:50 GMT