there are a few examples for using Anti-Xml to extract information from XML documents, but none that I could find of using Anti-Xml to create XML documents. Does Anti-Xml support creating documents, or should I use another library for this (which one?). Does anyone have an example of creating an XML document with Anti-Xml?
there are a few examples for using Anti-Xml to extract information from XML documents,
Share
Yes, you can build (and serialize) XML documents:
You can also use Anti-XML’s zippers to do some interesting editing tricks:
Now
newDoccontains the edited document:The
Zipperthatdoc \ "foo"returns is different from aNodeSeqin that it carries information about its context, which allows you to “undo” the selection operation done by\.Update in response to ziggystar‘s comment below: if you want something like Scala’s XML literals, you can just use
converton anyscala.xml.Elem:I’d assumed the question was about programmatic creation.