Build XML literal containing Anti-XML object

jay_dee

New Member
Suppose I have an Anti-XML object, e.g.:\[code\]import com.codecommit.antixml._val child = <child attr="val">...</child>.convert\[/code\]I want to construct an XML object that contains \[code\]child\[/code\] as a child:\[code\]<parent foo="bar"><foo/><child attr="val">...</child><foo/></parent>\[/code\]The obvious way would be\[code\]val parent : Elem = <parent foo="bar"><foo/>{ child }<foo/></parent>.convert\[/code\]The problem is that Scala's XML literals don't recognize Anti-XML's objects, so \[code\]child\[/code\] gets converted to a string, and embedded in \[code\]parent\[/code\] as a text node:\[code\]<parent foo="bar"><foo/><child attr="val">...</child><foo/></parent>\[/code\]How can I work around this issue?
 
Back
Top