XML code wrapper/parsing into HTML/PHP page?

Maverick2002

Diamond Member
Jul 22, 2000
4,694
0
0
I'm trying to take some XML code and have it parsed and displayed in an HTML/PHP page. Is this even possible? Or do I need to have an external XML file that gets interpreted and then imported into an HTML/PHP page? Basically I'm asking whether it's possible to display properly parsed XML code (via XSL most likely) within a non XML document type.
 

Rip the Jacker

Diamond Member
Dec 29, 2004
5,415
1
76
I did a site where all the content was stored in XML files and parsed by PHP and included in a content div so yeah.. I think you do need external XML files.
 

Maverick2002

Diamond Member
Jul 22, 2000
4,694
0
0
What about an RSS-type feed that's not "really" RSS. Specifically, I'm using a service which allows me to submit queries to their API. Basically I type in a specific URL and the system returns an XML output based on my input. Is there any way to integrate that XML into my page without saving it out locally as an XML file and parsing it? It would work kinda like RSS, except it's not an RSS document type. Does that make sense?
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Do you want to display the xml or do you want to pull data out of it to display as part of something else? It doesn't make any sense that you'd retrieve the file via http and then have to write it to disk. Whatever api you use to normally load xml from disk, there'd be something similar for loading from the network or from memory.

The general term for this is webservices and this particular flavour sounds pretty much like REST.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
The original idea here was to use XML and feed it through an XSLT transform to get whatever output you want, i.e. HTML. I haven't done it myself, so I can't be very specific, and as far as I know the technique hasn't gained wide acceptance. Might be worth checking into. It's server-side, I think, so if you have to pull the raw XML to the client then this might not be what you're after.
 

Argo

Lifer
Apr 8, 2000
10,045
0
0
If I understand your question correctly you're looking for an XSLT transform engine.

There are plenty of XSLT transform engines out there. Apache fop is one of them, although I understand there are better things out there these days.
 

SilentZero

Diamond Member
Apr 8, 2003
5,158
0
76
I did something very similar using perl to parse WAS and WPS logs in conjunction with JSP's. Theres lots of ways to do it, just depends on your application.