exemelle


License

License

MIT
GroupId

GroupId

io.github.amrhassan
ArtifactId

ArtifactId

exemelle_2.11
Last Version

Last Version

2.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

exemelle
exemelle
Project URL

Project URL

https://amrhassan.github.io/scala-exemelle
Project Organization

Project Organization

io.github.amrhassan
Source Code Management

Source Code Management

https://github.com/amrhassan/scala-exemelle

Download exemelle_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.amrhassan/exemelle_2.11/ -->
<dependency>
    <groupId>io.github.amrhassan</groupId>
    <artifactId>exemelle_2.11</artifactId>
    <version>2.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.amrhassan/exemelle_2.11/
implementation 'io.github.amrhassan:exemelle_2.11:2.1.1'
// https://jarcasting.com/artifacts/io.github.amrhassan/exemelle_2.11/
implementation ("io.github.amrhassan:exemelle_2.11:2.1.1")
'io.github.amrhassan:exemelle_2.11:jar:2.1.1'
<dependency org="io.github.amrhassan" name="exemelle_2.11" rev="2.1.1">
  <artifact name="exemelle_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.amrhassan', module='exemelle_2.11', version='2.1.1')
)
libraryDependencies += "io.github.amrhassan" % "exemelle_2.11" % "2.1.1"
[io.github.amrhassan/exemelle_2.11 "2.1.1"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.8
org.typelevel : cats-core_2.11 jar 0.9.0
org.typelevel : cats-free_2.11 jar 0.9.0
com.fasterxml.woodstox : woodstox-core jar 5.0.2

test (1)

Group / Artifact Type Version
org.specs2 : specs2-core_2.11 jar 4.0.2

Project Modules

There are no modules declared in this project.

exemelle

Build Status Maven Central

Reasonable parser combinators for XML element streams

Usage

libraryDependencies += "io.github.amrhassan" %% "exemelle" % "2.1.1"
import exemelle.StreamAction._
import exemelle.StreamParser

// You can describe how you want to process the stream in terms of combinators found in
// the StreamAction object

// Perhaps you want to capture the XML elements numbered 11 to 15?
val take5After10 = for {
    _ <- drop(10)
    elems <- take(5)
  } yield elems
  
// or drop everything until you encounter the "author" starting tag then take 5 elem?
import cats.implicits._   // For the >> shorthand
val dropUtilAuthor = dropUntil(_.name == "author") >> take(5)

// Or the full tag named "book"?
val bookTag = findTagNamed("book")

// Or al the full tags named "book"?
val allBookTags = findAllTagsNamed("book")


// You need parser implementation to parse through your stream
val parser = StreamParser.fromInputStream(/* a java.io.InputStream */)

// Now you can run one of the actions you've constructed earlier
run(parser)(allBookTags) // runs it into an Either[StreamError, Vector[Tag]]

Versions

Version
2.1.1
2.1.0
2.0.0
1.1.0
1.0.0
0.1.0-RC3
0.1.0RC2
0.1.0RC1
0.1.0RC0
0.1.0-M3