我正在尝试使用 XMLspy 更新一些 XML 数据。
这是我的数据...
<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>
我正在使用这个 XQuery:
xquery version "1.0";
insert nodes
<Orders>
<Order_x0020_ID>999</Order_x0020_ID>
</Orders>
into doc("Orders.xml")
这应该在 Orders.xml 文件中创建另一个订单。但是,当尝试运行它时,它不会。这是我得到的错误:
Unexpected token 'nodes'
XPST0003: The expression around '"1.0"; insert nodes <Orders>' is not a valid instance of the XQuery grammar
我希望输出数据是:
<Orders>
<Order_x0020_ID>999</Order_x0020>
</Orders>
任何帮助将不胜感激,谢谢!