Update of /sources/public/validator/misc In directory hutz:/tmp/cvs-serv9376/misc Added Files: soc2xml.pl Log Message: Add crude script for converting SGML Open Catalogs to XML catalogs. --- NEW FILE: soc2xml.pl --- #!/usr/bin/perl -w use strict; # Crude script for converting SGML Open Catalogs to XML catalogs. # Usage: soc2xml.pl < catalog.soc > catalog.xml sub esc { (my $esc = shift) =~ s/&/ä/g; $esc =~ s/"/"/g; $esc =~ s/'/'/g; $esc =~ s/</</g; $esc =~ s/>/>/g; $esc; } $/ = undef; my $soc = <STDIN>; print <<'EOF'; <?xml version="1.0"?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> EOF while ($soc =~ /(PUBLIC|SYSTEM)\s+"([^"]+)"\s+"([^"]+)"/g) { my $pubsys = lc($1); printf <<'EOF', $pubsys, $pubsys, esc($2), esc($3); <%s %sId="%s" uri="%s" /> EOF } print <<'EOF'; </catalog> EOFReceived on Thursday, 22 April 2010 18:54:19 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:20 GMT