anti-xml

Zipping zippers in Anti-XML

非 Y 不嫁゛ 提交于 2019-12-22 10:15:42
问题 In this question, the asker wants to transform documents like this: <text> The capitals of Bolivia are <blank/> and <blank/>. </text> Into this: <text> The capitals of Bolivia are <input name="blank.1"> and <input name="blank.2">. </text> As I noted in my answer there, Anti-XML's zippers provide a clean solution to this problem. The following, for example, would work for renaming the blank elements: import com.codecommit.antixml._ val q = <text>The capitals of Bolivia are <blank/> and <blank/

Can you use antixml to create xml documents?

北慕城南 提交于 2019-12-14 03:42:06
问题 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? 回答1: Yes, you can build (and serialize) XML documents: import com.codecommit.antixml._ val doc = Elem(None, "doc", Attributes(), Map(), Group( Elem(None, "foo", Attributes(

Zipping zippers in Anti-XML

你说的曾经没有我的故事 提交于 2019-12-06 01:00:52
In this question , the asker wants to transform documents like this: <text> The capitals of Bolivia are <blank/> and <blank/>. </text> Into this: <text> The capitals of Bolivia are <input name="blank.1"> and <input name="blank.2">. </text> As I noted in my answer there , Anti-XML 's zippers provide a clean solution to this problem. The following, for example, would work for renaming the blank elements: import com.codecommit.antixml._ val q = <text>The capitals of Bolivia are <blank/> and <blank/>.</text>.convert (q \\ "blank").map(_.copy(name = "input")).unselect Unfortunately the following

Can you use antixml to create xml documents?

拈花ヽ惹草 提交于 2019-12-04 03:44:53
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? Travis Brown Yes, you can build (and serialize) XML documents: import com.codecommit.antixml._ val doc = Elem(None, "doc", Attributes(), Map(), Group( Elem(None, "foo", Attributes("id" -> "bar"), Map(), Group(Text("baz"))) )) val writer = new java.io.StringWriter val