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

as_int default value ignored if the attribute exists #80

Closed
ephraimo opened this issue Jan 18, 2016 · 1 comment
Closed

as_int default value ignored if the attribute exists #80

ephraimo opened this issue Jan 18, 2016 · 1 comment

Comments

@ephraimo
Copy link

When using as_int(1) on attributes such as:
Threshold=""
or:
Threshold="non-numeric"

The return value is 0 instead of the default 1 as expected according to the manual: http://pugixml.org/docs/manual.html#access.attrdata

The same holds true for the other numeric attribute accessors.

@zeux
Copy link
Owner

zeux commented Jan 18, 2016

The non-numeric case is working as documented (result is undefined). Issue #15 tracks improvements in this area.

The empty case is indeed not working as documented. I'm currently intending to change documentation since I don't see a good reason for difference in behavior between threshold="" and threshold="a".

@zeux zeux closed this as completed in 7aef75f Jan 20, 2016
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