Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Fetch & Read XML Data into HTML File?

From: "Richard In Va." <Reply-none@---.--->
To: NULL
Date: 9/8/2008 10:04:00 AM


"Martin Honnen" <mahotrash@y...> wrote in message 
news:%23kLUDQbEJHA.2292@T......
> Richard In Va. wrote:
>> Would anyone know how I can fetch and read xml data to display in a html 
>> file?
>>
>> I'm building a local (unpublished) webpage to be a personal homepage on 
>> my PC.  When I open/refresh the html file, I would like it to fetch an 
>> xml file type <?xml version="1.0" encoding="ISO-8859-1" ?> from the 
>> internet and parse/read some of the data to display in the webpage using 
>> standard html/ccs.
>
> You could build a HTA (HTML application) on Windows and then use 
> JavaScript and MSXML to load and parse the XML document.
> I suggest using a HTA instead of a normal web page as with normal web 
> pages rendered in a browser you are not allowed to access domains other 
> than the one your HTML document has been loaded from.
> HTAs are documented here:
> http://msdn.microsoft.com/en-us/library/ms536471(vs.85).aspx
>
> MSXML documentation is here:
> http://msdn.microsoft.com/en-us/library/ms763742(VS.85).aspx
>
> If you need help writing JavaScript using MSXML to parse your XML document 
> then post the URL of the XML and tell us which elements and/or attributes 
> you want to read.
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/

Thanks Martin for your reply!

URL for XML file = http://xoap.weather.com/weather/local/23218?cc=&dayf=7

Elements / attributes I'm interested in...

<dnam>?</dnam>
<tm>?</tm>
<lsup>?</lsup>
<tmp>?</tmp>
<t>?</t>
<hmid>?</hmid>
<dayf>
    <day d="?" day t="?" dt="?">
        <hi>?</hi>
        <lo>?</lo>
            <part p="d">
                <t>?</t>
                <ppcp>?</ppcp>
                <hmid>?</hmid>
            </part>
     </day>

<day d="1" t="?" dt="?">
etc....

"?" = the data I want to display in my homepage.

(same elements for day #0 thru day #6)

I was hoping that the xml file could be fetched from the web, then read from 
cache avoiding the browser across domain issue. Also, don't know much about 
writing scripts, but I have edited several for a custom fit.  Never know, 
later I may want to add-in or remove unused elements.

Thanks Martin for your reply... hope I'm not asking for too much.  I briefly 
looked at your HTA link and will do further reading, that might work well.

Thanks again!

Richard in VA.
+++++++++++



















transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent