Sir,
I have XML content in a xml type identifier as shown below.
</VitalSummary>
<VitalMngId/>
<FacilityTypeId>11</FacilityTypeId>
<VitalLatesetMngRev>1</VitalLatesetMngRev>
<VitalFrameId>0</VitalFrameId>
<MeasureDateTime>20060707163420</MeasureDateTime>
<CreatePractitioner>20060707163420</CreatePractitioner>
<CreateDateTime>20060707163420</CreateDateTime>
<DeleteFlag>0</DeleteFlag>
<ConnectionNumber>0</ConnectionNumber>
<PatientId>ANH1</PatientId>
<ToUpdateFlag>true</ToUpdateFlag>
<UpdatePractitioner>PRA1</UpdatePractitioner>
<UpdateDateTime>20060707163420</UpdateDateTime>
</VitalSummary>
I want to know how I can set the value to the node <VitalMngId/> which is null.I can set value to other nodes using the code as shown below in a oracle Stored procedure.
PROCEDURE SET_VitalSummary(VitalSummary IN OUT xmltype);
TnodelistVitFID dbms_xmldom.DOMNodeList;
TnodeVitFID dbms_xmldom.DOMNode;
TnodelistVitMngId dbms_xmldom.DOMNodeList;
TnodeVitMngId dbms_xmldom.DOMNode;
Tdoc := dbms_xmldom.newDOMDocument(VitalSummary);
TnodelistVitFID := xslprocessor.selectNodes(dbms_xmldom.makeNode(Tdoc ),'/VitalSummary/FacilityTypeId');
TnodeVitFID := dbms_xmldom.item(TnodelistVitFID , 0);
dbms_xmldom.setData(dbms_xmldom.getFirstChild(Tnod eVitFID), '55');
I can change the value of <FacilityTypeId> from 11 to 55.
But I can't change the value of <VitalMngId> using the code as shown below because it is null
TnodelistVitMngId := xslprocessor.selectNodes(dbms_xmldom.makeNode(Tdoc ),'/VitalSummary/VitalMngId');
TnodeVitMngId := dbms_xmldom.item(TnodelistVitMngId, 0);
dbms_xmldom.setData(dbms_xmldom.getFirstChild(Tnod eVitFID), '10');
Can you inform me how i can set a value to xml node if it is null.
Regards,
Aneesh Kumar.P