Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 18 21:33
    scala-steward closed #147
  • Nov 18 21:33
    scala-steward commented #147
  • Nov 18 21:33
    scala-steward opened #148
  • Nov 08 20:04
    scala-steward closed #146
  • Nov 08 20:04
    scala-steward commented #146
  • Nov 08 20:04
    scala-steward opened #147
  • Oct 21 20:35
    scala-steward closed #144
  • Oct 21 20:35
    scala-steward commented #144
  • Oct 21 20:35
    scala-steward opened #146
  • Sep 17 20:15
    scala-steward closed #142
  • Sep 17 20:15
    scala-steward commented #142
  • Sep 17 20:15
    scala-steward opened #145
  • Jul 14 00:00
    scala-steward closed #143
  • Jul 13 23:59
    scala-steward commented #143
  • Jul 13 23:59
    scala-steward opened #144
  • Jul 11 23:31
    scala-steward opened #143
  • Jul 11 23:31
    scala-steward opened #142
  • Feb 16 12:07

    nrinaudo on update-sbt-1.6.2

    (compare)

  • Feb 16 12:05

    nrinaudo on master

    Update sbt to 1.6.2 Merge pull request #141 from nr… (compare)

  • Feb 16 12:05
    nrinaudo closed #141
Rob Norris
@tpolecat
Hey just saw the reddit post. This looks great, congrats on the release!
We do a bunch of XML crap so I'll certainly be taking a look.
Nicolas Rinaudo
@nrinaudo
@tpolecat thanks!
it's the very first release, so it's still a bit rough with a few questionable design choices that I need to iron out, but I'm quite happy with the direction it's headed
Nicolas Rinaudo
@nrinaudo
@/all kantanx.path v0.1.1 is now available on maven central, with some serious improvements.
In particular, it's now possible to write this:
val input: File = ???

// First match
input.evalXPath[URI]("//a/@href")

// All matches
input.evalXPath[List[URI]]("//a/@href")
Nicolas Rinaudo
@nrinaudo
@/all version 0.1.2 now available on maven central. Mostly a bug fix release, thanks to feedback from @metasim
Nicolas Rinaudo
@nrinaudo
@/all publishing 0.1.8-SNAPSHOT as I type this. Most important improvements are:
  • Scala 2.12 support
  • Java 8 date / time support
  • update to whatever is the latest available version of each dependency
this is probably everything that'll go in 0.1.8 (except for documentation) so feedback would be appreciated
Nicolas Rinaudo
@nrinaudo
@/all official artifacts for 0.1.8 are now available on maven central.
Brandon Elam Barker
@bbarker
@nrinaudo I'm looking at Scala(-friendly) tools for transforming XSDs. For starters, I just want to be able to remove a list of xpaths from a document (in this case, those XPaths would just happen to be XPaths in an XSD). Is there an API to do this in Kantan? would it be reasonable to add something like "<users><user id='1'/><user id='2'/></users>".removeXPath(xp"//user/@id")? Related, I guess having an API for writing to an XML document would be good: val newDoc = "<users><user id='1'/><user id='2'/></users>".setXPath[Int](xp"//user/@id", 2), perhaps
Maybe that's out of scope for Kantan, but just wanted to check here first
Nicolas Rinaudo
@nrinaudo
I'm afraid it kind of is, kantan.xpath is really just about extracting data, not modifying it
Brandon Elam Barker
@bbarker
ok, thanks, I'll keep looking! Still will be nice to use to extract with useful types
Brandon Elam Barker
@bbarker
I wonder why scala.xml didn't use XPath natively ... seems a shame. I verified XPath is 4 years older than Scala ;)
I'll plan to implement a separate, small library that is Kantan-friendly
Nicolas Rinaudo
@nrinaudo
that sounds great, let me know if I can help!
I suppose that, if you're familiar with Java DOM, you could get some of your use cases to work. Do you know, for example, how to remove a set of Nodes from an existing Document?
because if so, you can absolutely execute an xpath query on a Document and get the result(s) as Nodes. If you know how to do the rest, you're set.
by the same token, if you know how to modify the content of a Node, you could get an xpath query running that'd return your target Node and update that
Nicolas Rinaudo
@nrinaudo
I'll be blunt though: I've no intention of wrapping Node, Document and co. in proper Scala types. If you want to implement your use cases within the scope of kantan.xpath, you'll have to deal with "low level" Java types :)
Brandon Elam Barker
@bbarker
@nrinaudo thanks - while I haven't done that before, I believe you've basically confirmed by plan based on what I have read earlier today
Nicolas Rinaudo
@nrinaudo
I'm not 100% sure it's possible - I haven't done Java in years, and still wake up in cold sweat from nightmares about java.xml.*
Brandon Elam Barker
@bbarker
oh thanks, I found another SO link with some suggestions along those lines, I think - https://stackoverflow.com/questions/6124239/how-to-update-xml-using-xpath-and-java - but haven't had a chance to go through it in detail yet
Nicolas Rinaudo
@nrinaudo
So looks like it should be possible, maybe even not too hard, although not necessarily straightforward. Let me know if you get stuck!
Brandon Elam Barker
@bbarker
ok, many thanks! I do not know if I'll be using Kantan at this stage as we're only going for removal of nodes right now, but late on we may plan to get more sophisticated and do updates as well, at which point I think Kantan XPath could be quite helpful
Nicolas Rinaudo
@nrinaudo
If you’re just doing removal, kantan.xpath is probably not terribly useful :)
Brandon Elam Barker
@bbarker
well, I have more XML projects that I would like to admit so there is a fair chance I will use it soon ... ( though I'm in the process of removing JAXB/XSD/XML from one Java project I converted to Scala ... nightmares indeed)
Nicolas Rinaudo
@nrinaudo
fair warning though: if you're trying to get rid of all the Java stuff in order to add support, among other things, to scala.js: kantan.xpath cannot support non-JVM backends, since it's basically a thin wrapper over java.xml.xpath