bash-2.05b$ cat xml2sgml.pl #!/usr/bin/perl -w use strict; my $doctypePat = quotemeta ( '<!DOCTYPE article PUBLIC "-//OASIS//DTD +DocBook XML V4.1.2//EN"' ); my $fl; $fl = <>; print $fl if $fl !~ /^\<\?xml/; while(<>) { if (/$doctypePat/) { print <<EOT; <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [ <!ENTITY nwalsh "Norman Walsh"> ]> EOT <>; next; } s/article/book/g; if ( /\<\/bookinfo>/ ) { print $_; print "<article>\n"; next; +} if ( /\<\/book>/ ) { print "</article>\n"; print $_; next; } print $_; }
| Plankton: 1% Evil, 99% Hot Gas. |
In reply to Re^2: XML to SGML or xsl vs DTD confused
by Plankton
in thread XML to SGML or xsl vs DTD confused
by Plankton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |