I have the following xml (as outputted by console.log(mattes_get_openings_xml())
):
<Openings>
<opening>
<item><x>3.75</x><y>4.25</y><width>4.5</width><height>6.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>8.875</x><y>9</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>9.5</x><y>6.25</y><width>1.5</width><height>2.5</height><type>ellipse</type> <clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>7.3125</x><y>1.75</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>8.875</x><y>3.5</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>5.25</x><y>11.25</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>7.3125</x><y>10.5625</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>5.25</x><y>1.25</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>1.5625</x><y>3.5</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>3.125</x><y>10.625</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>3.125</x><y>1.8125</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>1.5625</x><y>9</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
<opening>
<item><x>1</x><y>6.25</y><width>1.5</width><height>2.5</height><type>ellipse</type><clipX>0</clipX><clipY>0</clipY><imgsrc></imgsrc><photos_hires_width></photos_hires_width><photos_hires_height></photos_hires_height></item>
</opening>
</Openings>
In my javascript code I have the following:
var parser = new DOMParser(); //create a new DOMParser
var doc = parser.parseFromString(mattes_get_openings_xml(), "text/xml"); //convert the string to xml; Note: mattes_get_openings_xml() is the xml above
console.log(doc);
The console.log(doc)
results in:
Basically in the <imgsrc>
, <photos_hires_width>
, and <photos_hires_height>
, the contents are the same:
<html>
<body>
<parsererror style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black">
<h3>This page contains the following errors:</h3>
<div style="font-family:monospace;font-size:12px">error on line 1 at column 1: Document is empty</div>
<h3>Below is a rendering of the page up to the first error.</h3>
</parsererror>
</body>
</html>
This is only happening for the first <opening>
No comments:
Post a Comment