0
我使用FOR XML路徑查詢生成從我們的數據庫一個網站地圖,我需要聲明的是具有不同的名稱比默認的命名空間:SQL Server作爲根元素的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"
謝謝!