【发布时间】:2014-01-27 01:44:02
【问题描述】:
我正在使用 FOR XML PATH 查询从我们的数据库生成站点地图,我需要声明一个名称与默认名称不同的名称空间:
(参见下面的 xsi:schemaLocation)
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
如何使用:
;with xmlnamespaces( default 'http://www.sitemaps.org/schemas/sitemap/0.9',
'http://www.w3.org/2001/XMLSchema-instance' as xsi,
'http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd' --as "xsi:schemaLocation"
谢谢!
【问题讨论】:
标签: sql xml namespaces sql-server-2012