Hi,
I'm working with two xml-documents: a source-document and a work-document. Whenever a new node is added to the source it should be copied from the source to the workdocument. I wondered if this could be achieved at once, instead of creating each element at once.
Confused? Here's an example. I want to append The latest poll-element from the source (including all child-elements and data) to the polls-element of the work-dcoument.
I already have a objPollNode which contains the complete poll-element to be copied.
Source:
Work: (target-xml)
Gert
I'm working with two xml-documents: a source-document and a work-document. Whenever a new node is added to the source it should be copied from the source to the workdocument. I wondered if this could be achieved at once, instead of creating each element at once.
Confused? Here's an example. I want to append The latest poll-element from the source (including all child-elements and data) to the polls-element of the work-dcoument.
I already have a objPollNode which contains the complete poll-element to be copied.
Code:
' Transform SourceXML with strPollXSL to get the requested poll
strOutPutXML = objBronXML.TransformNode(objPollXSL)
objPollNode.LoadXML(strOutPutXML)
Code:
<?xml version="1.0" encoding="utf-8" ?>
<polls>
<poll id="tcm:17-74467" type="MultipleChoice" datestart="2005-10-27T15:04:00" dateend="2005-11-11T15:04:00">
<title>First Poll</title>
<question>This is the first poll</question>
<answer>True</answer>
<answer>False</answer>
<answer>I don't care</answer>
</poll>
'Red part should be copied. This is stored in strOutPutXML and objPollNode
[COLOR=red]
<poll id="tcm:17-74468" type="Open" datestart="2005-11-11T15:09:00" dateend="2005-11-18T15:10:00">
<title>New name intranet</title>
<question>Come up with a new name for our intranet.</question>
</poll>
[/color]
</polls>
Work: (target-xml)
Code:
<?xml version="1.0" encoding="utf-8" ?>
<polls>
<poll id="tcm:17-74467" type="MultipleChoice" datestart="2005-10-27T15:04:00" dateend="2005-11-11T15:04:00">
<title>First Poll</title>
<question>This is the first poll</question>
<answer>True</answer>
<answer>False</answer>
<answer>I don't care</answer>
</poll>
</polls>
Gert