vb.net - Comparing xml Attribute with String finds no match -


how can compare these 2 correctly

if xanswer.@state = "error" , xanswer.@errormsg = **"der wert darf nicht null sein.& #xd;&#xa;parametername: xmlstruct (attributes country)"**   < response state="error" errormsg="der wert darf nicht null sein.&#xd;&#xa;parametername: xmlstruct (attributes country)" xmlns=""></response > 

i believe doesnt jump if path because of & #xd;&#xa in xml attribute. means in xml attribute different in string. can approve this? tried replace & #xd;&#xa in string & vbcrlf &but didn't work

if xanswer.@state = "error" , xanswer.@errormsg = "der wert darf nicht null sein." , xanswer.errormsg.@parametername = " xmlstruct (attributes country)" 

and

if xanswer.@state = "error" , xanswer.@errormsg = "der wert darf nicht null sein." , xanswer.@errormsg = "parametername:  xmlstruct (attributes country)" 

doesnt work.

as xml attributes strings used .contains method selection. thx first answer.

you can try using string functions startwith() , endwith() match xml element , skip checking & #xd;&#xa; part :

if xanswer.@state = "error" , _    xanswer.@errormsg.startswith("der wert darf nicht null sein.") , _    xanswer.@errormsg.endswith(" xmlstruct (attributes country)") 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -