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
for my current project I need to be able to parse attributes that can start with @. However, parsehtml throws up a warning and doesn't parse the attribute at all while parsexml outright throws an error.
I had the same problem today. As I always traverse the whole document I could mask the '@' char and replace it afterwards. Depending on your goal you could do something similar.
functionparse_vue_html(html)
doc_string =replace(html, "@"=>"__vue-on__")
empty!(EzXML.XML_GLOBAL_ERROR_STACK)
doc = Logging.with_logger(Logging.SimpleLogger(stdout, Logging.Error)) do
EzXML.parsehtml(doc_string).root
end# remove the html -> body levelsreplace(parse_elem(first(eachelement(first(eachelement(doc))))), "__vue-on__"=>"@")
end
Note that the parser parse_elem() replaces the instances of __vue-on__ that occur as attribute name.
Greetings,
for my current project I need to be able to parse attributes that can start with @. However,
parsehtml
throws up a warning and doesn't parse the attribute at all whileparsexml
outright throws an error.Example:
Using
parsehtml
:Printing the result shows the attribute is not parsed:
Using
parsexml
:I'm using Julia v1.8.0 and EzXML v1.1.0, with no other packages in the environment.
The text was updated successfully, but these errors were encountered: