Connecting Tech Pros Worldwide Forums | Help | Site Map

Inserting XML into a webpage.

james.qian@gmail.com
Guest
 
Posts: n/a
#1: May 10 '06
Hi, and thanks in advance for helping me out.

I have an XML file, with an XSL style sheet attached, and I want to use
this XML file as a news feed on my personal site, instead of using PHP.

Is there any way to insert this XML file into the body of my site
without using iframes or using DOM to parse it? I was trying to use
DOM to load it and display it as is, but being a noob at this, I
totally screwed up.

Maybe load it and appendChild?

If GooglePages allows hotlinking, here is a link to the file (i
disallowed hotlinking on my own site, so i had to upload it here):
http://james.qian.googlepages.com/news.xml

David Dorward
Guest
 
Posts: n/a
#2: May 11 '06

re: Inserting XML into a webpage.


james.qian@gmail.com wrote:
[color=blue]
> I have an XML file, with an XSL style sheet attached, and I want to use
> this XML file as a news feed on my personal site, instead of using PHP.
>
> Is there any way to insert this XML file into the body of my site
> without using iframes or using DOM to parse it?[/color]

Most server side languages can do this, those available to you depend on
your webserver.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Andy Dingley
Guest
 
Posts: n/a
#3: May 11 '06

re: Inserting XML into a webpage.


james.qian@gmail.com wrote:
[color=blue]
> I have an XML file, with an XSL style sheet attached, and I want to use
> this XML file as a news feed on my personal site, instead of using PHP.[/color]

Do it server-side with PHP.

You could do it client-side instead. But this is no easier to code, and
it's getting to be browser-dependent. Server-side is simpler to deploy.
If you really want to do this client-side though, look into AJAX.

Joe Kesselman
Guest
 
Posts: n/a
#4: May 11 '06

re: Inserting XML into a webpage.


james.qian@gmail.com wrote:[color=blue]
> Maybe load it and appendChild?[/color]

Load, importNode (may be needed to get the new data into objects
compatable with the ones you want to add it to), and append or insert as
appropriate.
james.qian@gmail.com
Guest
 
Posts: n/a
#5: May 12 '06

re: Inserting XML into a webpage.


Thanks, Joe, I'll try that.

Closed Thread


Similar .NET Framework bytes