Skip to content
This repository

Changing labels with CssSelector #1236

Open
fanf opened this Issue March 08, 2012 · 0 comments

2 participants

Francois Armand David Pollak
Francois Armand
fanf commented March 08, 2012

This ticket follows the discussion on the mailing list about rewrapping Elem:
https://groups.google.com/d/topic/liftweb/uVW4xOPgnk8/discussion

For example:

    <people version="1" otherProp="prop">
      <name>foo</name>
      <friends><name>bar</name></name><name>baz</name></friends>
    </people>
Into:
    <user version="2" otherProp="prop">
      <login>foo</login>
      <knows><name>bar</name></name><name>baz</name></knows>
    </user>

Proposed solution:

"people" #> ((ns: NodeSeq) => <user version="2">{
  val kids = ns.asInstanceOf[Elem].child
  ("name" #> ((ns: NodeSeq) => <login>{ns.asInstanceOf[Elem].child}</login>)).apply(kids)
}</user>)

But should be simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.