# Help -error loading xml -in the xml image gallery tutorial

**URL:** <https://forum.kirupa.com/t/help-error-loading-xml-in-the-xml-image-gallery-tutorial/177974>\
**Category:** Uncategorized\
**Created:** [February 6, 2006, 10:11pm UTC](https://forum.kirupa.com/t/help-error-loading-xml-in-the-xml-image-gallery-tutorial/177974 "2006-02-06T22:11:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sk8n4s8n13](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@sk8n4s8n13](https://forum.kirupa.com/u/sk8n4s8n13)\
**Post date:** [February 6, 2006, 10:11pm UTC](https://forum.kirupa.com/t/help-error-loading-xml-in-the-xml-image-gallery-tutorial/177974/1 "2006-02-06T22:11:13Z")

</div>

Works perfect locally - load everyrhing to my ISP server and up barfs an error … my xml file isn’t being loaded any ideas?-

```auto
function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        swf = [];
        name = [];
        link = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            swf* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
            name* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
            link* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
        }
        firstImage();
    } else {
        display_txt.text = "Error loading XML!";
        display_txt._y = 380;
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("swfs.xml");

```

---

<div class="post-metadata">

**Author:** ![ringspun](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@ringspun](https://forum.kirupa.com/u/ringspun)\
**Post date:** [April 16, 2006, 2:59am UTC](https://forum.kirupa.com/t/help-error-loading-xml-in-the-xml-image-gallery-tutorial/177974/2 "2006-04-16T02:59:59Z")

</div>

I have this problem too, I think it has to do with the naming of the images in the .xml file. For example I have “landscape01.jpg” instead it should be “[http://www.yoursite.com/foldername/landscape01.jpg](http://www.yoursite.com/foldername/landscape01.jpg)”.

I tried this but it too did not work. Can anybody help?

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 16, 2006, 3:22am UTC](https://forum.kirupa.com/t/help-error-loading-xml-in-the-xml-image-gallery-tutorial/177974/3 "2006-04-16T03:22:39Z")

</div>

alot of FTP programs capitalize extensions, e.g: “filename.jpg” gets uploaded as “filename.JPG”

---

<div class="post-metadata">

**Author:** ![ringspun](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@ringspun](https://forum.kirupa.com/u/ringspun)\
**Post date:** [April 17, 2006, 10:00pm UTC](https://forum.kirupa.com/t/help-error-loading-xml-in-the-xml-image-gallery-tutorial/177974/4 "2006-04-17T22:00:05Z")

</div>

> [@Defective](#):
>
> alot of FTP programs capitalize extensions, e.g: “filename.jpg” gets uploaded as “filename.JPG”

That has been changed as well and still no luck.

As a test I downloaded the tutorial and put it back online and it works.  
But in an HTML page the xml is not loading.

---

<div class="post-metadata">

**Author:** ![ringspun](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@ringspun](https://forum.kirupa.com/u/ringspun)\
**Post date:** [April 17, 2006, 10:37pm UTC](https://forum.kirupa.com/t/help-error-loading-xml-in-the-xml-image-gallery-tutorial/177974/5 "2006-04-17T22:37:28Z")

</div>

Alright [here](http://www.ringspundesign.com/xml_test2/wtf.htm) is the link for my version that is inside an html page.

[Here](http://www.ringspundesign.com/xml_test/gallery_land.swf) is the same files & folders, but NOT in an html page (excuse flash for stretching it to fit the screen)

This is the Flash code

> \_root.createEmptyMovieClip(“mcImageHolder”,1);  
> mcImageHolder.\_x = 19;  
> mcImageHolder.\_y = 20;

var allPhotos:XMLNode = new XMLNode();  
var currentPhoto:XMLNode = new XMLNode();

var photosXML:XML = new XML();  
photosXML.ignoreWhite = true; //don’t look at empty space in the XML file  
photosXML.onLoad = function(ok:Boolean)  
{  
if(ok == true)  
{  
allPhotos = photosXML.firstChild;  
currentPhoto = allPhotos.firstChild;  
displayPhoto(currentPhoto);  
}  
else  
{  
txtCaption.text = “Error loading XML.”;  
}  
}

photosXML.load(“photos.xml”);

displayPhoto = function(photoData:XMLNode)  
{  
//display caption  
var captionNode:XMLNode = new XMLNode();  
var captionTextNode:XMLNode = new XMLNode();  
captionNode = photoData.firstChild;  
captionTextNode = captionNode.firstChild;  
txtCaption.text = captionTextNode.nodeValue;  
//display image  
var imageNode:XMLNode = new XMLNode();  
var imageTextNode:XMLNode = new XMLNode();  
imageNode = captionNode.nextSibling;  
imageTextNode = imageNode.firstChild;  
mcImageHolder.loadMovie(imageTextNode.nodeValue);  
}

btnForward.onRelease = function()  
{  
if (currentPhoto.nextSibling != null)  
{  
currentPhoto = currentPhoto.nextSibling;  
displayPhoto(currentPhoto);  
}  
}

btnBack.onRelease = function()  
{  
if (currentPhoto.previousSibling != null)  
{  
currentPhoto = currentPhoto.previousSibling;  
displayPhoto(currentPhoto);  
}  
}

I am curious as to whether or not DOCTYPE line in the HTML has anything to do with it, so here is the top part of the HTML:

> \<!DOCTYPE XHTML PUBLIC “-//W3C//DTD xhtml 1.0 transitional//EN”  
> “[http://www.w3.org/TR/html4/loose.dtd](http://www.w3.org/TR/html4/loose.dtd)”\>

So it must have something to do with the xml fiole not loading into a flash file in an HTML file but the only place I thought that would fix it was xhtml in the doctype. Any help would be greatly appreciated 🙂

Thanks
