开发者

Creating a URL with XML

I've searched and searched and can't seem to find any tutorial on how to write my own webpage that is strictly XML. This is the sort of thing I want to create myself. I'm not too advanced of an XML or webpage writer, but does anyone have any ideas/tutorials?

P.S. I want to do this because 开发者_StackOverflowI'm writing an android app that needs to pull information from this XML file. A local XML file is not a solution. A requirement for this app is that the XML needs to be online.

P.S.S. Here's a small sample of what I'd like to write to a URL:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Phone Numbers Set 1 -->
    <string name="police1_phone">555-555-5555</string>
    <string name="police2_phone">555-555-5555</string>
    <string name="police3_phone">555-555-5555</string>
    <string name="police4_phone">555-555-5555</string>
    <string name="police5_phone">555-555-5555</string>

    <!-- Phone Numbers Set 2 -->
    <string name="fire1_phone">555-555-5555</string>
    <string name="fire2_phone">555-555-5555</string>
</resources>


As mentioned by others, XML is not the same as a URL. However, I understand what you're looking for. Typically, when writing a web-page, you have a .html file that will display whatever code you've written in there. If you just paste your XML code into that .html file and display that, it will show your raw XML code.


You didn't find any tutorial because you're mixing things here. An URL is an Universal Resouce Locator, which means it can point to anything (not just HTML files). Just put your XML in your server and use the path as URL, it will be fine.

If you need any more clarifications, just let me know


Well you acutally should call a webservice which returns information in form of xml !


Do you want the XML data to remain the same or change depending on some factor? If it stays the same, just put all of the XML data into an .xml file, upload it to your server and link to that. If you want to generate XML, you'll need to write a script that spits out the desired XML data every time someone visits that page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