Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

XML: replace value of - why is not working

i have this xml
<InvoiceList xmlns="http://schemas.adventure-works.com/Invoices">
  <Invoice InvoiceNo="1000">
    <Customer>Kim Abercrombie</Customer>
    <Items>
      <Item Product="1" Price="1.99" Quantity="2" />
      <Item Product="3" Price="2.49" Quantity="1" />
    </Items>
  </Invoice>
  <Invoice InvoiceNo="1001">
    <Customer>Sean Chai</Customer>
    <Items>
      <Item Product="1" Price="2.45" Quantity="2" />
    </Items>
  </Invoice>
</InvoiceList>

why is not working
UPDATE #Stores
SET Invoices.modify('declare default element namespace "http://schemas.adventure-works.com/Invoices";
  replace value of (/InvoiceList/Invoice/Items[@Price="1.99"]/@Price)[1]
  with "1.69"')
WHERE StoreID = 1
Avatar of CarlsbergFTW
CarlsbergFTW
Flag of Romania image

There isn't any 'StoreID' value in the xml you posted tho your query is using it to define specific data.
Avatar of enrique_aeo
enrique_aeo

ASKER

it is exits
XML-storeID.jpg
ASKER CERTIFIED SOLUTION
Avatar of jonaska
jonaska
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial