You are here: Re: Including a xml file in the head tag « HTML « IT news, forums, messages
Re: Including a xml file in the head tag

Posted by Steve Pugh on 09/19/07 11:24

On Sep 19, 10:29 am, Harry Bellafonte <goodmin...@hotmail.com> wrote:
> On 19 sep, 10:48, David Dorward <dorw...@gmail.com> wrote:
> > On Sep 18, 9:45 pm, Harry Bellafonte <goodmin...@hotmail.com> wrote:
>
> > > How do I include a xml file into the head tag? I know how to include a
> > > stylesheet and javascript file but don't have a clue how to include a
> > > xml file into my html code.
>
> > There are various data formats which are expressed in XML (FOAF, RSS
> > and ATOM spring to mind) which can be referenced from an HTML document
> > (although not 'included'). You might also be wanting to do something
> > with a custom format (perhaps from JavaScript).
>
> > You'll need to provide more information about what you want to achieve
> > before we can really help.
>
> You are right I will explain why I want this.
>
> I have a flas file ( .swf) file that needs settings that are in the
> xml file. The flash file will only work if the xml file is in the same
> directory. The problem is that the web environment (Webshere WCM) in
> which I am creating the webpages does not allowe to place files ( css,
> jpg, javascriptfiles, etc) at operating system level. Those files has
> to be included in the webtool as fileresources. I have created a
> fileresource for the xml file in the webtool, only that did not work.
> Thats why I want to include the xml file ( just like I did with the
> css files and javascript files) in the HEAD tag.

Do you know for sure that your SWG can read the XML from the head of
the HTML document? If not then it may well be a wasted exercise
working out how to include it there.

I've had the same problem a few times recently and the way I solved it
was to get the SWF altered so that it can pick up the XML file from an
absolute URL (which is either hard coded in the SWF or passed in as a
parameter).

The other solution is to alter the Webshare WCM configuration to allow
the placement of the SWF and XML files in the same directory (or
bypass it by placing them directly on the server via FTP or whatever).

Finally as the SWF is acessing the XML over HTTP anyway, you can
configure your server to redirect from /same-directory-as-swf/the.xml
to /some-other-directory/the.xml.

And, one more thing to check. At least once I ran into a problem where
the SWF was written assuming that the SWF and the XML file would not
only be in the same "directory" as each other but would be in the same
"directory" as the HTML calling the SWF. That sort of assumption is
often a bad idea (in my case I wanted to call in all assets, including
SWFs, from a separate host name).

Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация