PDA

View Full Version : XFactorstudio XPath requires full URL to load?


ironchefmoto
03-14-2006, 12:23 AM
I just did a project that called in a static hand-edited XML file to render some content in a Flash piece. I decided to use XFactorstudio's XPath implementation and try it out. Much to my surprise, the day I was trying to launch the project, I could not load the XML properly from a server, even though it worked fine when tested on a local Flash player client.

Typically, I use flashvars in my OBJECT and EMBED tags to leave me the option of changing the relative path to an XML file in one of my projects. I then just load the flashvar into the project. It keeps it from being hardcoded into the Flash interactive.

This time, I used a relative path (urlencoded) in the flashvar, and nothing happened. The XML wouldn't load. It WAS on a phsyically different server, but the relative path should've worked. Instead, the only way I could load the XML using Xfactostudio's XPath implementation was to use the FULL absolute URL in the flashvar (e.g. http://www.website.com/xmlfile.xml).

Any ideas why this may have happened? Is that something that happens with XFactorstudio's XPath implementation?

Thanks,
IronChefMorimoto

hangalot
03-14-2006, 12:36 AM
its got nothing to do with the xpath implementation. futhermore from your post i can see you are using xpathdocument which is the deprecated way of dealing with xml from an xpath perspective. rather use the static functions on the XPath object

ironchefmoto
03-21-2006, 06:51 PM
One of my XPath calls in the project I mentioned:

regionTL = XPath.selectNodes(xmlData, "/tournament/region[1]/round");

I'm not using the xpathdocument, as I'm using the AS2 implementation of XFactorStudio's XPath.

That said, why would I need to reference a absolute hard-coded (vs. relative) URL for the XML that I'm loading? If I use the XPath functions built into the flash data classes (the undocumented functions), I don't have to do that.

IronChefMorimoto

hangalot
03-21-2006, 07:07 PM
thats not the case at all. xpath is completely seperate from the xml object so relative vs absolute url has nothing to do with it. once you have loaded the xml object you use it. thats all there is to it,.

ironchefmoto
03-22-2006, 07:22 PM
Why, then, will the same relative path work for the loading the XML into the XML object when I use either the built-in XML functions for Flash or the undocumented XPath functions via the Data Binding Classes? I don't have to point the XML file to load via an absolute URL.

IronChefMorimoto

hangalot
03-22-2006, 07:28 PM
ok, counter argument. i have been using xfactorstudios xpath implementation since its as1 form, i used to use it in flash, now i use it in flex. our deployment model means that i can never use a full URI, it always has to be relative and never through all these version have i run into this problem. have you tried running a http sniffer yet?

pan69
03-29-2006, 11:05 AM
now i use it in flex.If I may be so blunt to ask, do you also use it in Flex 2? And if not how do you do XPath in Flex 2? I don't think XPath is native to Flex 2, or is it?

www.lukeschreur.com

hangalot
03-29-2006, 12:32 PM
no i do flex 1.5 (which is basically flash 7)developement as a day job, but we are starting to transition it out towards flex2. flex2 has e4x (i prefer xpath).

ironchefmoto
03-29-2006, 03:23 PM
I have not run an HTTP sniffer, no. I need to test my FLA on a different server setup. Right now, I'm having to put XML on a server separate from the SWF. It's an idiotic arrangement here at my office, but they have some reason for it. I'll test it on my personal site and see if that makes a difference -- everything on the same path/server.

IronChefMorimoto