Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysterious 'duplicate attribute' error #3

Open
sciurius opened this issue Nov 14, 2019 · 1 comment
Open

Mysterious 'duplicate attribute' error #3

sciurius opened this issue Nov 14, 2019 · 1 comment

Comments

@sciurius
Copy link

This program bails out with Not well-formed - duplicate attribute:

use XML::Tiny 2.07;
XML::Tiny::parsefile(\*DATA);
__END__
<tabpage>
   <control type='labelh' text='VEhFUkU=' />
   <control type='faderh' />
</tabpage>

This program bails out with Not well-formed /&gt; <control at /usr/share/perl5/vendor_perl/XML/Tiny.pm line 250, <DATA> chunk 1.:

use XML::Tiny 2.07;
XML::Tiny::parsefile(\*DATA);
__END__
<tabpage>
   <control text='VEhFUkU=' />
   <control type='faderh' />
</tabpage>
@DrHyde
Copy link
Owner

DrHyde commented Nov 27, 2019

A thorny problem, and I'm not sure how to solve it.

So that the module can reliably spot the end of tag character > it transforms any > inside an attribute value into &gt;, and it does that by looking for something that looks like a name, following by =, followed by a quoted string. In your documents, this

VEhFUkU=' />
<control type='

looks like a name, followed by equals, and a quoted string.

Sorry about that. While I am going to have a think about it, don't expect a fix any time soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants