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
I would like to know how to create a TextNode directly from an XML string.
I did not find at all a way to do this: I get a whole Document or entities in my TextNode, it seems difficult or impossible to create a TextNode from a rich text string. A parsexml function which can return a TextNode (not only a Document) or an argument to specify to TextNode(content) that content is raw XML seem nice solutions.
I don't even find a workaround to insert inside a node text and other nodes from a rich text string.
For example:
using EzXML
text = """A <tag>simple</tag> word and a more <tag att="val">complex</tag> one."""
# Best expected way
# returns XMLError: Start tag expected, '<' not found from XML parser (code: 4, line: 1)
result_1 = parsexml(text)
# Another good way
# returns A <tag>simple</tag> word and a more <tag att="val">complex</tag> one.
# it is expected but not the goal, an argument like "raw" would be nice.
result_2 = TextNode(text)
# Current step
# returns <?xml version="1.0" encoding="UTF-8"?><fake_tag>A <tag>simple</tag> word and a more <tag att="val">complex</tag> one.</fake_tag>
# but this is an EzXML.Document, not a TextNode, and the need to add fake tags around is messy (need to retrieve the tag of the parent…).
result_3 = parsexml("<fake_tag>" * text * "</fake_tag>")
Thank you.
The text was updated successfully, but these errors were encountered:
Can you post a question at https://discourse.julialang.org/? The issue tracker is for issue tracking and not for questions. Mention me if you need my attention.
Hello,
I would like to know how to create a TextNode directly from an XML string.
I did not find at all a way to do this: I get a whole Document or entities in my TextNode, it seems difficult or impossible to create a TextNode from a rich text string. A parsexml function which can return a TextNode (not only a Document) or an argument to specify to TextNode(content) that content is raw XML seem nice solutions.
I don't even find a workaround to insert inside a node text and other nodes from a rich text string.
For example:
Thank you.
The text was updated successfully, but these errors were encountered: