tags:

views:

34

answers:

1

I want to use dash symbol in xml node name but when i try to get that node it says something about unexpected token.

<hudson.scm.SubversionSCM_-ModuleLocation>
<remote>svn://svn.something.ru/testlib/trunk/SOAPUI/pmplatform/email</remote> 
</hudson.scm.SubversionSCM_-ModuleLocation>

$xmlone = New-Object XML
$xmlone.Load($scriptRoot+"\config.xml")
$xmlone.project.scm.locations.hudson.scm.SubversionSCM_-ModuleLocation
+3  A: 

Try quoting the name that has dashes in it:

PS > $xml = [xml]'<root><dash-it-all>text</dash-it-all></root>'
PS > $xml.root.'dash-it-all'
OldFart