Skip to content

Instantly share code, notes, and snippets.

@mdread
Created August 14, 2012 10:53
Show Gist options
  • Save mdread/3348152 to your computer and use it in GitHub Desktop.
Save mdread/3348152 to your computer and use it in GitHub Desktop.
Extract all non empty child text nodes
def extractNonEmptyTextChilds(n: Node): String = n map { e => e.child.filter({f => f.text.trim() != "" && f.label == "#PCDATA"}) text } mkString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment