LXML E builder for java?

Posted by directedition on Stack Overflow See other posts from Stack Overflow or by directedition
Published on 2010-03-26T13:52:04Z Indexed on 2010/03/26 13:53 UTC
Read the original article Hit count: 497

Filed under:
|
|

There is one thing I really love about LXML, and that the E builder. I love that I can throw XML together like this:

message = E.Person(
  E.Name(
    E.First("jack")
    E.Last("Ripper")
  )
  E.PhoneNumber("555-555-5555")
)

To make:

<Person>
  <Name>
    <First>Jack</First>
    <Last>Ripper</Last>
  </Name>
  <PhoneNumber>555-555-5555</PhoneNumber>
</Person>

As opposed to the painstaking way DOM works.

I am going to be moving a bunch of my software to Java soon and it is very very heavy on its usage of E. Does Java have anything near equivalent to that usage?

© Stack Overflow or respective owner

Related posts about lxml

Related posts about python