Skip to content

Instantly share code, notes, and snippets.

@chris-twiner
chris-twiner / Indenting Serializer.scala
Created February 8, 2013 22:45
indenting serializer for Scales Xml
// other appropriate imports
sealed trait IndentState
/** The last event was an element */
case object LastElem extends IndentState
/** The last event was an item */
case object LastItem extends IndentState
/** The last was an end elem */
case object LastEndElem extends IndentState
/** First element*/
@chris-twiner
chris-twiner / gist:3240166
Created August 2, 2012 20:00
Selecting attributes in Scales
// http://stackoverflow.com/questions/11758607/selecting-a-xml-attribute
// See https://github.com/chris-twiner/scalesXml for details on how to use
// save this as loadme.scalaScript and use :load loadme.scalaScript in the repl
import scales.utils.top
import scales.xml._
import ScalesXml._
import Functions._
val reportxml = """<wrapper>
@chris-twiner
chris-twiner / Axe.scala
Created January 3, 2012 06:51
0.3 release notes examples
path.\.descendant_::.*(Elements.localName("DontRedeclare")).pos(1)
path.\\.*.\.preceding_sibling_::.*(2)
path.\\.ancestor_::.*