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
Post a Comment