简体   繁体   中英

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? 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.

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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