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

Invalid octal numbers #2

Closed
GoogleCodeExporter opened this issue Mar 19, 2015 · 2 comments
Closed

Invalid octal numbers #2

GoogleCodeExporter opened this issue Mar 19, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Transform <x>089</x>

What is the expected output? What do you see instead?
You see x:089.
But 089 is an invalid octal number in Javascript.

Replacing

<xsl:template match="text()[not(string(number())='NaN')]">

with 

<xsl:template match="text()[not(string(number())='NaN') and
not(starts-with(.,'0') and (contains(.,'8') or contains(.,'9')))]">

solves the problem.

I'm attaching the revised scripts (including Mat Perrin's correction of
handing null elements).

Original issue reported on code.google.com by root.n...@gmail.com on 30 Oct 2007 at 7:07

Attachments:

@GoogleCodeExporter
Copy link
Author

Fixed in r23

Original comment by docw...@gmail.com on 31 Mar 2008 at 4:43

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Actually, this wasn't fixed because JSON doesn't allow for OCTAL numbers.  See 
issue 8.

Original comment by docw...@gmail.com on 31 Mar 2008 at 8:01

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

No branches or pull requests

1 participant