I have an XML document deserialized (an object contains the data). Now I am using an XSLT transformation file to create a new XML document.
transform(myXmlSourceObject, XSLT, output);
The variable output
is now a Stream, XmlWriter or a String. It contains the new xml structure defined by the XSLT.
But I want to replace output
with my desired target xml object, which i have already created/deserialized from the schema of the target xml. That means that I already have an objects that will be the target of the transformation. No new Stream, XmlWriter or String.
TargetXml alreadyCreatedTargetXmlObject = new TargetXml();
transform(myXmlSourceObject, XSLT, alreadyCreatedTargetXmlObject);
The point is that I want to fill the alreadyCreatedTargetXmlObject
with values from myXmlSourceObject
but also be able to do edit fields like the following
alreadyCreatedTargetXmlObject.name ="SomeNewName";
alreadyCreatedTargetXmlObject.location.x="50.78";
The new xml would be filled with data, and I want to edit values if I need to.