& not encoded correctly from XML doc

vinay_sh

New Member
I am trying to load an XML document which has an embedded & in a node value. The DOM parser is unable to read this information, raises an exception and stops loading the document.
I have tried changing the -cpinternal startup parameter to UTF-8, this has not helped.

Progress V9.1D


Any suggestions?
 

luebbert

New Member
&amp is considered an entity character, and is only converted properly for DOMText and DOMAttr objects. For example:
<NODE attr="&lt;hello&gt;">
&pos;text node&pos;
</NODE>


When the attribute's value is queried, the returned string will be "<hello>". When the text node's value is queried, the returned string will be "'text node'".
Would you mind posting the XML file that you are working with?


 

vinay_sh

New Member
The file follows. Thanks for your help.

<?xml version="1.0"?>
<CommonRecordCommonLine xmlns="" DocumentProcessCode="TEST">
<TransmissionData>
<DocumentID>2004-12-31T11:37:11.00</DocumentID><CreatedDateTime>2004-12-31T11:37:11.00</CreatedDateTime><DocumentTypeCode>Request</DocumentTypeCode><Source><School>
<OPEID>00131700</OPEID>
<OrganizationName>UCSD</OrganizationName>
</School>
</Source>
<Destination><Lender><OPEID>830005</OPEID><OrganizationName>WACHOVIA EDUCATION FINANCE</OrganizationName></Lender></Destination></TransmissionData><Software><SoftwareProvider>PS</SoftwareProvider><SoftwareVersion>2004</SoftwareVersion></Software><AttendedSchool><OPEID>00131700</OPEID><Student><Index><SSN>200501008</SSN>
<BirthDate>1980-10-22</BirthDate>
<LastName>LUCAS</LastName>
</Index>
<PersonIdentifiers>
<SchoolAssignedPersonID>M64789639355008</SchoolAssignedPersonID>
<DriversLicense>
<DriversLicenseState>MN</DriversLicenseState>
<DriversLicenseNumber>S200501008</DriversLicenseNumber>
</DriversLicense>
</PersonIdentifiers>
<Name>
<FirstName>GEORGE</FirstName>
<MiddleInitial>A</MiddleInitial>
</Name>
<Contacts>
<PermanentAddress>
<AddressLine>1974 STARWARS EPISODE FOUR BY GEORGE LUCAS</AddressLine>
<AddressLine>1978 THE EMPIRE STRIKES BAC EPISODE FIVE</AddressLine>
<AddressLine><CDATA>1996 RETURN OF THE JEDI EPISODE SIX&amp;</CDATA></AddressLine><City>THE IMPERIAL PALACE</City><StateProvinceCode>NY</StateProvinceCode><PostalCode>20044</PostalCode></PermanentAddress>
<PermanentHomePhone>
<AreaCityCode>800</AreaCityCode>
<PhoneNumber>5551212</PhoneNumber>
</PermanentHomePhone>
</Contacts>
<FFELPLoanInformation LoanKey="1">
<StudentLevelCode>First</StudentLevelCode>
<FinancialAwardBeginDate>2005-04-01</FinancialAwardBeginDate>
<FinancialAwardEndDate>2005-05-30</FinancialAwardEndDate>
<ProcessingTypeCode>GO</ProcessingTypeCode>
<FinancialAwardID>0013170000M333008</FinancialAwardID>
<EnrollmentStatusCode>FullTime</EnrollmentStatusCode>
<GraduationDate>2007-05-30</GraduationDate>
<FinancialAwardCreateDate>2004-12-30</FinancialAwardCreateDate>
<FederalApplicationFormCode>M</FederalApplicationFormCode>
<Guarantor>
<OPEID>706</OPEID>
</Guarantor>
<Lender>
<OPEID>830005</OPEID>
</Lender>
<SerialLoanRequestedIndicator>true</SerialLoanRequestedIndicator>
</FFELPLoanInformation>
<FFELPSubsidized>
<LoanKey>1</LoanKey>
<FinancialAwardNumber>01</FinancialAwardNumber><FinancialAwardAmount>2625</FinancialAwardAmount>
<Disbursement Number="1">
<DisbursementDate>2005-02-01</DisbursementDate>
<DisbursementReleaseIndicator>true</DisbursementReleaseIndicator>
</Disbursement>
<Disbursement Number="2">
<DisbursementDate>2005-03-15</DisbursementDate>
<DisbursementReleaseIndicator>true</DisbursementReleaseIndicator>
</Disbursement>
</FFELPSubsidized>
<FFELPUnsubsidized>
<LoanKey>1</LoanKey>
<FinancialAwardNumber>02</FinancialAwardNumber><FinancialAwardAmount>4000</FinancialAwardAmount>
<Disbursement Number="1">
<DisbursementDate>2005-02-01</DisbursementDate>
<DisbursementReleaseIndicator>true</DisbursementReleaseIndicator>
</Disbursement>
<Disbursement Number="2">
<DisbursementDate>2005-03-15</DisbursementDate>
<DisbursementReleaseIndicator>true</DisbursementReleaseIndicator>
</Disbursement>
</FFELPUnsubsidized>
</Student>
</AttendedSchool>
</CommonRecordCommonLine>
 

luebbert

New Member
Cdata

It looks like to me that you your CDATA tag is not functioning because it is not properly formatted.

A CDATA section starts with "<![CDATA[" and ends with "]]>"

For example:
<![CDATA[1996 RETURN OF THE JEDI EPISODE SIX&amp;]]>

---

Your XML file can be read my the XML parser built into IE6. I rteally do not think you need the CDATA tags in this case. What happens if you remove them?
 

vinay_sh

New Member
My bad - I was trying out some stuff and gave you the modified doc. The xml tag is actually -
<AddressLine>1996 RETURN OF THE JEDI EPISODE SIX&amp;</AddressLine>
which loads correctly in IE as well. However the DOM parser produces the following error -

X-NODEREF or X-DOCUMENT LOAD got an error: FATAL ERROR: file 'MEMPTR', line '5', column '224', message 'Expected entity name for reference'. (9082)
 
Top