Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Querying Inner Text with Multiple Attributes

$
0
0

OK – I have one more problem, then I am done with this script.

Consider the following XML BLock:

<TAX>
<AMOUNT qualifier=”TAX” type=”T”>
<VALUE>10</VALUE>
<NUMOFDEC>2</NUMOFDEC>
<SIGN>+</SIGN>
<CURRENCY />
<DRCR />
</AMOUNT>
<AMOUNT qualifier=”TAXBASE” type=”T”>
<VALUE>52</VALUE>
<NUMOFDEC>0</NUMOFDEC>
<SIGN>+</SIGN>
<CURRENCY />
<DRCR />
</AMOUNT>
If I use the following:

$TAXAMT = Select-XML -Xml $PY -XPath “//PAYHEADER//TAX//AMOUNT[@qualifier='TAX']”

Then $TAXAMT contains the following if I echo it:

<VALUE>10</VALUE><NUMOFDEC>2</NUMOFDEC><SIGN>+</SIGN><CURRENCY /><DRCR />

So I am struggling with the next step – how do I get the VALUE or the NUMOFDEC inner text values to be returned only?


Viewing all articles
Browse latest Browse all 13067

Latest Images

Trending Articles



Latest Images