I am going to take a wild guess here: is it possible that this
is caused by "elementFormDefault", i.e. by the lack of one of those in the
Schema?
Radu
The "id" element is there :
<id root="1.1.83" extension="PRPA_HN000203.22"/>
See xml file
below:
<?xml version="1.0"
encoding="utf-8"?> <MCCI_MT000100HT02.Message xmlns="urn:hl7-org:v3"
type="Message" xmlns:xsip="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id root="1.1.83" extension="PRPA_HN000203.22"/>
<creationTime value="20030130140405.1440-0800"/>
<versionCode code="V3PR1"/> <interactionId
extension="PRPA_HN000203"/> <processingCode
code="P"/> <processingModeCode code="T"/>
<acceptAckCode code="AL"/> <communicationFunctionRCV
type="CommunicationFunction"> <typeCode
code="RCV"/> <deviceRCV type="Device"
classCode="DEV"
determinerCode="INSTANCE"> <id
root="1.1.88" extension="88"/>
<playedAgentRCV type="Role"
classCode="AGNT">
<representedOrganizationRCV type="Organization" classCode="ORG"
determinerCode="INSTANCE">
<id root="1.1.88.88"/>
</representedOrganizationRCV>
</playedAgentRCV> </deviceRCV>
</communicationFunctionRCV> <communicationFunctionRSP
type="CommunicationFunction"> <typeCode
code="RSP"/> <deviceRSP type="Device"
classCode="DEV"
determinerCode="INSTANCE"> <id
root="1.1.83" extension="83"/>
<playedAgentRSP type="Role"
classCode="AGNT">
<representedOrganizationRSP type="Organization" classCode="ORG"
determinerCode="INSTANCE">
<id root="1.1.83.83"/>
</representedOrganizationRSP>
</playedAgentRSP> </deviceRSP>
</communicationFunctionRSP> <communicationFunctionSND
type="CommunicationFunction"> <typeCode
code="SND"/> <deviceSND type="Device"
classCode="DEV"
determinerCode="INSTANCE"> <id
root="1.1.83" extension="83"/>
<playedAgentSND type="Role"
classCode="AGNT">
<representedOrganizationSND type="Organization" classCode="ORG"
determinerCode="INSTANCE">
<id root="1.1.83.83"/>
</representedOrganizationSND>
</playedAgentSND> </deviceSND>
</communicationFunctionSND>
<MCAI_MT000001HT02.ControlActEvent type="ControlAct" classCode="CACT"
moodCode="EVN"> <code code="PRPA_TE000203"
codeSystemName="HTB Supplemental"/> <subject
type="ActRelationship" typeCode="SUBJ">
<PRPA_MT400001HT02.EncounterEvent type="PatientEncounter" classCode="ENC"
moodCode="EVN"> <id
root="1.1.83.400"
extension="8"/> <code
code="16239"
codeSystemName="HL7"/>
<statusCode
code="completed"/>
<effectiveTime>
<low
value="20050101164530.1250-0800"/>
<high
value="20050130140405.1440-0800"/>
</effectiveTime>
<dischargeDispositionCode code="FL22.01"
codeSystemName="NUBC-UB92"/>
<preAdmitTestInd
value="true"/> <subject
type="Participation"
typeCode="SBJ">
<Patient type="Patient"
classCode="PAT">
<id root="1.1.83.300"
extension="307"/>
<effectiveTime>
<low
value="20050101"/>
</effectiveTime>
<Person type="Person" classCode="PSN"
determinerCode="INSTANCE">
<id root="1.1.83.100" extension="307"
/>
<name
use="">
<family
partType="FAM">Cornelissen</family>
<given
partType="GIV">Jan</given>
<given
partType="GIV">L</given>
</name>
<administrativeGenderCode code="10174"
codeSystemName="HL7"/>
<birthTime
value="191905031304-0800"/>
<addr
use="H">
<country
partType="CNT">CA</country>
<state
partType="STA">B.C.</state>
<county
partType="CPA">CPA</county>
<city
partType="CTY">Missisauga</city>
<postalCode
partType="ZIP">8M3C5V</postalCode>
<streetAddressLine partType="SAL">23592 Anywhere
Street</streetAddressLine>
<streetName partType="STR">Anywhere
Street</streetName>
<houseNumber
partType="HNR">23592</houseNumber>
<additionalLocator partType="ADL">Suite
103</additionalLocator>
</addr>
</Person>
<Organization type="Organization" classCode="ORG"
determinerCode="INSTANCE">
<id
root="1.1.83.83"/>
</Organization>
</Patient>
</subject> <admitter
type="Participation"
typeCode="ADM">
<time>
<low
value="20050130140405.1440-0800"/>
</time>
<EmploymentStaff type="Employee"
classCode="EMP">
<id root="1.1.83.200"
extension="52"/>
</EmploymentStaff>
</admitter>
<pertinentInformation4 type="ActRelationship"
typeCode="PERT">
<ObservationEventDx type="Observation" classCode="OBS"
moodCode="EVN">
<code code="16840"
codeSystemName="HL7"/>
<statusCode
code="active"/>
<effectiveTime>
<low
value="20050130140405.1440-0800"/>
<high
value="20050130140405.1440-0800"/>
</effectiveTime>
<confidentialityCode code="PSY"
codeSystemName="Confidentiality"/>
<independentInd
value="false"/>
<value code="233604007" codeSystemName="SNOMED-CT"
xsi:type="CE"/>
</ObservationEventDx>
</pertinentInformation4>
</PRPA_MT400001HT02.EncounterEvent>
</subject>
</MCAI_MT000001HT02.ControlActEvent> </MCCI_MT000100HT02.Message>
Adrian
Shum wrote:
it looks to me that, in the raw xml, you didn't have the "id" element
in "message"
-----Original Message-----
From: Peter-Paul Rang [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 27, 2005 4:39 PM
To: [email protected]
Cc: rang >> Peter-Paul Rang
Subject: NullPointerException when reading the leaves of the XML data
I'm getting a NullPointerException when reading the leaves of the XML data
I can read the XML File correctly, I can walk through the XML structure
correctly, I can print it correctly.
String file = "D:/Htb/Dev/message/EE07_xmlbean.xml";
File inputFile = new File(file);
try
{
MCCIMT000100HT02Message message =
MCCIMT000100HT02Message.Factory.parse(inputFile);
System.out.println(message.xmlText());
However, when I want to retrieve specific values from the xml file, I
get a NullPointerException.
String extension = (String)message.getId().getExtension();
-->
java.lang.NullPointerException
at parser.TestMyXMLBean.doAll(TestMyXMLBean.java:42)
at parser.TestMyXMLBean.main(TestMyXMLBean.java:82)
Process exited with exit code 0.
Any hints and tips are very much appreciated.
Thanks,
Peter-Paul
--
|
|
|
|
|
![]()
|
<!--[if
!supportEmptyParas]--> <!--[endif]--> |
Peter-Paul
Rang Development
Specialist Business Technology
Solutions |
|
|
Oracle Nederland
BV Consulting |
|
Rijnzathe 6 P.O. Box
147 |
|
|
phone fax |
+31 30 669 8248 +31
30 669 9966 |
|
|
|
3454 ZJ De
Meern |
|
|
[EMAIL PROTECTED] |
|
|
|
The
Netherlands |
|
|
|
|
|
|
|
|
Voor meer informatie
over onze diensten bezoek ons op internet |
|
|
|
<!--[if
!supportEmptyParas]--> <!--[endif]-->
|