I am trying to update some XML data using XMLspy.
Here is the data I have...
<Orders>
<Order_x0020_ID>30</Order_x0020_ID>
<Employee_x0020_ID>9</Employee_x0020_ID>
<Customer_x0020_ID>27</Customer_x0020_ID>
<Order_x0020_Date>2006-01-15T00:00:00</Order_x0020_Date>
<Shipped_x0020_Date>2006-01-22T00:00:00</Shipped_x0020_Date>
<Shipper_x0020_ID>2</Shipper_x0020_ID>
<Ship_x0020_Name>Karen Toh</Ship_x0020_Name>
<Ship_x0020_Address>789 27th Street</Ship_x0020_Address>
<Ship_x0020_City>Las Vegas</Ship_x0020_City>
<Ship_x0020_State_x002F_Province>NV</Ship_x0020_State_x002F_Province>
<Ship_x0020_ZIP_x002F_Postal_x0020_Code>99999</Ship_x0020_ZIP_x002F_Postal_x0020_Code>
<Ship_x0020_Country_x002F_Region>USA</Ship_x0020_Country_x002F_Region>
<Shipping_x0020_Fee>200</Shipping_x0020_Fee>
<Taxes>0</Taxes>
<Payment_x0020_Type>Check</Payment_x0020_Type>
<Paid_x0020_Date>2006-01-15T00:00:00</Paid_x0020_Date>
<Tax_x0020_Rate>0</Tax_x0020_Rate>
<Status_x0020_ID>3</Status_x0020_ID>
</Orders>
I'm using this XQuery:
xquery version "1.0";
insert nodes
<Orders>
<Order_x0020_ID>999</Order_x0020_ID>
</Orders>
into doc("Orders.xml")
This should create another order in the Orders.xml file. However, when trying to run it, it does not. This is the error I get:
Unexpected token 'nodes'
XPST0003: The expression around '"1.0"; insert nodes <Orders>' is not a valid instance of the XQuery grammar
I wish the output data to be:
<Orders>
<Order_x0020_ID>999</Order_x0020>
</Orders>
Any help would be greatly appreciated, thanks!