You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So it looks like constants and expressions like nothing are currently converted to "strings" based on their name, rather than being interpreted first? Note I also tried using XML.Text(pi) or XML.Text(nothing), but the same happens.
The context is that I am trying to create an "add element node" function called aen, to remove the clutter from my code. Here is one attempt where I was hoping to use an optional amount of args and kwargs.
Just learned this behaviour is probably inherited from the print function, and it seems the same for the string function. I'm new to Julia, but this seems like odd behaviour to me.
If I do something like this:
The XML will contain:
The correct behaviour should be:
So it looks like constants and expressions like
nothing
are currently converted to "strings" based on their name, rather than being interpreted first? Note I also tried usingXML.Text(pi)
orXML.Text(nothing)
, but the same happens.The context is that I am trying to create an "add element node" function called
aen
, to remove the clutter from my code. Here is one attempt where I was hoping to use an optional amount ofargs
andkwargs
.However, if one now uses the following, one still gets
<bread>nothing</bread>
:So when
args...
is empty Julia passes anothing
which is currently again producing the string"nothing"
in the XML file at the moment.A workaround for constants seems to be to force them to be interpreted e.g. by multiplying by 1:
Sidenote, not sure if
breadNode = XML.Element("bread",[])
should produce the following either:This may highlight a general issue in interpreting the XML.Text entry.
Thanks for your help!
The text was updated successfully, but these errors were encountered: