Changing XML Namespace with Scala

Posted by toddk on Stack Overflow See other posts from Stack Overflow or by toddk
Published on 2009-07-07T20:12:13Z Indexed on 2010/03/28 0:03 UTC
Read the original article Hit count: 138

Filed under:
|

I am using scala to load a XML file from file via the scala.xml.XML.loadFile() method. The documents I'm working with have namespaces already defined and I wish to change the namespace to something else using scala. For example, a document has a xmlns of "http://foo.com/a" with a prefix of "a" - I would like to change the namespace and prefix for the document to "http://foo.com/b" and "b" respectively.

Seems easy and I feel like I'm missing something obvious here. I do not have a problem getting the namespace from the return Elem from the referenced loadFile() method.

© Stack Overflow or respective owner

Related posts about scala

Related posts about Xml