Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-03 20:12:55

jsico
New Member
Registered: 2006-03-09
Posts: 2

Serving a section as XML

Hi all, I have searched without success for an answer to this odd question:

Is it possible to have a section’s code served as the Mime type text/xml? I am using some AJAX code to load things into a div on the page, but it’s not working with my textpattern-created code (even though I’ve tried putting <?php header(“content-type:text/xml”); ?> at the beginning of the “page” template).

The code (taconite, if anyone’s curious) only works if the stuff being passed to it is xml, and it’s not responding to my links.

The site is www.superbuick.com. The links for “contact” and “media” serve static .php files, so I was able to easily append that header, and those work the way I’d like. (go directly to www.superbuick.com/contact.php to see the raw xml).

Does anyone have any ideas? I’m not worried so much abotu validity – I’ll cross that bridge when I come to it. I just want the browser to be told those pages ARE indeed xml, so it works with my javascript.

Thanks! – John

Offline

#2 2006-05-04 17:58:59

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Serving a section as XML

Just ensure that the section page has the following in the header:

<meta http-equiv="content-type" content="application/xml" />

Note that this specifies that the entire page is XML, not just a portion of it.

(Edit: updated so your code would display properly. :) -Mary)

Last edited by Mary (2006-05-05 01:01:31)


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#3 2006-05-04 21:28:35

jsico
New Member
Registered: 2006-03-09
Posts: 2

Re: Serving a section as XML

Ok, thanks, I will try that. Just so I’m sure (since your post got stripped of this…I got it from the source), this is what you meant to include in the section page, right?
<code> <meta http-equiv=“content-type” content=“application/xml” /> </code>

Offline

#4 2006-05-05 18:19:28

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Serving a section as XML

Yep. Mary fixed it (thank you Mary) :) I still argue with Textile from time to time :)


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

Board footer

Powered by FluxBB