Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
How to breake this XML

XML
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:sdtc="urn:hl7-org:sdtc">
<code code="185349003" codeSystem="2.16.840.1.113883.6.96" sdtc:valueSet="2.16.840.1.113883.3.464.1003.101.12.1048">
  <originalText>Encounter, Performed: Diabetes Visit</originalText>
          </code>
 </ClinicalDocument>


I am using This code
SQL
DECLARE @XML AS XML, @hDoc AS INT, @SQL NVARCHAR (MAX),@rootxmlns varchar(100)
SET @rootxmlns = '<root xmlns:hm="urn:hl7-org:v3" />'

SELECT @XML ='<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:sdtc="urn:hl7-org:sdtc">
<code code="185349003" codeSystem="2.16.840.1.113883.6.96" sdtc:valueSet="2.16.840.1.113883.3.464.1003.101.12.1048">
  <originalText>Encounter, Performed: Diabetes Visit</originalText>
          </code> </ClinicalDocument>'

EXEC sp_xml_preparedocument @hDoc OUTPUT, @XML,@rootxmlns

SELECT   *  
FROM OPENXML (@hDoc, '//hm:ClinicalDocument')    
with(
Value_setid varchar(50) 'hm:code/@hm:valueSet',
originalText varchar(50) 'hm:code/hm:originalText'
)


But it cant breake tag sdtc:valueSet How to breake this tag in this code
Posted
Updated 19-Jan-15 4:55am
v3
Comments
Sinisa Hajnal 19-Jan-15 6:02am    
What do you mean by "can't break tag sdtc:xxx"? You're paring hm:valueSet without problems which means colon (:) is not the issue...what error do you get (if any)?
Richard Deeming 28-Jan-15 11:38am    
It doesn't seem to be possible to add a solution to this question, possibly because you've edited a very old question.

Try deleting it and posting it as a new question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900