Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XML Data read and extract output in an array
#9
Solved: 10 Years, 9 Months, 3 Weeks ago
Hi Sweety, for the deletion of xml data i was not able to reply to that post, instead of that iam replying the answer here

Code:
Set xmlDoc =   CreateObject("Microsoft.XMLDOM")

xmlDoc.Async = "False"
xmlDoc.Load("C:\test.xml")

Set colNodes=xmlDoc.selectNodes  ("/Fileheaderproperty/type")

For Each objNode in colNodes

If instr(Ucase(objNode.text),"YES") Then
  xmlDoc.documentElement.removeChild (objNode)
  End If
Next
  
xmlDoc.Save "C:\test1.xml"


The Out put will be Like
Code:
- <Fileheaderproperty>
- <type>
  <Car>2</Car>
  <parking>no</parking>
  <rent>560</rent>
  </type>
- <type>
  <Car>3</Car>
  <parking>no</parking>
  <rent>750</rent>
  </type>
- <type>
  <Car>5</Car>
  <parking>no</parking>
  <rent>260</rent>
  </type>
  </Fileheaderproperty>

Thanks
-Tanya
Reply


Messages In This Thread
RE: XML Data read and extract output in an array - by tanyamrz - 04-25-2013, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to extract particular digit from a string amit25007 3 3,290 10-05-2016, 10:49 AM
Last Post: Ankur
  Reading XML Data from a WebPage shaan.mishra87@gmail.com 1 2,054 09-28-2016, 09:16 PM
Last Post: supputuri
  table output values shipu 1 2,262 01-24-2014, 10:06 AM
Last Post: supputuri
  How to extract part of a string between two particular characters. ACCBAJPA 7 5,413 08-22-2013, 02:39 PM
Last Post: ACCBAJPA
  Getting an 'Error in XML document' Error when submitting web services XML luckyexpert 0 2,948 08-20-2013, 10:23 PM
Last Post: luckyexpert

Forum Jump:


Users browsing this thread: 1 Guest(s)