importing XML

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

importing XML

Post by kendall »

im using and shtml document to include an XML document...however when i view it online it includes the xml document but the xml document doesnt get formated from its style sheet. I want to import an XML document into a page how best can i do this?

Kendall
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

XSL ?
Fjook
Forum Newbie
Posts: 11
Joined: Tue Mar 23, 2004 6:58 am
Location: Toronto, Canada

Post by Fjook »

When you say the xml does not get formatted. What exactly do you see? Do you see the sourcecode right on the page? Also, do you have html on that same page? If yes, I think the browser may not be able to process html and xml as one document. However, I've heard that some browsers are able to do that now, though I cannot tell you which ones.

What I do if I want to include content on an xml page is treat it as an rss feed (ask if you dont know what that is). If I want pure xml output, then I just use the .xml page, obviously thats not your purpose.

In conclusion :), the way SSI works should not cause the problem as far as I understand, I'm pretty sure its something on the client side.

Yours,
Fjook!
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

importing XML

Post by kendall »

Sorry Guys should have given you a better explanation.

The XML doucment has a XSLT style sheet...however when SSI included it i just get the DATA...no tags...and no XSLT formatting.

What is RSS processing.

I was also looking into a PHP function that creates a new file from XML documents
xslt_process
has anyone ever used it?

Now the reason why i am doing th is is that there must be a better way to incorporate XMl data with my design and layout of the website than having to encode it into the XSL document. I find this very awkward especially if i have to change the design. hence the reason i was trying to use SSI. I really thought it wud have worked as it would have been a logical solution.

Kendall
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

[php_man]xslt_process[/php_man].

If you're using XML just as a data-repository and don't need the nodes's relationships etc., you might find xPath useful - provided PHP has been compiled with that extension.

XSL is the natural - and powerful - visual presentation layer to XML. I couldn't see an easier way, but others may disagree.
Post Reply