11-04-2010, 10:51 PM
Thanks Prabath AND works.
And for the one you asked clarification:
I have a node image which may or may not have attribute primay.When ever it is available I want to add a column in excel that it exists.
This is the xml node without primary attribute
This is the xml node with primary attribute
And the code I wrote was
And for the one you asked clarification:
I have a node image which may or may not have attribute primay.When ever it is available I want to add a column in excel that it exists.
This is the xml node without primary attribute
Code:
<image type="image/jpg" width="432" height="288" category="Poster Art">
<URI>AllPhotos/26454/26454_ac.jpg</URI>
<caption>Poster Art</caption>
<provider>Unspecified</provider>
</image>
Code:
<image type="image/jpg" width="288" height="432" primary="true" category="Poster Art">
<URI>AllPhotos/26454/26454_aa.jpg</URI>
<caption>Poster Art</caption>
<provider>Unspecified</provider>
</image>
And the code I wrote was
Code:
If ((imgcategory="Poster Art")AND(imgwidth="72")AND(imgheight="108")) then
If urinode.Attribute("primary")<>0 Then
xlSheet.Rows(nRow).Columns(iCol).value=TMS
xlSheet.Rows(nRow).Columns(iCol+1).value=node.NodeValue
xlSheet.Rows(nRow).Columns(iCol+2).value=imgcategory
xlSheet.Rows(nRow).Columns(iCol+3).value="Yes"
imgprimary=urinode.getAttribute("primary")
xlSheet.Rows(nRow).Columns(iCol+4).value=imgPrimary
else
xlSheet.Rows(nRow).Columns(iCol).value=TMS
xlSheet.Rows(nRow).Columns(iCol+1).value=node.NodeValue
xlSheet.Rows(nRow).Columns(iCol+2).value=imgcategory
xlSheet.Rows(nRow).Columns(iCol+3).value="Yes"
End If
else
xlSheet.Rows(nRow).Columns(iCol).value=TMS
xlSheet.Rows(nRow).Columns(iCol+1).value=node.NodeValue
xlSheet.Rows(nRow).Columns(iCol+2).value=imgcategory
End If