Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Openxml issue
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00813617
Message ID:
00813673
Views:
7
Hi Eric,

I don'y know XPATH well enough to explain why it works the way it works and doesn't work the way we expect it to. Or why the attributes afect parsing.
Anyway, you can parse XML inside stored procedure.
declare @spXML as varchar(1000)
set @spXML = '<ArrayOfString' + 
	' xmlns:xsd="http://www.w3.org/2001/XMLSchema"' + 
	' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +  
	' xmlns="https://secure.mio.uwosh.edu/webservices/"' + 
	'> ' +
  '<string>0002A5FF6ECC</string>
  <string>000393ED2634</string>
  <string>000A95895CE4</string>
  <string>000BCD022EAE</string>
  <string>000D28975D26</string>
  <string>00508BFBE766</string>
  <string>0090F514003C</string>
  </ArrayOfString>'

SET @spXML = LEFT(@spXML, CHARINDEX(SPACE(1), @spXML)-1) + '>' + 
				SUBSTRING(@spXML, CHARINDEX('<', @spXML,2), 8000)

DECLARE @idoc int
EXEC sp_xml_preparedocument @idoc OUTPUT, @spXML
select * from openxml (@idoc, 'ArrayOfString/*') WITH (string  char(16) '.')
>Thanks Sergey.. it really doesnt make sense to me why the other way didnt work.. anyway.. another question.. it wount let me have any properties in the root element.. ex
<ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="https://secure.mio.uwosh.edu/webservices/">
>
>Do I have to parse these out before I sent it to the sql server?? Is there some way I can tell the server to ignore it?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform