Merging XML Nodes into another document

  • (2 Pages)
  • +
  • 1
  • 2

23 Replies - 1768 Views - Last Post: 28 March 2012 - 12:37 PM Rate Topic: -----

#1 SPACEMTNMAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-June 09

Merging XML Nodes into another document

Posted 26 March 2012 - 04:12 PM

Hey. Basically im at university and we have a motion capture system. you know the sort. silly lycra suits with dots on them used to animate 3d characters for film etc. this system costs upwards of 70,000 and if you use a prop in your take it generates 2 files which you must edit manually which is a pain if you do it wrong.
Basically you copy across the contents of 2 nodes from one xml document into another 2 nodes in another xml document.

Here is the first document.
<?xml version="1.0" standalone="yes"?>
	<KinematicModel>
		<Parameters/>
		<Skeleton>
			<Segment NAME="Bat" POSITION="0 0 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-57.4309 -52.5871 -13.9333 37.5105 750.982 13.0406" RGB="0 147 0">
				<JointFree/>
			</Segment>
		</Skeleton>
		<MarkerSet NAME="">
			<Markers>
				<Marker NAME="Marker1" SEGMENT="Bat" POSITION="18.117 186.694 -8.67689" COVARIANCE="1 0 0 0 1 0 0 0 1" RADIUS="12.5"/>
				<Marker NAME="Marker2" SEGMENT="Bat" POSITION="56.4299 612.707 13.9333" COVARIANCE="1 0 0 0 1 0 0 0 1" RADIUS="12.5"/>
				<Marker NAME="Marker3" SEGMENT="Bat" POSITION="43.8768 290.93 -10.9203" COVARIANCE="1 0 0 0 1 0 0 0 1" RADIUS="12.5"/>
			</Markers>
			<Sticks/>
		</MarkerSet>
	</KinematicModel>


The lines i need are those in the Skeleton Node and those in the Marker Node


They then get placed in this document in their respective place.

<Parameter NAME="LRRShouldx" VALUE="-107.457"/>
	<Parameter NAME="LRRShouldy" VALUE="110.377"/>
	<Parameter NAME="LRRShouldz" VALUE="269.43"/>
	<Parameter NAME="RRRShouldx" VALUE="-106.951"/>
	<Parameter NAME="RRRShouldy" VALUE="-146.615"/>
	<Parameter NAME="RRRShouldz" VALUE="269.856"/>
</Parameters>
<Skeleton>
	<Segment NAME="pelvis" POSITION="0 0 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-150 -140 0 50 140 150" RGB="35 131 226">
		<JointFree/>
		
		<Segment NAME="lfemur" POSITION="0 InterHip 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-50 -50 -480 50 50 0" RGB="0 179 0">
			<JointBall MEAN="-0.0462098 -0.447751 0.148816 " EDIT_POSE_MEAN="0 0 0 " T-POSE="-0.0462098 -0.447751 0.148816 " COVARIANCE="0.00563535 -0.00210026 -0.000209084 -0.00210026 0.260337 0.00847206 -0.000209084 0.00847206 0.0154763 "/>
			<Segment NAME="ltibia" POSITION="0 0 -Thigh" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -440 40 40 0" RGB="0 179 0">
				<JointHinge AXIS="0 1 0" MEAN="0.415147 " EDIT_POSE_MEAN="0 " T-POSE="0.415147 " COVARIANCE="0.272968 "/>
				<Segment NAME="lfoot" POSITION="0 0 -Shin" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -80 140 40 0" RGB="0 179 0">
					<JointHardySpicer AXIS-PAIR="0 1 0 0.707107 0 0.707107" MEAN="0.736601 0.00161735 " EDIT_POSE_MEAN="0 0 " T-POSE="0.736601 0.00161735 " COVARIANCE="0.0206724 -0.0163615 -0.0163615 0.0199696 "/>
					<Segment NAME="ltoes" POSITION="Foot 0 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="0 -40 -40 110 40 20" RGB="0 179 0">
						<JointHinge AXIS="0 1 0" MEAN="-0.821573 " EDIT_POSE_MEAN="0 " T-POSE="-0.821573 " COVARIANCE="0.0338621 "/>
					</Segment>
				</Segment>
			</Segment>
		</Segment>
		<Segment NAME="rfemur" POSITION="0 -InterHip 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-50 -50 -480 50 50 0" RGB="196 0 0">
			<JointBall MEAN="-0.035327 -0.461919 -0.245581 " EDIT_POSE_MEAN="0 0 0 " T-POSE="-0.035327 -0.461919 -0.245581 " COVARIANCE="0.00686132 -0.00886747 0.000622034 -0.00886747 0.220192 -0.00636297 0.000622034 -0.00636297 0.0153943 "/>
			<Segment NAME="rtibia" POSITION="0 0 -Thigh" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -440 40 40 0" RGB="196 0 0">
				<JointHinge AXIS="0 1 0" MEAN="0.304268 " EDIT_POSE_MEAN="0 " T-POSE="0.304268 " COVARIANCE="0.21844 "/>
				<Segment NAME="rfoot" POSITION="0 0 -Shin" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -80 140 40 0" RGB="196 0 0">
					<JointHardySpicer AXIS-PAIR="0 1 0 0.707107 0 0.707107" MEAN="0.581628 0.199482 " EDIT_POSE_MEAN="0 0 " T-POSE="0.581628 0.199482 " COVARIANCE="0.0171678 0.009161 0.009161 0.0156533 "/>
					<Segment NAME="rtoes" POSITION="Foot 0 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="0 -40 -40 110 40 20" RGB="196 0 0">
						<JointHinge AXIS="0 1 0" MEAN="-0.5425 " EDIT_POSE_MEAN="0 " T-POSE="-0.5425 " COVARIANCE="0.0210634 "/>
					</Segment>
				</Segment>
			</Segment>
		</Segment>
		<Segment NAME="thorax" POSITION="-50 0 200" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-100 -120 0 100 120 300" RGB="56 142 142">
<JointFree MEAN="0.0512123 -0.144042 -0.0139732 -48.1824 -44.4694 57.0589 " EDIT_POSE_MEAN="0 0 0 0 0 0 " T-POSE="0.0512123 -0.144042 -0.0139732 -48.1824 -44.4694 57.0589 " COVARIANCE="0.0255769 0.00200864 -0.0134385 0.143194 -0.162107 0.441984 0.00200864 0.0306584 -0.0014935 0.212622 0.167062 -0.25818 -0.0134385 -0.0014935 0.0203031 -0.303675 -0.476786 -0.131608 0.143194 0.212622 -0.303675 76.7961 0.894043 8.36353 -0.162107 0.167062 -0.476786 0.894043 63.696 -3.75684 0.441984 -0.25818 -0.131608 8.36353 -3.75684 41.499 "/>
			<Segment NAME="head" POSITION="0 0 400" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-30 -70 0 160 70 100" RGB="35 131 226">
<JointFree MEAN="-0.015729 0.232986 0.0277277 62.408 -13.6164 53.1216 " EDIT_POSE_MEAN="0 0 0 0 0 0 " T-POSE="-0.015729 0.232986 0.0277277 62.408 -13.6164 53.1216 " COVARIANCE="0.00545828 -0.00416117 -0.000481721 -0.632205 -0.342355 0.122164 -0.00416117 0.0983675 -0.00552476 8.12023 0.398427 0.430825 -0.000481721 -0.00552476 0.0494819 -0.486882 0.72 0.0360938 -0.632205 8.12023 -0.486882 803.588 63.8138 13.4712 -0.342355 0.398427 0.72 63.8138 47.458 -6.15125 0.122164 0.430825 0.0360938 13.4712 -6.15125 47.9583 "/>
			</Segment>
			<Segment NAME="lclavicle" POSITION="0 0 ClavHeight" COVARIANCE="1 0 0 0 1 0 0 0 1" RGB="0 179 0">
				<JointHardySpicer AXIS-PAIR="1 0 0 0 0 1" MEAN="-0.318561 0.176532 " EDIT_POSE_MEAN="0 0 " T-POSE="-0.318561 0.176532 " COVARIANCE="0.0125457 0.00860102 0.00860102 0.0148687 "/>
				<Segment NAME="lhumerus" POSITION="0 Shoulder ShoulderHeight" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -320 40 40 40" RGB="0 179 0">
					<JointBall MEAN="0.708949 -0.43408 0.178098 " EDIT_POSE_MEAN="1.5708 0 0 " T-POSE="0.708949 -0.43408 0.178098 " COVARIANCE="0.0246865 -0.0131084 0.0196527 -0.0131084 0.35086 -0.112633 0.0196527 -0.112633 0.218799 "/>
					<Segment NAME="lradius" POSITION="0 0 -UpperArm" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-35 -35 -300 35 35 0" RGB="0 179 0">
						<JointHardySpicer AXIS-PAIR="0 1 0 0 0 1" MEAN="-0.850409 -0.960606 " EDIT_POSE_MEAN="-0.436332 0 " T-POSE="-0.850409 -0.960606 " COVARIANCE="0.169217 -0.0858704 -0.0858704 0.0841819 "/>
						<Segment NAME="lhand" POSITION="0 0 -LowerArm" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-35 -35 -100 35 35 0" RGB="0 179 0">
							<JointHardySpicer AXIS-PAIR="-1 0 0 0 1 0" MEAN="-0.244596 0.0500196 " EDIT_POSE_MEAN="0 0 " T-POSE="-0.244596 0.0500196 " COVARIANCE="0.0202133 -0.0104742 -0.0104742 0.018833 "/>
						</Segment>
					</Segment>
				</Segment>
			</Segment>
			<Segment NAME="rclavicle" POSITION="0 0 ClavHeight" COVARIANCE="1 0 0 0 1 0 0 0 1" RGB="196 0 0">
				<JointHardySpicer AXIS-PAIR="1 0 0 0 0 1" MEAN="0.614052 -0.0415201 " EDIT_POSE_MEAN="0 0 " T-POSE="0.614052 -0.0415201 " COVARIANCE="0.0053632 0.00263421 0.00263421 0.00573869 "/>
				<Segment NAME="rhumerus" POSITION="0 -Shoulder ShoulderHeight" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -320 40 40 40" RGB="196 0 0">
<JointBall MEAN="-1.20243 -0.367781 -0.133706 " EDIT_POSE_MEAN="-1.5708 0 0 " T-POSE="-1.20243 -0.367781 -0.133706 " COVARIANCE="0.052366 0.0313972 0.0243945 0.0313972 0.366707 -0.00206026 0.0243945 -0.00206026 0.112425 "/>
					<Segment NAME="rradius" POSITION="0 0 -UpperArm" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-35 -35 -300 35 35 0" RGB="196 0 0">
						<JointHardySpicer AXIS-PAIR="0 1 0 0 0 1" MEAN="-0.845482 1.09205 " EDIT_POSE_MEAN="-0.436332 0 " T-POSE="-0.845482 1.09205 " COVARIANCE="0.13195 0.0528064 0.0528064 0.0715383 "/>
						<Segment NAME="rhand" POSITION="0 0 -LowerArm" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-35 -35 -100 35 35 0" RGB="196 0 0">
							<JointHardySpicer AXIS-PAIR="-1 0 0 0 1 0" MEAN="0.142086 0.030327 " EDIT_POSE_MEAN="0 0 " T-POSE="0.142086 0.030327 " COVARIANCE="0.0229451 0.0120523 0.0120523 0.0440406 "/>
						</Segment>
					</Segment>
				</Segment>
			</Segment>
		</Segment>
	</Segment>
</Skeleton>
<MarkerSet NAME="Reatime Fullbody">
	<Markers>
		<Marker NAME="Root" SEGMENT="pelvis" RGB="249 255 0" POSITION="Rootx Rooty Rootz" COVARIANCE="10.9551 -12.6822 -8.13585 -12.6822 86.7342 64.773 -8.13585 64.773 116.507" RADIUS="12.5"/>
		<Marker NAME="LFWT" SEGMENT="pelvis" RGB="255 0 6" POSITION="FWTx LFWTy LFWTz" COVARIANCE="14.6449 4.66579 22.4046 4.66579 19.4308 18.3512 22.4046 18.3512 85.1099" RADIUS="12.5"/>
		<Marker NAME="RFWT" SEGMENT="pelvis" RGB="26 255 0" POSITION="FWTx RFWTy RFWTz" COVARIANCE="18.2216 2.31236 7.94849 2.31236 30.0655 4.38968 7.94849 4.38968 96.0093" RADIUS="12.5"/>
		<Marker NAME="LBWT" SEGMENT="pelvis" RGB="177 1 5" POSITION="LBWTx LBWTy LBWTz" COVARIANCE="13.4768 -2.33222 11.5906 -2.33222 28.6888 22.0307 11.5906 22.0307 122.698" RADIUS="12.5"/>
		<Marker NAME="RBWT" SEGMENT="pelvis" RGB="0 130 3" POSITION="RBWTx RBWTy RBWTz" COVARIANCE="9.68202 -2.57192 -9.06026 -2.57192 55.4261 40.9757 -9.06026 40.9757 132.829" RADIUS="12.5"/>
		<Marker NAME="LTHI" SEGMENT="lfemur" RGB="242 13 47" POSITION="LTHIx LTHIy LTHIz" COVARIANCE="40.0061 -12.7582 -1.15202 -12.7582 26.7969 7.09889 -1.15202 7.09889 119.967" RADIUS="12.5"/>
		<Marker NAME="LKNE" SEGMENT="lfemur" RGB="203 52 56" POSITION="LKNEx LKNEy -Thigh" COVARIANCE="74.09 -44.9074 16.6939 -44.9074 98.5609 -0.146064 16.6939 -0.146064 27.1433" RADIUS="12.5"/>
		<Marker NAME="LSHN" SEGMENT="ltibia" RGB="204 10 245" POSITION="LSHNx LSHNy LSHNz" COVARIANCE="11.5822 -15.4592 10.401 -15.4592 62.4833 -38.0062 10.401 -38.0062 40.3735" RADIUS="12.5"/>
		<Marker NAME="LANK" SEGMENT="ltibia" RGB="255 0 38" POSITION="LANKx 50 -Shin" COVARIANCE="31.0296 20.6189 -51.4968 20.6189 85.0296 -119.857 -51.4968 -119.857 213.499" RADIUS="12.5"/>
		<Marker NAME="LHEE" SEGMENT="lfoot" RGB="255 0 249" POSITION="LHEEx LHEEy LHEEz" COVARIANCE="40.6901 2.5611 -20.5308 2.5611 28.5395 17.8467 -20.5308 17.8467 238.863" RADIUS="12.5"/>
		<Marker NAME="LTOE" SEGMENT="ltoes" RGB="97 2 253" POSITION="LTOEx 0 0" COVARIANCE="37.7243 -4.40691 18.221 -4.40691 38.2987 -25.1711 18.221 -25.1711 40.374" RADIUS="12.5"/>
		<Marker NAME="LMT5" SEGMENT="lfoot" RGB="151 53 132" POSITION="Foot LMT5y 0" COVARIANCE="26.1216 40.4594 6.67782 40.4594 92.608 15.7656 6.67782 15.7656 13.0299" RADIUS="12.5"/>
		<Marker NAME="RTHI" SEGMENT="rfemur" RGB="27 228 41" POSITION="RTHIx RTHIy RTHIz" COVARIANCE="24.8928 -7.75808 -1.99034 -7.75808 30.9275 -7.83536 -1.99034 -7.83536 32.9314" RADIUS="12.5"/>
		<Marker NAME="RKNE" SEGMENT="rfemur" RGB="51 255 0" POSITION="RKNEx RKNEy -Thigh" COVARIANCE="37.2297 5.93497 -8.33939 5.93497 26.3448 11.1387 -8.33939 11.1387 64.5686" RADIUS="12.5"/>
		<Marker NAME="RSHN" SEGMENT="rtibia" RGB="55 146 200" POSITION="RSHNx RSHNy RSHNz" COVARIANCE="18.607 -17.3698 5.51375 -17.3698 35.3807 -13.0451 5.51375 -13.0451 20.4558" RADIUS="12.5"/>
		<Marker NAME="RANK" SEGMENT="rtibia" RGB="0 255 6" POSITION="RANKx -50 -Shin" COVARIANCE="6.9158 -0.23993 -12.885 -0.23993 23.6844 21.6007 -12.885 21.6007 91.5098" RADIUS="12.5"/>
		<Marker NAME="RHEE" SEGMENT="rfoot" RGB="215 24 231" POSITION="RHEEx RHEEy RHEEz" COVARIANCE="30.4107 -9.73712 -1.86489 -9.73712 11.1393 -1.90602 -1.86489 -1.90602 12.7444" RADIUS="12.5"/>
		<Marker NAME="RTOE" SEGMENT="rtoes" RGB="153 255 0" POSITION="RTOEx 0 0" COVARIANCE="45.3295 -8.00006 3.96552 -8.00006 11.5528 -3.82998 3.96552 -3.82998 12.6834" RADIUS="12.5"/>
		<Marker NAME="RMT5" SEGMENT="rfoot" RGB="53 202 180" POSITION="Foot RMT5y 0" COVARIANCE="8.78135 -6.65848 -2.41973 -6.65848 16.7713 7.33064 -2.41973 7.33064 62.4947" RADIUS="12.5"/>
		<Marker NAME="TopSpine" SEGMENT="thorax" RGB="0 255 223" POSITION="TopSpinex TopSpiney TopSpinez" COVARIANCE="21.4802 8.78808 -8.19042 8.78808 16.7018 -8.04379 -8.19042 -8.04379 7.18282" RADIUS="12.5"/>
		<Marker NAME="MidBack" SEGMENT="thorax" RGB="185 0 255" POSITION="MidBackx MidBacky MidBackz" COVARIANCE="25.4379 -12.3792 10.2156 -12.3792 14.9575 -0.665368 10.2156 -0.665368 26.1717" RADIUS="12.5"/>
		<Marker NAME="LowerBack" SEGMENT="pelvis" RGB="0 0 255" POSITION="LowerBackx LowerBacky LowerBackz" COVARIANCE="207.218 -90.7062 -33.5371 -90.7062 275.961 83.5164 -33.5371 83.5164 112.105" RADIUS="12.5"/>
		<Marker NAME="STRN" SEGMENT="thorax" RGB="112 74 181" POSITION="STRNx STRNy STRNz" COVARIANCE="25.9674 -2.56825 -3.71245 -2.56825 12.3623 -3.39196 -3.71245 -3.39196 11.6413" RADIUS="12.5"/>
		<Marker NAME="LFTShould" SEGMENT="lclavicle" RGB="204 0 255" POSITION="LFTShouldx LFTShouldy LFTShouldz" COVARIANCE="14.8368 -5.00371 8.63909 -5.00371 47.0056 7.43861 8.63909 7.43861 20.0694" RADIUS="12.5"/>
		<Marker NAME="RFTShould" SEGMENT="rclavicle" RGB="0 255 6" POSITION="RFTShouldx RFTShouldy RFTShouldz" COVARIANCE="32.7695 -12.5208 -8.73707 -12.5208 25.7519 14.1103 -8.73707 14.1103 19.2019" RADIUS="12.5"/>
		<Marker NAME="LRRShould" SEGMENT="thorax" RGB="45 0 255" POSITION="LRRShouldx LRRShouldy LRRShouldz" COVARIANCE="127.254 -0.481311 -4.56292 -0.481311 34.9257 30.273 -4.56292 30.273 48.2029" RADIUS="12.5"/>
		<Marker NAME="RRRShould" SEGMENT="thorax" RGB="235 254 1" POSITION="RRRShouldx RRRShouldy RRRShouldz" COVARIANCE="58.5142 40.6454 3.82895 40.6454 47.7285 -6.16238 3.82895 -6.16238 78.5148" RADIUS="12.5"/>
		<Marker NAME="LSHO" SEGMENT="lclavicle" RGB="29 4 251" POSITION="LSHOx LSHOy LSHOz" COVARIANCE="35.0632 -14.8752 -12.719 -14.8752 27.228 6.45345 -12.719 6.45345 49.2376" RADIUS="12.5"/>
		<Marker NAME="LUPA" SEGMENT="lhumerus" RGB="134 69 186" POSITION="LUPAx LUPAy LUPAz" COVARIANCE="63.7072 20.5617 -24.2892 20.5617 100.51 -9.36832 -24.2892 -9.36832 26.2503" RADIUS="12.5"/>
		<Marker NAME="LELB" SEGMENT="lhumerus" RGB="223 200 32" POSITION="0 50 -UpperArm" COVARIANCE="18.841 5.69848 2.56538 5.69848 71.4735 -4.52986 2.56538 -4.52986 56.0499" RADIUS="12.5"/>
		<Marker NAME="LFRM" SEGMENT="lradius" RGB="83 58 197" POSITION="LFRMx LFRMy LFRMz" COVARIANCE="32.6556 -0.963197 4.40577 -0.963197 16.1396 3.00224 4.40577 3.00224 33.5092" RADIUS="12.5"/>
		<Marker NAME="LWRA" SEGMENT="lradius" RGB="255 0 0" POSITION="LWRx 20 -LowerArm" COVARIANCE="28.014 -16.913 5.59978 -16.913 26.5689 2.0993 5.59978 2.0993 13.1843" RADIUS="12.5"/>
		<Marker NAME="LWRB" SEGMENT="lradius" RGB="255 179 0" POSITION="-LWRx 20 -LowerArm" COVARIANCE="23.6908 -9.09497 4.54717 -9.09497 38.788 -7.34901 4.54717 -7.34901 26.0113" RADIUS="12.5"/>
		<Marker NAME="LFIN" SEGMENT="lhand" RGB="236 0 255" POSITION="LFINx LFINy LFINz" COVARIANCE="3.18752 -0.793621 -0.227659 -0.793621 2.58479 -0.508247 -0.227659 -0.508247 3.24323" RADIUS="12.5"/>
		<Marker NAME="RSHO" SEGMENT="rclavicle" RGB="152 248 7" POSITION="RSHOx RSHOy RSHOz" COVARIANCE="97.554 26.4326 -13.2962 26.4326 61.357 16.6634 -13.2962 16.6634 42.8971" RADIUS="12.5"/>
		<Marker NAME="RUPA" SEGMENT="rhumerus" RGB="150 202 53" POSITION="RUPAx RUPAy RUPAz" COVARIANCE="194.192 -4.29466 2.41574 -4.29466 40.4717 20.0497 2.41574 20.0497 65.7346" RADIUS="12.5"/>
		<Marker NAME="RELB" SEGMENT="rhumerus" RGB="73 182 128" POSITION="0 -50 -UpperArm" COVARIANCE="51.2039 -31.1876 -21.4088 -31.1876 54.3318 19.6504 -21.4088 19.6504 44.751" RADIUS="12.5"/>
		<Marker NAME="RFRM" SEGMENT="rradius" RGB="188 67 188" POSITION="RFRMx RFRMy RFRMz" COVARIANCE="35.3008 6.07568 -2.73839 6.07568 14.8121 6.2171 -2.73839 6.2171 42.13" RADIUS="12.5"/>
		<Marker NAME="RWRA" SEGMENT="rradius" RGB="0 255 13" POSITION="RWRx -20 -LowerArm" COVARIANCE="22.4821 7.82535 -6.63687 7.82535 102.551 -40.8504 -6.63687 -40.8504 40.2845" RADIUS="12.5"/>
		<Marker NAME="RWRB" SEGMENT="rradius" RGB="122 92 163" POSITION="-RWRx -20 -LowerArm" COVARIANCE="33.245 -8.92505 4.39846 -8.92505 106.281 -16.588 4.39846 -16.588 37.7348" RADIUS="12.5"/>
		<Marker NAME="RFIN" SEGMENT="rhand" RGB="242 255 0" POSITION="RFINx RFINy RFINz" COVARIANCE="2.66319 0.219051 0.174234 0.219051 7.01277 -1.17994 0.174234 -1.17994 2.33633" RADIUS="12.5"/>
		<Marker NAME="LFHD" SEGMENT="head" RGB="255 0 0" POSITION="LFHDx LFHDy LFHDz" COVARIANCE="0.83465 -0.45682 0.176131 -0.45682 8.02147 3.2843 0.176131 3.2843 3.15943" RADIUS="12.5"/>
		<Marker NAME="RFHD" SEGMENT="head" RGB="6 255 0" POSITION="RFHDx RFHDy RFHDz" COVARIANCE="3.12615 -4.54605 -2.9923 -4.54605 17.2838 11.1793 -2.9923 11.1793 12.3543" RADIUS="12.5"/>
		<Marker NAME="LBHD" SEGMENT="head" RGB="119 0 0" POSITION="LBHDx LBHDy LBHDz" COVARIANCE="1.0479 0.955148 0.40817 0.955148 9.87296 3.48312 0.40817 3.48312 3.08122" RADIUS="12.5"/>
		<Marker NAME="RBHD" SEGMENT="head" RGB="1 150 9" POSITION="RBHDx RBHDy RBHDz" COVARIANCE="2.44804 -1.85154 -1.0533 -1.85154 19.7177 12.6607 -1.0533 12.6607 12.6128" RADIUS="12.5"/>
		

	</Markers>
	<Sticks>
		<Stick MARKER1="LFHD" MARKER2="LBHD" RGB="255 0 0"/>
		<Stick MARKER1="RFHD" MARKER2="RBHD" RGB="0 255 0"/>
		<Stick MARKER1="LFHD" MARKER2="RFHD" RGB="56 142 142"/>
		<Stick MARKER1="LBHD" MARKER2="RBHD" RGB="56 142 142"/>
		<Stick MARKER1="LFHD" MARKER2="RBHD" RGB="56 142 142"/>
		<Stick MARKER1="LBHD" MARKER2="RFHD" RGB="56 142 142"/>



What i would like to know is how exactly would i do this? ive attempted many different ways but i havent used vb in such a long time and im struggling.
I would like to read each of the sections i need into richtext boxes for display and error checking and also load each document into separate rich text boxes as well as give some form of validation/confirmation that the merge worked.

Can anyone Help?

Regards
Jack

Is This A Good Question/Topic? 0
  • +

Replies To: Merging XML Nodes into another document

#2 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,414
  • Joined: 29-May 08

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 04:35 PM

Since vb.net 2008 it has had the ability to understand XML natively, with the inclusion of XML Literals.
That combined with LINQ to XML is, if thee most envied language feature of vb.net


Module Module1



  Sub Main()
    Dim x1 = <?xml version="1.0" standalone="yes"?>
             <KinematicModel>
               <Parameters/>
               <Skeleton>
                 <Segment NAME="Bat" POSITION="0 0 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-57.4309 -52.5871 -13.9333 37.5105 750.982 13.0406" RGB="0 147 0">
                   <JointFree/>
                 </Segment>
               </Skeleton>
               <MarkerSet NAME="">
                 <Markers>
                   <Marker NAME="Marker1" SEGMENT="Bat" POSITION="18.117 186.694 -8.67689" COVARIANCE="1 0 0 0 1 0 0 0 1" RADIUS="12.5"/>
                   <Marker NAME="Marker2" SEGMENT="Bat" POSITION="56.4299 612.707 13.9333" COVARIANCE="1 0 0 0 1 0 0 0 1" RADIUS="12.5"/>
                   <Marker NAME="Marker3" SEGMENT="Bat" POSITION="43.8768 290.93 -10.9203" COVARIANCE="1 0 0 0 1 0 0 0 1" RADIUS="12.5"/>
                 </Markers>
                 <Sticks/>
               </MarkerSet>
             </KinematicModel>


    Dim x2 = <?xml version="1.0" standalone="yes"?>
             <KinematicModel>
               <Parameters>
                 <Parameter NAME="LRRShouldx" VALUE="-107.457"/>
                 <Parameter NAME="LRRShouldy" VALUE="110.377"/>
                 <Parameter NAME="LRRShouldz" VALUE="269.43"/>
                 <Parameter NAME="RRRShouldx" VALUE="-106.951"/>
                 <Parameter NAME="RRRShouldy" VALUE="-146.615"/>
                 <Parameter NAME="RRRShouldz" VALUE="269.856"/>
               </Parameters>
               <Skeleton>
                 <Segment NAME="pelvis" POSITION="0 0 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-150 -140 0 50 140 150" RGB="35 131 226">
                   <JointFree/>
                   <Segment NAME="lfemur" POSITION="0 InterHip 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-50 -50 -480 50 50 0" RGB="0 179 0">
                     <JointBall MEAN="-0.0462098 -0.447751 0.148816 " EDIT_POSE_MEAN="0 0 0 " T-POSE="-0.0462098 -0.447751 0.148816 " COVARIANCE="0.00563535 -0.00210026 -0.000209084 -0.00210026 0.260337 0.00847206 -0.000209084 0.00847206 0.0154763 "/>
                     <Segment NAME="ltibia" POSITION="0 0 -Thigh" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -440 40 40 0" RGB="0 179 0">
                       <JointHinge AXIS="0 1 0" MEAN="0.415147 " EDIT_POSE_MEAN="0 " T-POSE="0.415147 " COVARIANCE="0.272968 "/>
                       <Segment NAME="lfoot" POSITION="0 0 -Shin" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -80 140 40 0" RGB="0 179 0">
                         <JointHardySpicer AXIS-PAIR="0 1 0 0.707107 0 0.707107" MEAN="0.736601 0.00161735 " EDIT_POSE_MEAN="0 0 " T-POSE="0.736601 0.00161735 " COVARIANCE="0.0206724 -0.0163615 -0.0163615 0.0199696 "/>
                         <Segment NAME="ltoes" POSITION="Foot 0 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="0 -40 -40 110 40 20" RGB="0 179 0">
                           <JointHinge AXIS="0 1 0" MEAN="-0.821573 " EDIT_POSE_MEAN="0 " T-POSE="-0.821573 " COVARIANCE="0.0338621 "/>
                         </Segment>
                       </Segment>
                     </Segment>
                   </Segment>
                   <Segment NAME="rfemur" POSITION="0 -InterHip 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-50 -50 -480 50 50 0" RGB="196 0 0">
                     <JointBall MEAN="-0.035327 -0.461919 -0.245581 " EDIT_POSE_MEAN="0 0 0 " T-POSE="-0.035327 -0.461919 -0.245581 " COVARIANCE="0.00686132 -0.00886747 0.000622034 -0.00886747 0.220192 -0.00636297 0.000622034 -0.00636297 0.0153943 "/>
                     <Segment NAME="rtibia" POSITION="0 0 -Thigh" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -440 40 40 0" RGB="196 0 0">
                       <JointHinge AXIS="0 1 0" MEAN="0.304268 " EDIT_POSE_MEAN="0 " T-POSE="0.304268 " COVARIANCE="0.21844 "/>
                       <Segment NAME="rfoot" POSITION="0 0 -Shin" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -80 140 40 0" RGB="196 0 0">
                         <JointHardySpicer AXIS-PAIR="0 1 0 0.707107 0 0.707107" MEAN="0.581628 0.199482 " EDIT_POSE_MEAN="0 0 " T-POSE="0.581628 0.199482 " COVARIANCE="0.0171678 0.009161 0.009161 0.0156533 "/>
                         <Segment NAME="rtoes" POSITION="Foot 0 0" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="0 -40 -40 110 40 20" RGB="196 0 0">
                           <JointHinge AXIS="0 1 0" MEAN="-0.5425 " EDIT_POSE_MEAN="0 " T-POSE="-0.5425 " COVARIANCE="0.0210634 "/>
                         </Segment>
                       </Segment>
                     </Segment>
                   </Segment>
                   <Segment NAME="thorax" POSITION="-50 0 200" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-100 -120 0 100 120 300" RGB="56 142 142">
                     <JointFree MEAN="0.0512123 -0.144042 -0.0139732 -48.1824 -44.4694 57.0589 " EDIT_POSE_MEAN="0 0 0 0 0 0 " T-POSE="0.0512123 -0.144042 -0.0139732 -48.1824 -44.4694 57.0589 " COVARIANCE="0.0255769 0.00200864 -0.0134385 0.143194 -0.162107 0.441984 0.00200864 0.0306584 -0.0014935 0.212622 0.167062 -0.25818 -0.0134385 -0.0014935 0.0203031 -0.303675 -0.476786 -0.131608 0.143194 0.212622 -0.303675 76.7961 0.894043 8.36353 -0.162107 0.167062 -0.476786 0.894043 63.696 -3.75684 0.441984 -0.25818 -0.131608 8.36353 -3.75684 41.499 "/>
                     <Segment NAME="head" POSITION="0 0 400" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-30 -70 0 160 70 100" RGB="35 131 226">
                       <JointFree MEAN="-0.015729 0.232986 0.0277277 62.408 -13.6164 53.1216 " EDIT_POSE_MEAN="0 0 0 0 0 0 " T-POSE="-0.015729 0.232986 0.0277277 62.408 -13.6164 53.1216 " COVARIANCE="0.00545828 -0.00416117 -0.000481721 -0.632205 -0.342355 0.122164 -0.00416117 0.0983675 -0.00552476 8.12023 0.398427 0.430825 -0.000481721 -0.00552476 0.0494819 -0.486882 0.72 0.0360938 -0.632205 8.12023 -0.486882 803.588 63.8138 13.4712 -0.342355 0.398427 0.72 63.8138 47.458 -6.15125 0.122164 0.430825 0.0360938 13.4712 -6.15125 47.9583 "/>
                     </Segment>
                     <Segment NAME="lclavicle" POSITION="0 0 ClavHeight" COVARIANCE="1 0 0 0 1 0 0 0 1" RGB="0 179 0">
                       <JointHardySpicer AXIS-PAIR="1 0 0 0 0 1" MEAN="-0.318561 0.176532 " EDIT_POSE_MEAN="0 0 " T-POSE="-0.318561 0.176532 " COVARIANCE="0.0125457 0.00860102 0.00860102 0.0148687 "/>
                       <Segment NAME="lhumerus" POSITION="0 Shoulder ShoulderHeight" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -320 40 40 40" RGB="0 179 0">
                         <JointBall MEAN="0.708949 -0.43408 0.178098 " EDIT_POSE_MEAN="1.5708 0 0 " T-POSE="0.708949 -0.43408 0.178098 " COVARIANCE="0.0246865 -0.0131084 0.0196527 -0.0131084 0.35086 -0.112633 0.0196527 -0.112633 0.218799 "/>
                         <Segment NAME="lradius" POSITION="0 0 -UpperArm" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-35 -35 -300 35 35 0" RGB="0 179 0">
                           <JointHardySpicer AXIS-PAIR="0 1 0 0 0 1" MEAN="-0.850409 -0.960606 " EDIT_POSE_MEAN="-0.436332 0 " T-POSE="-0.850409 -0.960606 " COVARIANCE="0.169217 -0.0858704 -0.0858704 0.0841819 "/>
                           <Segment NAME="lhand" POSITION="0 0 -LowerArm" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-35 -35 -100 35 35 0" RGB="0 179 0">
                             <JointHardySpicer AXIS-PAIR="-1 0 0 0 1 0" MEAN="-0.244596 0.0500196 " EDIT_POSE_MEAN="0 0 " T-POSE="-0.244596 0.0500196 " COVARIANCE="0.0202133 -0.0104742 -0.0104742 0.018833 "/>
                           </Segment>
                         </Segment>
                       </Segment>
                     </Segment>
                     <Segment NAME="rclavicle" POSITION="0 0 ClavHeight" COVARIANCE="1 0 0 0 1 0 0 0 1" RGB="196 0 0">
                       <JointHardySpicer AXIS-PAIR="1 0 0 0 0 1" MEAN="0.614052 -0.0415201 " EDIT_POSE_MEAN="0 0 " T-POSE="0.614052 -0.0415201 " COVARIANCE="0.0053632 0.00263421 0.00263421 0.00573869 "/>
                       <Segment NAME="rhumerus" POSITION="0 -Shoulder ShoulderHeight" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-40 -40 -320 40 40 40" RGB="196 0 0">
                         <JointBall MEAN="-1.20243 -0.367781 -0.133706 " EDIT_POSE_MEAN="-1.5708 0 0 " T-POSE="-1.20243 -0.367781 -0.133706 " COVARIANCE="0.052366 0.0313972 0.0243945 0.0313972 0.366707 -0.00206026 0.0243945 -0.00206026 0.112425 "/>
                         <Segment NAME="rradius" POSITION="0 0 -UpperArm" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-35 -35 -300 35 35 0" RGB="196 0 0">
                           <JointHardySpicer AXIS-PAIR="0 1 0 0 0 1" MEAN="-0.845482 1.09205 " EDIT_POSE_MEAN="-0.436332 0 " T-POSE="-0.845482 1.09205 " COVARIANCE="0.13195 0.0528064 0.0528064 0.0715383 "/>
                           <Segment NAME="rhand" POSITION="0 0 -LowerArm" COVARIANCE="1 0 0 0 1 0 0 0 1" BOUNDS="-35 -35 -100 35 35 0" RGB="196 0 0">
                             <JointHardySpicer AXIS-PAIR="-1 0 0 0 1 0" MEAN="0.142086 0.030327 " EDIT_POSE_MEAN="0 0 " T-POSE="0.142086 0.030327 " COVARIANCE="0.0229451 0.0120523 0.0120523 0.0440406 "/>
                           </Segment>
                         </Segment>
                       </Segment>
                     </Segment>
                   </Segment>
                 </Segment>
               </Skeleton>
               <MarkerSet NAME="Reatime Fullbody">
                 <Markers>
                   <Marker NAME="Root" SEGMENT="pelvis" RGB="249 255 0" POSITION="Rootx Rooty Rootz" COVARIANCE="10.9551 -12.6822 -8.13585 -12.6822 86.7342 64.773 -8.13585 64.773 116.507" RADIUS="12.5"/>
                   <Marker NAME="LFWT" SEGMENT="pelvis" RGB="255 0 6" POSITION="FWTx LFWTy LFWTz" COVARIANCE="14.6449 4.66579 22.4046 4.66579 19.4308 18.3512 22.4046 18.3512 85.1099" RADIUS="12.5"/>
                   <Marker NAME="RFWT" SEGMENT="pelvis" RGB="26 255 0" POSITION="FWTx RFWTy RFWTz" COVARIANCE="18.2216 2.31236 7.94849 2.31236 30.0655 4.38968 7.94849 4.38968 96.0093" RADIUS="12.5"/>
                   <Marker NAME="LBWT" SEGMENT="pelvis" RGB="177 1 5" POSITION="LBWTx LBWTy LBWTz" COVARIANCE="13.4768 -2.33222 11.5906 -2.33222 28.6888 22.0307 11.5906 22.0307 122.698" RADIUS="12.5"/>
                   <Marker NAME="RBWT" SEGMENT="pelvis" RGB="0 130 3" POSITION="RBWTx RBWTy RBWTz" COVARIANCE="9.68202 -2.57192 -9.06026 -2.57192 55.4261 40.9757 -9.06026 40.9757 132.829" RADIUS="12.5"/>
                   <Marker NAME="LTHI" SEGMENT="lfemur" RGB="242 13 47" POSITION="LTHIx LTHIy LTHIz" COVARIANCE="40.0061 -12.7582 -1.15202 -12.7582 26.7969 7.09889 -1.15202 7.09889 119.967" RADIUS="12.5"/>
                   <Marker NAME="LKNE" SEGMENT="lfemur" RGB="203 52 56" POSITION="LKNEx LKNEy -Thigh" COVARIANCE="74.09 -44.9074 16.6939 -44.9074 98.5609 -0.146064 16.6939 -0.146064 27.1433" RADIUS="12.5"/>
                   <Marker NAME="LSHN" SEGMENT="ltibia" RGB="204 10 245" POSITION="LSHNx LSHNy LSHNz" COVARIANCE="11.5822 -15.4592 10.401 -15.4592 62.4833 -38.0062 10.401 -38.0062 40.3735" RADIUS="12.5"/>
                   <Marker NAME="LANK" SEGMENT="ltibia" RGB="255 0 38" POSITION="LANKx 50 -Shin" COVARIANCE="31.0296 20.6189 -51.4968 20.6189 85.0296 -119.857 -51.4968 -119.857 213.499" RADIUS="12.5"/>
                   <Marker NAME="LHEE" SEGMENT="lfoot" RGB="255 0 249" POSITION="LHEEx LHEEy LHEEz" COVARIANCE="40.6901 2.5611 -20.5308 2.5611 28.5395 17.8467 -20.5308 17.8467 238.863" RADIUS="12.5"/>
                   <Marker NAME="LTOE" SEGMENT="ltoes" RGB="97 2 253" POSITION="LTOEx 0 0" COVARIANCE="37.7243 -4.40691 18.221 -4.40691 38.2987 -25.1711 18.221 -25.1711 40.374" RADIUS="12.5"/>
                   <Marker NAME="LMT5" SEGMENT="lfoot" RGB="151 53 132" POSITION="Foot LMT5y 0" COVARIANCE="26.1216 40.4594 6.67782 40.4594 92.608 15.7656 6.67782 15.7656 13.0299" RADIUS="12.5"/>
                   <Marker NAME="RTHI" SEGMENT="rfemur" RGB="27 228 41" POSITION="RTHIx RTHIy RTHIz" COVARIANCE="24.8928 -7.75808 -1.99034 -7.75808 30.9275 -7.83536 -1.99034 -7.83536 32.9314" RADIUS="12.5"/>
                   <Marker NAME="RKNE" SEGMENT="rfemur" RGB="51 255 0" POSITION="RKNEx RKNEy -Thigh" COVARIANCE="37.2297 5.93497 -8.33939 5.93497 26.3448 11.1387 -8.33939 11.1387 64.5686" RADIUS="12.5"/>
                   <Marker NAME="RSHN" SEGMENT="rtibia" RGB="55 146 200" POSITION="RSHNx RSHNy RSHNz" COVARIANCE="18.607 -17.3698 5.51375 -17.3698 35.3807 -13.0451 5.51375 -13.0451 20.4558" RADIUS="12.5"/>
                   <Marker NAME="RANK" SEGMENT="rtibia" RGB="0 255 6" POSITION="RANKx -50 -Shin" COVARIANCE="6.9158 -0.23993 -12.885 -0.23993 23.6844 21.6007 -12.885 21.6007 91.5098" RADIUS="12.5"/>
                   <Marker NAME="RHEE" SEGMENT="rfoot" RGB="215 24 231" POSITION="RHEEx RHEEy RHEEz" COVARIANCE="30.4107 -9.73712 -1.86489 -9.73712 11.1393 -1.90602 -1.86489 -1.90602 12.7444" RADIUS="12.5"/>
                   <Marker NAME="RTOE" SEGMENT="rtoes" RGB="153 255 0" POSITION="RTOEx 0 0" COVARIANCE="45.3295 -8.00006 3.96552 -8.00006 11.5528 -3.82998 3.96552 -3.82998 12.6834" RADIUS="12.5"/>
                   <Marker NAME="RMT5" SEGMENT="rfoot" RGB="53 202 180" POSITION="Foot RMT5y 0" COVARIANCE="8.78135 -6.65848 -2.41973 -6.65848 16.7713 7.33064 -2.41973 7.33064 62.4947" RADIUS="12.5"/>
                   <Marker NAME="TopSpine" SEGMENT="thorax" RGB="0 255 223" POSITION="TopSpinex TopSpiney TopSpinez" COVARIANCE="21.4802 8.78808 -8.19042 8.78808 16.7018 -8.04379 -8.19042 -8.04379 7.18282" RADIUS="12.5"/>
                   <Marker NAME="MidBack" SEGMENT="thorax" RGB="185 0 255" POSITION="MidBackx MidBacky MidBackz" COVARIANCE="25.4379 -12.3792 10.2156 -12.3792 14.9575 -0.665368 10.2156 -0.665368 26.1717" RADIUS="12.5"/>
                   <Marker NAME="LowerBack" SEGMENT="pelvis" RGB="0 0 255" POSITION="LowerBackx LowerBacky LowerBackz" COVARIANCE="207.218 -90.7062 -33.5371 -90.7062 275.961 83.5164 -33.5371 83.5164 112.105" RADIUS="12.5"/>
                   <Marker NAME="STRN" SEGMENT="thorax" RGB="112 74 181" POSITION="STRNx STRNy STRNz" COVARIANCE="25.9674 -2.56825 -3.71245 -2.56825 12.3623 -3.39196 -3.71245 -3.39196 11.6413" RADIUS="12.5"/>
                   <Marker NAME="LFTShould" SEGMENT="lclavicle" RGB="204 0 255" POSITION="LFTShouldx LFTShouldy LFTShouldz" COVARIANCE="14.8368 -5.00371 8.63909 -5.00371 47.0056 7.43861 8.63909 7.43861 20.0694" RADIUS="12.5"/>
                   <Marker NAME="RFTShould" SEGMENT="rclavicle" RGB="0 255 6" POSITION="RFTShouldx RFTShouldy RFTShouldz" COVARIANCE="32.7695 -12.5208 -8.73707 -12.5208 25.7519 14.1103 -8.73707 14.1103 19.2019" RADIUS="12.5"/>
                   <Marker NAME="LRRShould" SEGMENT="thorax" RGB="45 0 255" POSITION="LRRShouldx LRRShouldy LRRShouldz" COVARIANCE="127.254 -0.481311 -4.56292 -0.481311 34.9257 30.273 -4.56292 30.273 48.2029" RADIUS="12.5"/>
                   <Marker NAME="RRRShould" SEGMENT="thorax" RGB="235 254 1" POSITION="RRRShouldx RRRShouldy RRRShouldz" COVARIANCE="58.5142 40.6454 3.82895 40.6454 47.7285 -6.16238 3.82895 -6.16238 78.5148" RADIUS="12.5"/>
                   <Marker NAME="LSHO" SEGMENT="lclavicle" RGB="29 4 251" POSITION="LSHOx LSHOy LSHOz" COVARIANCE="35.0632 -14.8752 -12.719 -14.8752 27.228 6.45345 -12.719 6.45345 49.2376" RADIUS="12.5"/>
                   <Marker NAME="LUPA" SEGMENT="lhumerus" RGB="134 69 186" POSITION="LUPAx LUPAy LUPAz" COVARIANCE="63.7072 20.5617 -24.2892 20.5617 100.51 -9.36832 -24.2892 -9.36832 26.2503" RADIUS="12.5"/>
                   <Marker NAME="LELB" SEGMENT="lhumerus" RGB="223 200 32" POSITION="0 50 -UpperArm" COVARIANCE="18.841 5.69848 2.56538 5.69848 71.4735 -4.52986 2.56538 -4.52986 56.0499" RADIUS="12.5"/>
                   <Marker NAME="LFRM" SEGMENT="lradius" RGB="83 58 197" POSITION="LFRMx LFRMy LFRMz" COVARIANCE="32.6556 -0.963197 4.40577 -0.963197 16.1396 3.00224 4.40577 3.00224 33.5092" RADIUS="12.5"/>
                   <Marker NAME="LWRA" SEGMENT="lradius" RGB="255 0 0" POSITION="LWRx 20 -LowerArm" COVARIANCE="28.014 -16.913 5.59978 -16.913 26.5689 2.0993 5.59978 2.0993 13.1843" RADIUS="12.5"/>
                   <Marker NAME="LWRB" SEGMENT="lradius" RGB="255 179 0" POSITION="-LWRx 20 -LowerArm" COVARIANCE="23.6908 -9.09497 4.54717 -9.09497 38.788 -7.34901 4.54717 -7.34901 26.0113" RADIUS="12.5"/>
                   <Marker NAME="LFIN" SEGMENT="lhand" RGB="236 0 255" POSITION="LFINx LFINy LFINz" COVARIANCE="3.18752 -0.793621 -0.227659 -0.793621 2.58479 -0.508247 -0.227659 -0.508247 3.24323" RADIUS="12.5"/>
                   <Marker NAME="RSHO" SEGMENT="rclavicle" RGB="152 248 7" POSITION="RSHOx RSHOy RSHOz" COVARIANCE="97.554 26.4326 -13.2962 26.4326 61.357 16.6634 -13.2962 16.6634 42.8971" RADIUS="12.5"/>
                   <Marker NAME="RUPA" SEGMENT="rhumerus" RGB="150 202 53" POSITION="RUPAx RUPAy RUPAz" COVARIANCE="194.192 -4.29466 2.41574 -4.29466 40.4717 20.0497 2.41574 20.0497 65.7346" RADIUS="12.5"/>
                   <Marker NAME="RELB" SEGMENT="rhumerus" RGB="73 182 128" POSITION="0 -50 -UpperArm" COVARIANCE="51.2039 -31.1876 -21.4088 -31.1876 54.3318 19.6504 -21.4088 19.6504 44.751" RADIUS="12.5"/>
                   <Marker NAME="RFRM" SEGMENT="rradius" RGB="188 67 188" POSITION="RFRMx RFRMy RFRMz" COVARIANCE="35.3008 6.07568 -2.73839 6.07568 14.8121 6.2171 -2.73839 6.2171 42.13" RADIUS="12.5"/>
                   <Marker NAME="RWRA" SEGMENT="rradius" RGB="0 255 13" POSITION="RWRx -20 -LowerArm" COVARIANCE="22.4821 7.82535 -6.63687 7.82535 102.551 -40.8504 -6.63687 -40.8504 40.2845" RADIUS="12.5"/>
                   <Marker NAME="RWRB" SEGMENT="rradius" RGB="122 92 163" POSITION="-RWRx -20 -LowerArm" COVARIANCE="33.245 -8.92505 4.39846 -8.92505 106.281 -16.588 4.39846 -16.588 37.7348" RADIUS="12.5"/>
                   <Marker NAME="RFIN" SEGMENT="rhand" RGB="242 255 0" POSITION="RFINx RFINy RFINz" COVARIANCE="2.66319 0.219051 0.174234 0.219051 7.01277 -1.17994 0.174234 -1.17994 2.33633" RADIUS="12.5"/>
                   <Marker NAME="LFHD" SEGMENT="head" RGB="255 0 0" POSITION="LFHDx LFHDy LFHDz" COVARIANCE="0.83465 -0.45682 0.176131 -0.45682 8.02147 3.2843 0.176131 3.2843 3.15943" RADIUS="12.5"/>
                   <Marker NAME="RFHD" SEGMENT="head" RGB="6 255 0" POSITION="RFHDx RFHDy RFHDz" COVARIANCE="3.12615 -4.54605 -2.9923 -4.54605 17.2838 11.1793 -2.9923 11.1793 12.3543" RADIUS="12.5"/>
                   <Marker NAME="LBHD" SEGMENT="head" RGB="119 0 0" POSITION="LBHDx LBHDy LBHDz" COVARIANCE="1.0479 0.955148 0.40817 0.955148 9.87296 3.48312 0.40817 3.48312 3.08122" RADIUS="12.5"/>
                   <Marker NAME="RBHD" SEGMENT="head" RGB="1 150 9" POSITION="RBHDx RBHDy RBHDz" COVARIANCE="2.44804 -1.85154 -1.0533 -1.85154 19.7177 12.6607 -1.0533 12.6607 12.6128" RADIUS="12.5"/>
                 </Markers>
                 <Sticks>
                   <Stick MARKER1="LFHD" MARKER2="LBHD" RGB="255 0 0"/>
                   <Stick MARKER1="RFHD" MARKER2="RBHD" RGB="0 255 0"/>
                   <Stick MARKER1="LFHD" MARKER2="RFHD" RGB="56 142 142"/>
                   <Stick MARKER1="LBHD" MARKER2="RBHD" RGB="56 142 142"/>
                   <Stick MARKER1="LFHD" MARKER2="RBHD" RGB="56 142 142"/>
                   <Stick MARKER1="LBHD" MARKER2="RFHD" RGB="56 142 142"/>
                 </Sticks>
               </MarkerSet>
             </KinematicModel>


I've embedded the XML directly but it can be loaded in from a file.

Then is really simple to query.
    Dim segs = x1.<KinematicModel>.<Skeleton>.<Segment>
    Dim markers = x1.<KinematicModel>.<MarkerSet>.<Markers>.<Marker>


Replace nodes.
    x2.<KinematicModel>.<MarkerSet>.First.ReplaceAll(markers)

  End Sub

End Module




If you also add or generate the schema for the XML, you'll also get Intellisense support.

This post has been edited by AdamSpeight2008: 26 March 2012 - 04:50 PM

Was This Post Helpful? 1
  • +
  • -

#3 SPACEMTNMAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-June 09

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 04:42 PM

View PostAdamSpeight2008, on 26 March 2012 - 05:35 PM, said:

Since vb.net 2008 it has had the ability to understand XML natively, with the inclusion of XML Literals.
That combined with LINQ to XML is, if thee most envied language feature of vb.net



Hey,
Ive attempted a good few snippets trying to get the code from a specific child node using the xml and Linq classes but so far ive had no luck with them.
Ive only really done a few database management systems in vb.net before so alot of the coding syntax is new to me.
Ill take a look at those literals and see how it goes thanks :)

Jack
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,414
  • Joined: 29-May 08

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 04:49 PM

I've updated the previous post.

Remember that they return an IEnumerable so it could be empty.
Was This Post Helpful? 0
  • +
  • -

#5 SPACEMTNMAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-June 09

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 05:01 PM

View PostSPACEMTNMAN, on 26 March 2012 - 05:42 PM, said:

View PostAdamSpeight2008, on 26 March 2012 - 05:35 PM, said:

Since vb.net 2008 it has had the ability to understand XML natively, with the inclusion of XML Literals.
That combined with LINQ to XML is, if thee most envied language feature of vb.net



Hey,
Ive attempted a good few snippets trying to get the code from a specific child node using the xml and Linq classes but so far ive had no luck with them.
Ive only really done a few database management systems in vb.net before so alot of the coding syntax is new to me.
Ill take a look at those literals and see how it goes thanks :)

Jack


Hey thanks for the code. Im kind of following it but it seems that the 2 declarations for the query, the segs and marker ones. im struggling to see what they do. do the segs and markers variables hold the data thats held in the defined nodes? if so how can they then be read into a rich text box? ive tried
rtb1.text = segs.value
but it doesnt return any values. I realise im attempting something i know little about but it would make alot of peoples workflows alot faster!
Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,414
  • Joined: 29-May 08

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 05:10 PM

Set a breakpoint in the debugger. and have look.
You can even use the XML Visualiser to see the structure.
Was This Post Helpful? 1
  • +
  • -

#7 SPACEMTNMAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-June 09

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 05:26 PM

View PostAdamSpeight2008, on 26 March 2012 - 06:10 PM, said:

Set a breakpoint in the debugger. and have look.
You can even use the XML Visualiser to see the structure.



Ah brilliant!! i stepped into the code and in the locals window i see the segs and markers veriables change to XmlQuery
I expand them and under a results tree node there is the data i need. Only question now is how do i get at the data stored in this structure as segs.results isnt valid syntax.

Posted Image
Was This Post Helpful? 0
  • +
  • -

#8 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,414
  • Joined: 29-May 08

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 05:32 PM

Then you need to research what type a LINQ Query returns. I think I've mention this already.
Is there any VB.net Tutorials that cover them.
Was This Post Helpful? 0
  • +
  • -

#9 SPACEMTNMAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-June 09

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 05:35 PM

View PostAdamSpeight2008, on 26 March 2012 - 06:32 PM, said:

Then you need to research what type a LINQ Query returns. I think I've mention this already.
Is there any VB.net Tutorials that cover them.


Stupid me its an array so the segs(0).tostring is what i need. i was going to edit the post but myself not being used to these boards i cant seem to find the edit button :/
Thanks for your help!
Was This Post Helpful? 0
  • +
  • -

#10 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,414
  • Joined: 29-May 08

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 05:38 PM

