Scala 解析器组合器解析 xml?
scala 的解析器组合器可以解析 xml 并验证结束标签与开始标签的名称相同吗?我并不直接需要它,但我想知道我的库的限制。
Can scala's parser combinators parse xml and validate that the closing tags have the same name as the opening tags? I don't directly need it, but I would like to know the limits of my libraries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,它可以做到这一点。使用
into
或>>
(实际上是同一件事)根据解析值参数化后一个解析器。Yes, it can do that. Use
into
or>>
(which is the same thing, really) to parameterize a latter parser based on a parsed value.该文档似乎描述了对此的尝试: http://www.berniepope.id.au /docs/scala_parser_combinators.pdf
...以及该软件的链接(Scala XML-parser):http://www.berniepope.id.au/software.html
This document seem to describe an attempt on that: http://www.berniepope.id.au/docs/scala_parser_combinators.pdf
... and a link to the software (Scala XML-parser): http://www.berniepope.id.au/software.html
您可能还对 XML pickler 组合器部分感兴趣GData Scala 客户端库的一部分。我已经拿出了 pickler 组合器,并在此处的独立库中提供了它们。
You might also be interested in XML pickler combinators, part of the GData Scala client library. I've pulled out the pickler combinators and made them available in a self-contained library here.