简体   繁体   English

Scala解析器组合解析xml?

[英]Scala parser combinators parsing xml?

Can scala's parser combinators parse xml and validate that the closing tags have the same name as the opening tags? scala的解析器组合器可以解析xml并验证结束标记与开始标记的名称是否相同? I don't directly need it, but I would like to know the limits of my libraries. 我不直接需要它,但我想知道我的库的限制。

Yes, it can do that. 是的,它可以做到这一点。 Use into or >> (which is the same thing, really) to parameterize a latter parser based on a parsed value. 使用into>> (实际上是同样的事情)根据解析的值参数化后一个解析器。

This document seem to describe an attempt on that: http://www.berniepope.id.au/docs/scala_parser_combinators.pdf 该文件似乎描述了一种尝试: 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 ...以及该软件的链接(Scala XML-parser): http//www.berniepope.id.au/software.html

You might also be interested in XML pickler combinators , part of the GData Scala client library. 您可能也对XML pickler combinators感兴趣,它是GData Scala客户端库的一部分。 I've pulled out the pickler combinators and made them available in a self-contained library here . 我掏出皮克勒组合程序,使他们在一个独立的库中可用这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM