Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 no .modify('delete //@xmlns') ?

Author  Topic 

djseng
Starting Member

25 Posts

Posted - 2006-08-15 : 22:47:45
[code]
DECLARE @x xml;
WITH XMLNAMESPACES ( DEFAULT 'http://tempuri.org' )
SELECT @x = (
SELECT CAST( '<text xmlns="http://tempuri.org" id="1">weee</text>' as xml).query('.')
FOR XML
PATH(''),
ROOT('texts')
)
SET @x.modify(' delete //@id ') --- go bye bye
SET @x.modify(' delete //@xmlns ') --- no go bye bye
SELECT @x
[/code]

This is just a sample, but I would like to delete the redundant namespace declarations in a document, but apparently sql won't let me. Why o why?
   

- Advertisement -