but that doesnt work. I cant figure out how to change the voltage based on the value of Name.

"doesn't work" isn't diagnostic ... :)

but, even in xpath, you can't make syntax up :) grab xpather.pl and see what it spits out

/Settings/Channels/Channel[4] # posy /Settings[1]/Channels[1]/Channel[4] # star /*[ local-name() = "Settings" and position() = 1 ] /*[ local-name() = "Channels" and position() = 1 ] /*[ local-name() = "Channel" and @Name = "L360" and @Voltage = "120" and @Test = "1" ] # rats /Settings[1] /Channels[1] /*[ name() = "Channel" and position() = 4 and @Name = "L360" and @Vol +tage = "120" and @Test = "1" ]

So next step is adjust your xpath to be valid :)


In reply to Re: how to change node value based on other node value by Anonymous Monk
in thread how to change node value based on other node value by ccherri

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.