Subject: | <!NOTATION> directive with empty string causes invalid XML output |
I am using XML::Twig to process XML written from FrameMaker. It has the following <!NOTATION> directive:
====
<!DOCTYPE manual SYSTEM "book.dtd" [
<!NOTATION mif PUBLIC "">
]>
====
This XML code passes xmllint. But once read and written by XML::Twig, the directive is changed:
====
<!DOCTYPE manual SYSTEM "book.dtd" [
<!NOTATION mif>
]>
====
and subsequently fails xmllint:
====
b.xml:3: parser error : Space required after the NOTATION name'
<!NOTATION mif>
^
b.xml:3: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
<!NOTATION mif>
^
b.xml:4: parser error : Start tag expected, '<' not found
]>
^
====
Subject: | notation_bug.pl |
#!/usr/bin/perl
use strict;
use warnings;
use XML::Twig;
my $xml = <<EOF;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manual SYSTEM "book.dtd" [
<!NOTATION mif PUBLIC "">
]>
<?Fm Book?><manual/>
EOF
my $twig=XML::Twig->new();
$twig->parse($xml);
$twig->print(pretty_print => 'indented');