I am trying to transform data into an existing document by locating
the inserting point i.e. the <CmdData> element. The Transformation
only wants to add child elements to the existing element.

The problem is, Xalan does not realize that a DOMResult already
has a root node and complains about multiple root nodes.

I have been able to work around this by forcing the Transformation
to duplicate the parent Element then just remove the redundant tag.
but I would rather not do the extra document editing if its not
necessary.

Example Document & Code below.

TIA
John G

Original Document
<CmdData>
</CmdData>

After Transformation
<CmdData>
  <CmdData>
        <InsertedData>Exists Here</Inserted Data>
    </CmdData>
</CmdData>

Code to perform the trasnformation

// Get the inserting point
Element response = ctx.getNewAppData();
DOMResult XMLOut = new DOMResult(response);

transformer =
CachedXSLTransformer.getTransformerFromResource(XSLResourceName, null);

transformer.transform(
  new DOMSource(cmdDoc),
   XMLOut);

// Edit out the rudundant tag
 ctx.setAppData( (Element) response.getFirstChild());



--
--------------------------------------
John Gentilin
Eye Catching Solutions Inc.
18314 Carlwyn Drive
Castro Valley CA 94546

    Contact Info
[EMAIL PROTECTED]
Ca Office 1-510-881-4821
NJ Office 1-732-422-4917



Reply via email to