web stats
Mirth Community - View Single Post - Insert a specific namespace element attribute w/out namespace attribute appears
View Single Post
  #1  
Old 11-30-2015, 09:05 AM
jritz jritz is offline
Mirth Newb
 
Join Date: Mar 2012
Posts: 6
jritz is on a distinguished road
Thumbs down Insert a specific namespace element attribute w/out namespace attribute appears

How to insert namespace specific element attribute of xsi:type to an existing XML object without a new element namespace element attribute to appear?

XML BEFORE code:
<value code="55561003" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT" displayName="Active"/>

Figure A: Current Javascript code

var entryRelationship= new XML('<entry typeCode="DRIV"><observation classCode="OBS" moodCode="EVN"><templateId root="2.16.840.1.113883.10.20.22.4.38"/><id/><code code="ASSERTION" codeSystem= "2.16.840.1.113883.5.4"><originalText></originalText></code><text/><statusCode code="completed"/><effectiveTime nullFlavor="UNK"/><value code="55561003" codeSystem= "2.16.840.1.113883.6.96" codeSystemName= "SNOMED-CT" displayName= "Active"/></observation></entry>');
var xsi= new Namespace('xsi','http://www.w3.org/2001/XMLSchema-instance');
entryRelationship.observation.value.@type= "CD";
entryRelationship.observation.value.@type.setName( 'xsi:type');

XML AFTER code:
<value code="55561003" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT" displayName="Active" xmlns:xsi="urn:hl7-org:v3" xsi:type="CD"/>

Question: After inserting the value element xsi:type attribute (eg. xsi:type="CD"), how does one code using E4X with JS to suppress the xmlns:xsi namespace specific element attribute (eg. xmlns:xsi="urn:hl7-org:v3") from the XML.

DESIRED XML:
<value code="55561003" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT" displayName="Active" xsi:type="CD"/>
Reply With Quote