-
Notifications
You must be signed in to change notification settings - Fork 27
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
XML Prolog support #34
base: master
Are you sure you want to change the base?
Conversation
Firefox always serialize XML with '<?xml version="1.0" encoding="UTF-8"?>'
}; | ||
var aCache = []; | ||
var rIsNull = /^\s*$/; | ||
var rIsBool = /^(?:true|false)$/i; | ||
var rXmlProlog = /^(<\?xml.*?\?>[\n]?)/; | ||
var rXmlPrologAttributes = /\b(version|encoding|standalone)="([^"]+?)"/g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these attributes could also be quoted in single quotes '
according to the specs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake... that's easy to fix.
that's ok, because these are the only three allowed pseudo-attributes of the xml declaration (see https://www.w3.org/TR/2004/REC-xml-20040204/#sec-prolog-dtd)
Yeah, that's fine, because the top-most level in the JXON representation cannot currently have any attributes, as it would reference the "parent" of the xml root element. The analogy that this should apply to the pseudo-attributes of the xml document suggests itself. But I think your current implementation is a bit over-complicated, if you ask me. What do you think about the following proposals:
|
I will try to fix all points and them submit a new commit. 👍 |
This commit fixes #33 .
The code supports only
version
,encoding
andstandalone
xml prolog attributes (here).The new special attribute (
xmlProlog
) is using the defaultattrPrefix
, is this ok?I have added two new configs:
Unit test
The new JSON representation from
will be...