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

XMLDecl ignores standalone [rt.cpan.org #102535] #73

Open
toddr opened this issue Sep 24, 2019 · 0 comments
Open

XMLDecl ignores standalone [rt.cpan.org #102535] #73

toddr opened this issue Sep 24, 2019 · 0 comments

Comments

@toddr
Copy link
Member

toddr commented Sep 24, 2019

Migrated from rt.cpan.org#102535 (status was 'open')

Requestors:

From [email protected] on 2015-03-05 21:57:15
:

SVG file (is UTF8): <?xml version="1.0" encoding="UTF-8" standalone="no"?>

Perl:
sub handle_xml_declaration
{
  my($expat, @attributes) = @_;

  print STDERR 'XML: ', join(', ', map{defined($_) ? $_ : '! defined'} @attributes), '.';

  ...
}

Output: XML: 1.0, UTF-8, .


From [email protected] on 2015-04-17 04:10:23
:

The documentation states that 
  "Standalone will be either true, false, or undefined if the standalone attribute is yes, no, or not made respectively." 

The code sample provided indicates its returning an empty string which *is* a false value. I don't see standalone being "ignored" in this case.

Hope that helps,
  Russell.
.. who is attempting to clean up the XML::Parser issues thanks to the #CPANPR challenge.


From [email protected] on 2015-04-17 06:07:04
:

Hi Russell

Thanx for taking an interest in this.

However, I must reject your argument. I expect the returned value to be 
'yes', 'no' (both obvious) or '' (or perhaps undef, but I hope not - see 
below) if not specified.

Anything else I regard as a bug. Hence my report.

The use of undef can cause pain (i.e. a warning) when printing strings 
as I did in the demo, so I don't want to see it implemented.

On 17/04/15 14:10, Russell Jenkins via RT wrote:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=102535 >
>
> The documentation states that
>    "Standalone will be either true, false, or undefined if the standalone attribute is yes, no, or not made respectively."
>
> The code sample provided indicates its returning an empty string which *is* a false value. I don't see standalone being "ignored" in this case.
>
> Hope that helps,
>    Russell.
> .. who is attempting to clean up the XML::Parser issues thanks to the #CPANPR challenge.
>

-- 
Ron Savage - savage.net.au


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

1 participant