Scala parser combinators parsing xml?

2019-05-11 19:28发布

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.

3条回答
倾城 Initia
2楼-- · 2019-05-11 19:44

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

查看更多
爷、活的狠高调
3楼-- · 2019-05-11 19:46

Yes, it can do that. Use into or >> (which is the same thing, really) to parameterize a latter parser based on a parsed value.

查看更多
虎瘦雄心在
4楼-- · 2019-05-11 19:50

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.

查看更多
登录 后发表回答