Page as .xml file on web

Hi All, I have created a database to store names and telephone numbers in XML format via the web. This is to enable an IP based phone to pick this up as a phone directory. However, the phone needs to see an .xml file for it to work.

Can anyone please tell me how to make the page appear as a .xml extension, or export it with an agent or whatever to the server?

Subject: Page as .xml file on web

One way to do it is to create a Web URL Redirect Document:

Incoming URL path: /sitemap.xml

Redirection URL string:/db.nsf/sitemap.xml?readForm

Of course, you will either need to restart the http task or issue a “tell web refresh” command for the server to recognize this document.

Subject: RE: Page as .xml file on web

You probably meant to say “tell http refresh”.

Craig, your requirements are still not quite clear to me. What have you created so far? How do you store the data required? Is data entered over the web or is the main problem to return XML when a certain URL is requested?

There are different ways to generate XML, a very simple one is to just name a page e.g. phonebook.xml and call it like

http://host/path/dbname.nsf/phonebook.xml

There’s no need to append “?OpenPage”, as long as the name is unique amongst all design elements. On your page you can enter the static parts (root element and header) as text. A computed value can be used to look up information from the documents in your application and build the XML structure as needed. The most important thing is to have this page served with the right content type.

A lot depends on how picky the client requesting the information is. With some clients, you might even get away with “display as HTML” ticked, but this is not really the clean way to do it. In the page properties, you can specify a custom MIME type, and that’s what you should do. Unfortunately, there are a couple of MIME types that can be used with XML. Most commonly used are text/xml and application/xml. For many applications both will do just fine. As long as the HTML header specifies a character set, there shouldn’t be a difference. If a character set is not given in the header, application/xml will not default to any character set and XML rules for managing the encoding will apply. With text/xml,

character encoding will default to us-ascii.

Subject: RE: Page as .xml file on web

Both your suggestions are excellent and I will do some testing. Yes, my main requirement is to return data over the web to the phone itself. It expects an XML file. I have built the content using a view embedded in a page, with the correct header and footer. As a novice, I did not realise you could simply name the page whatever you wanted. Many thanks.