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

AssertionError when attribute node name is "&&" #149

Open
mmiller-max opened this issue Aug 30, 2020 · 0 comments
Open

AssertionError when attribute node name is "&&" #149

mmiller-max opened this issue Aug 30, 2020 · 0 comments

Comments

@mmiller-max
Copy link

MWE from a fresh Julia session:

julia> using EzXML
[ Info: Precompiling EzXML [8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615]
julia> node = AttributeNode("name", "&&")
EzXML.Node(<ATTRIBUTE_NODE[name]@0x00007fa47bb75610>)
julia> node.content
ERROR: AssertionError: isempty(XML_GLOBAL_ERROR_STACK)
Stacktrace:
 [1] macro expansion at /Users/user/.julia/packages/EzXML/ZNwhK/src/error.jl:49 [inlined]
 [2] nodecontent(::EzXML.Node) at /Users/user/.julia/packages/EzXML/ZNwhK/src/node.jl:1126
 [3] getproperty(::EzXML.Node, ::Symbol) at /Users/user/.julia/packages/EzXML/ZNwhK/src/node.jl:398

If I debug into @catch, XML_GLOBAL_ERROR_STACK contains EzXML.XMLError[], and if I call throw_xml_error() whilst debugged:

debug> throw_xml_error()
ERROR: XMLError: unterminated entity reference               & from tree module (code: 1302, line: 0)

I'm guessing xmlNewDocProp in AttributeNode can't accept a string containing "&&". Rather than using an AttributeNode I tried using setindex! to set the same attribute. This worked and I can see that the name is &amp;&amp.

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