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

add xml namespace support #1

Open
marc-portier opened this issue Feb 16, 2022 · 1 comment
Open

add xml namespace support #1

marc-portier opened this issue Feb 16, 2022 · 1 comment
Milestone

Comments

@marc-portier
Copy link
Member

during parse we should be able to specify namespace-to-prefix mappings that can be used for actual member-finding later on

suggested way of working:

#input
xml = '<root xmlns="https://example.org/ns/default" xmlns:pfx="https://example.org/ns/other"><a>1</a><pfx:a>2</pfx:a></root>'
# can be inspected through
xdict=parse(xml, dict(ns1="https://example.org/ns/default", ns2="https://example.org/ns/other"))
assert int(str(xdict['ns1:a'])) == 1
assert int(str(xdict['ns2:a'])) == 2
@marc-portier marc-portier added this to the 0.2 milestone Feb 16, 2022
@marc-portier marc-portier changed the title provide xml namespace support add xml namespace support Feb 16, 2022
@marc-portier
Copy link
Member Author

While reading up https://github.com/bramstein/xsltjson
there seems to be something like the Badgerfish convention that is guiding this kind op stuff.

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