On Fri Nov 17 13:26:06 2006, PETEK wrote:
Show quoted text> On Fri Nov 17 11:21:05 2006, nick.aevum.de wrote:
> > It doesn't check whether
> > attributes names conform to the XML spec, so it can output invalid XML.
>
> Could you please provide a sample? I see the spec for attribute names,
> but seeing an example of broken behavior would help more.
For example if you have invalid characters in an attribute name:
use HTML::Tree;
my $tree = HTML::TreeBuilder->new_from_content('<img inval!d="asd">');
print $tree->as_XML();
This produces invalid XML by simply cpoying the attribute name:
<img inval!d="asd" />
Show quoted text> HTML::Tree also makes no guarantee at the current time that the XML is
> valid, but I'll be glad to fix what I can.
>
> I am also loathe to implement functionality that causes people to lose
> data, so any fix will have to incorporate warnings or workarounds to
> make sure that doesn't happen.
Ideally there should be an option whether to croak if an invalid
attribute name occurs, or to simply remove the attribute. I think the
least desirable thing is to produce invalid XML, because most likely
this will cause problems later on.