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
 SQL Server Development (2000)
 Is there Function to Escape invalid XML characters

Author  Topic 

sqldev80
Yak Posting Veteran

68 Posts

Posted - 2006-05-24 : 15:01:39
Is there a function where I can replace invalid characters in my XML

I do this in my proc to create XML

select @feed = '<g:label>'+''+ replace(@desc_english, '&', '&')+''+ '</g:label>'

some times desc_english will have invalid XML characters
so is there a function to replace them

Kristen
Test

22859 Posts

Posted - 2006-05-25 : 14:56:46
There are lots of things that need replacing ... can you not use FOR XML to generate the actual XML and let that take care of the problem for you?

Kristen
Go to Top of Page

sqldev80
Yak Posting Veteran

68 Posts

Posted - 2006-05-25 : 15:25:30
I had to use lot of replace to do that
my data had lot of invalid XML and i could not use for XML coz for XML would not convert it into the format i wanted
i hope SQL had an inbuild function to escape invalid XML
i gues we could create one otherwise
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-05-26 : 12:50:39
"for XML would not convert it into the format i wanted"

Can you explain what "format" problem you had pls?

Kristen
Go to Top of Page
   

- Advertisement -