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

module-xml: make_xml() is too strict for tag names, resulting in MAKE-XML-ERROR: tag: "_some_tag" is not a valid XML tag element name if tag starts with underscore #1326

Closed
pvanek opened this issue Oct 11, 2016 · 1 comment
Assignees
Milestone

Comments

@pvanek
Copy link
Contributor

pvanek commented Oct 11, 2016

example:

%new-style
%requires xml

const H = ( "foo" : ( "_some_tag" : 1 ) );

string s = make_xml(H);
printf("%N\n", s);

error:

pvanek@linux-emsy:~> qore t.q
unhandled QORE System exception thrown in TID 1 at 2016-10-11 10:31:21.753658 Tue +02:00 (CEST) in make_xml() (t.q:6, builtin code)
MAKE-XML-ERROR: tag: "_some_tag" is not a valid XML tag element name
call stack:
  1: make_xml() (t.q:6, builtin code)

while the expected XML is validated by xmllint without any errors:

pvanek@linux-emsy:~> cat t.xml
<?xml version="1.0"?>
<foo><_some_tag>1</_some_tag></foo>

pvanek@linux-emsy:~> xmllint --format t.xml
<?xml version="1.0"?>
<foo>
  <_some_tag>1</_some_tag>
</foo>

Actually this issues breaks Qorus oprop xml export in some cases

@pvanek
Copy link
Contributor Author

pvanek commented Oct 11, 2016

add:

XML Naming Rules

XML elements must follow these naming rules:

Element names are case-sensitive
Element names must start with a letter or underscore
Element names cannot start with the letters xml (or XML, or Xml, etc)
Element names can contain letters, digits, hyphens, underscores, and periods
Element names cannot contain spaces

Any name can be used, no words are reserved (except xml).

@davidnich davidnich self-assigned this Oct 11, 2016
@davidnich davidnich added this to the 0.8.12.4 milestone Oct 11, 2016
@davidnich davidnich modified the milestones: 0.8.11.x, 0.8.12.4 Oct 11, 2016
@davidnich davidnich removed their assignment Oct 11, 2016
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

2 participants