使用Xquery将数据插入XML节点

时间:2013-03-12 21:07:32

标签: xml insert xquery

我有一个示例XML文件,并希望使用Xquery将数据插入节点

<Employees>
<ID>1</ID>
<Company>Northwind Traders</Company>
<Last_x0020_Name>Freehafer</Last_x0020_Name>
<First_x0020_Name>Nancy</First_x0020_Name>
<E-mail_x0020_Address>nancy@northwindtraders.com</E-mail_x0020_Address>
<Job_x0020_Title>Sales Representative</Job_x0020_Title>
<Business_x0020_Phone>(123)555-0100</Business_x0020_Phone>
<Home_x0020_Phone>(123)555-0102</Home_x0020_Phone>
<Fax_x0020_Number>(123)555-0103</Fax_x0020_Number>
<Address>123 1st Avenue</Address>
<City>Seattle</City>
<State_x002F_Province>WA</State_x002F_Province>
<ZIP_x002F_Postal_x0020_Code>99999</ZIP_x002F_Postal_x0020_Code>
<Country_x002F_Region>USA</Country_x002F_Region>
<Web_x0020_Page>#http://northwindtraders.com#</Web_x0020_Page>
</Employees>

我如何能够在当前文件下插入更多XML,例如:

<Employees>
<ID>2</ID>
<Company>Another Company</Company>
</Employees

我尝试了以下但无法弄清楚。

insert nodes <ID>2</ID> after 
doc("Employees.xml")//Employees

0 个答案:

没有答案