Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select and copy parts of a string
#2
Macro Macro2519
Code:
Copy      Help
str XML=
;<elements>
;;;;<Element>
;;;;;;<ID>16</ID>
;;;;;;<Date>2015-03-07T20:40:12</Date>
;;;;;;<Name>File1</Name>
;;;;;;<Link>http://youtube.com/</Link>
;;;;</Element>
;;;;<Element>
;;;;;;;<ID>17</ID>
;;;;;;<Date>2015-03-07T20:40:12</Date>
;;;;;;<Name>File2</Name>
;;;;;;<Link>http://youtube.com/</Link>
;;;;</Element>
;</elements>

str file="File1"
str ID

IXml x._create
x.FromString(XML)
IXmlNode n=x.RootElement.Path(F"Element[Name='{file}']/ID")
if(!n) end "not found"
ID=n.Value

out ID


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)