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

xd:string "0xF2" => 242 #536

Open
4 of 6 tasks
luddwskater opened this issue Jan 20, 2023 · 4 comments
Open
4 of 6 tasks

xd:string "0xF2" => 242 #536

luddwskater opened this issue Jan 20, 2023 · 4 comments

Comments

@luddwskater
Copy link

luddwskater commented Jan 20, 2023

  • Are you running the latest version? yes
  • Have you included sample input, output, error, and expected output? yes
  • Have you checked if you are using correct configuration? yes
  • Did you try online tool? yes

Description

Parser transform hex to integer but builder doesn't transform back to hex but also transform hex (string) to integer.

Input

		<SupportedTesters>
			<SupportedTester>0xF2</SupportedTester>
		</SupportedTesters>

Code

const options = {
        ignoreAttributes: false,
        attributeNamePrefix : "@_",
		allowBooleanAttributes: true
    };

Output

SupportedTesters
:
SupportedTester
:
242
[[Prot

expected data

0<F2
Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates.

@github-actions
Copy link

I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.

@amitguptagwl
Copy link
Member

I've tried to improve you question but still not able to understand it completely. Please reformat it.

@luddwskater
Copy link
Author

I've an element of type xd:string with value "0xF2" but this is transformed both by parser to json and also by builder to xml as number 242. It means in xml = "0xF2" becames 242 in json and "0xF2" in json became 242 in xml.
Strange , i can't find any option to disable transformation from hex to number.

@amitguptagwl
Copy link
Member

We use strnum npm package for the transformation. Check it's configuration and documentation please

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