xml - How to separate the attribute from xpath? -


i split attribute xpath .

$xpath = "/configuration/system.servicemodel/services/service/endpoint/@binding"  $node = $xpath.split("@")[0] $attribute = $xpath.split("@")[1] 

$attribute having correct value "binding"

but node xpath "/configuration/system.servicemodel/services/service/endpoint/". there "/" @ end . want rid of that.

how remove it?

use -split operator:

$xpath = "/configuration/system.servicemodel/services/service/endpoint/@binding"  $node, $attribute = $xpath -split '/@', 2 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -