Re: How to parse an XML doc that has namespace defined in its root ele




You've missed the end tag in the namespace declaration (a trailing '/')

Change

EXEC sp_xml_preparedocument @idoc OUTPUT, @doc, '<ns0:MyDataSet
xmlns:ns0="MyDataSet">'

to

EXEC sp_xml_preparedocument @idoc OUTPUT, @doc, '<ns0:MyDataSet
xmlns:ns0="MyDataSet"/>'

.


Loading