It isn't an Array.
Was This Post Helpful? 0
  • +
  • -

#11 SPACEMTNMAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-June 09

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 05:47 PM

View PostAdamSpeight2008, on 26 March 2012 - 06:38 PM, said:

It isn't an Array.


Hmmm isnt it? it certainly acts like one. the tostring works for getting the data into the text boxes.
Was This Post Helpful? 0
  • +
  • -

#12 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,414
  • Joined: 29-May 08

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 05:53 PM

The query returns an IEnumerable(Of T) where T usually is it Greatest Common Base Type.
Notice how you had to expand it the Debugger, this is because IEnumerables are Lazy.

Which why a lot add a .ToArray or .ToList

but the sort of loses the benefit of it being Lazy,

The query is not evaluated until you do some thing with them.

What if the query return nothing at all, completely empty.

And you should use .Count as IEnumerable can be infinite in length.

This post has been edited by AdamSpeight2008: 26 March 2012 - 05:54 PM

Was This Post Helpful? 0
  • +
  • -

#13 SPACEMTNMAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-June 09

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 06:27 PM

View PostAdamSpeight2008, on 26 March 2012 - 06:53 PM, said:

The query returns an IEnumerable(Of T) where T usually is it Greatest Common Base Type.
Notice how you had to expand it the Debugger, this is because IEnumerables are Lazy.

Which why a lot add a .ToArray or .ToList

but the sort of loses the benefit of it being Lazy,

The query is not evaluated until you do some thing with them.

What if the query return nothing at all, completely empty.

And you should use .Count as IEnumerable can be infinite in length.



The query shouldnt ever return nothing because the xml file is always the same length and is always perfect in structure and content otherwise the system wont create the file in the first place so that shouldn't be a problem. if these two files work then future files will inevitably work.

The only problem is i cant seem to work out how to use an ofd to load into either variable because i cant load a document path as the x1 value and i cant load the document into a sring and use that string as the x1 value. Im sorry if im asking alot of you.
Was This Post Helpful? 0
  • +
  • -

#14 AdamSpeight2008  Icon User is online

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,414
  • Joined: 29-May 08

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 06:33 PM

Quote

The query shouldnt ever return nothing

Never assume and check, you have code defensively.

What's the type of x1 and x2 (hint: It isn't String)
Once you discover the type does it have a Load method?

This post has been edited by AdamSpeight2008: 26 March 2012 - 06:40 PM

Was This Post Helpful? 0
  • +
  • -

#15 SPACEMTNMAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 25-June 09

Re: Merging XML Nodes into another document

Posted 26 March 2012 - 06:51 PM

View PostAdamSpeight2008, on 26 March 2012 - 07:33 PM, said:

Quote

The query shouldnt ever return nothing

Never assume and check, you have code defensively.

What's the type of x1 and x2 (hint: It isn't String)
Once you discover the type does it have a Load method?


Okay file loaded :D Thanks again. Once the program is complete ill post it up on here :D
Thanks!
Jack
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2