Created on 10-16-2017 06:37 PM - edited 08-17-2019 07:06 PM
i have xml data like this below and i want to get localAttribtes tag by name 'rs' in my EvaluateXpath processor i tried this expression in my EvaluateXpath processor //localAttributes/*[@name='rs']/name()
but i don't get "rs" tag value :
<?xml version="1.0" encoding="UTF-8" standalone="no"?><service><localAttributes name="rs"><start>2017-09-07</start><startDate>2017-02-02</startDate><endDate>2017-03-02</endDate><runAs>true</runAs><patch>this is patch</patch><makeVersion>1</makeVersion></localAttributes><localAttributes name="ns"><start>2017-09-07</start><startDate>2017-02-02</startDate><endDate>2017-03-02</endDate><runAs>true</runAs><patch>this is patch</patch><makeVersion>1</makeVersion></localAttributes></service>
Created 10-16-2017 08:23 PM
can you change the property to
//localAttributes[@name='rs']
it will gives you only
<?xml version="1.0" encoding="UTF-8"?><localAttributes name="rs"> <start>2017-09-07</start> <startDate>2017-02-02</startDate> <endDate>2017-03-02</endDate> <runAs>true</runAs> <patch>this is patch</patch> <makeVersion>1</makeVersion> </localAttributes>
(or)
if name=rs is first in value every time in local attribute node then you can use
//localAttributes[1]
will results the same output.
Created 10-16-2017 08:23 PM
can you change the property to
//localAttributes[@name='rs']
it will gives you only
<?xml version="1.0" encoding="UTF-8"?><localAttributes name="rs"> <start>2017-09-07</start> <startDate>2017-02-02</startDate> <endDate>2017-03-02</endDate> <runAs>true</runAs> <patch>this is patch</patch> <makeVersion>1</makeVersion> </localAttributes>
(or)
if name=rs is first in value every time in local attribute node then you can use
//localAttributes[1]
will results the same output.
Created 10-19-2017 01:47 PM
yes it was helpful thank you