We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This happens with 5.0.0. I have not checked older versions.
Save this to a file:
"use strict"; /* eslint-disable no-console */ const fs = require("fs"); const saxes = require("../build/dist/saxes"); const xml = fs.readFileSync(process.argv[2]); const parser = new saxes.SaxesParser({ xmlns: false }); parser.on("opentag", tag => { console.log(tag); }); parser.on("error", err => { console.error(err); }); parser.write(xml); parser.close();
Update the path for saxes in the require call so that it loads a local version of saxes.
saxes
require
<?xml version="1.0" encoding="UTF-8"?> <top> <x>Fnord '<' and then some.</x> <x x="foo"></x> </top>
Run node path/to/js/file path/to/xml/file with the two files above that you've saved.
node path/to/js/file path/to/xml/file
The output should be:
{ name: 'top', attributes: [Object: null prototype] {}, isSelfClosing: false } { name: 'x', attributes: [Object: null prototype] {}, isSelfClosing: false } { name: 'x', attributes: [Object: null prototype] { x: 'foo' }, isSelfClosing: false }
Namely the x attribute on the second x element should have the value foo.
x
foo
{ name: 'top', attributes: [Object: null prototype] {}, isSelfClosing: false } { name: 'x', attributes: [Object: null prototype] {}, isSelfClosing: false } { name: 'x', attributes: [Object: null prototype] { x: '<foo' }, isSelfClosing: false }
Note the less than symbol in the value of the x attribute.
The issue disappears if a handler is added for the text event.
text
The text was updated successfully, but these errors were encountered:
e135f11
lddubeau
No branches or pull requests
This happens with 5.0.0. I have not checked older versions.
Steps to reproduce
Save this to a file:
Update the path for
saxes
in therequire
call so that it loads a local version of saxes.Save this to a file:
Run
node path/to/js/file path/to/xml/file
with the two files above that you've saved.Expected Result
The output should be:
Namely the
x
attribute on the secondx
element should have the valuefoo
.Actual Output
Note the less than symbol in the value of the
x
attribute.Observations
The issue disappears if a handler is added for the
text
event.The text was updated successfully, but these errors were encountered: