This
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Data [
<!ENTITY data SYSTEM 'data.txt'>
]>
<Data>
&data;
</Data>
Results in this
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE Data (View Source for full doctype...)>
- <Data>
<event start="Nov 5 2012 00:00:00 GMT" link="http://www.washingtonpost.com/wp-srv/onpolitics/watergate/chronology.htm" image="http://www.constitutioncenter.org/timeline/flash/assets/asset_upload_file761_12313.jpg" title="Nixon Elected">Richard Milhous Nixon, the 55-year-old former vice president who lost the presidency for the Republicans in 1960, reclaims it by defeating Hubert Humphrey in one of the closest elections in U.S. history</event>
<event start="June 17 2012 00:00:00 GMT" end="Aug 1 1972" link="http://www.washingtonpost.com/wp-srv/onpolitics/watergate/chronology.htm" image="http://www.utexas.edu/features/archive/2005/graphics/watergate4.jpg" title="Watergate arrests">Five men, one of whom says he used to work for the CIA, are arrested at 2:30 a.m. trying to bug the offices of the Democratic National Committee at the Watergate hotel and office complex.</event>
</Data>
Is there anyway to remove the top lines during the process? Or hide them?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Data [
<!ENTITY data SYSTEM 'data.txt'>
]>
One way of doing this is with an inline DOCTYPE declaration and external entity. This will only help though if your XML parser is able to process the DOCTYPE
In this case
data.txtis a relative path from the location of the xml file, you could also use an absolute path, providing your XML parser could follow it.