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 2005 Forums
 Transact-SQL (2005)
 checking XML format

Author  Topic 

oceanboy
Starting Member

44 Posts

Posted - 2009-09-14 : 23:44:19
Hi all,

is there any way to check whether the format of the XML is correct? ie, all opening tags have closing tags.

Thanks!
OB

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-09-15 : 00:47:24
Yes. If you use a XML variable, SQL Server will make sure the xml content is wellformed.
And if you use a XSD (or XML schema) and assign that to the XML variable, you can also make sure the content follows the business rules too.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

oceanboy
Starting Member

44 Posts

Posted - 2009-09-15 : 04:35:34
thanks! I guess if the format is not correct, the string won't go through the XML parser.
Go to Top of Page
   

- Advertisement -