Re: XMLDOM, the System.Xml namespace and refreshing data

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: BCM (BCM_at_none.com)
Date: 09/16/04


Date: Thu, 16 Sep 2004 09:44:21 -0400

Perfect! You made my day.

Cheers,

Brad

"Baavgai" <brettmc@gmail.com> wrote in message
news:cialob$63p@odbk17.prod.google.com...
> This kind of thing should work for the XML stuff.
>
> System.Xml.XmlDocument xmlDoc = null;
>
> public void GetData() {
> xmlDoc=new System.Xml.XmlDocument();
> xmlDoc.Load(@"c:\myxmldoc.xml");
> }
>
> public void Update() {
> string myLabelText=
> xmlDoc.GetElementsByTagName("TimeStamp")[0].InnerText;
> idMyLabel.innerText=myLabelText;
> }
>
> Peace,
> Brett
>
> BCM wrote:
>> In ASP 3, I once did a page using javascript and XMLDOM that loaded
> up xml
>> files, displayed their data, and automatically refreshed that data at
> 10
>> second intervals (not a whole page refresh: just the data in the
> particular
>> node I wanted to display). The javascript looked something like:
>>
>>
>>
>> function GetData()
>>
>> {
>>
>> xmldoc = new ActiveXObject("Microsoft.XMLDOM");
>>
>> xmldoc.load("c:\\myxmldoc.xml");
>>
>> }
>>
>>
>>
>> function Update()
>>
>> {
>>
>> var myLabelText =
>> (xmldoc.getElementsByTagName("TimeStamp").item(0).text);
>>
>> idMyLabel.innerText = myLabelText;
>>
>> }
>>
>>
>>
>> function Init()
>>
>> {
>>
>> GetData();
>>
>> setInterval(GetData(),9000); //grab the xml doc every 9 seconds
>>
>> setInterval(Update(),10000); //update the html with the data it
> contains
>> every 10 seconds
>>
>> }
>>
>>
>>
>> Then, in the HTML form, I would just call Init() during the body
> onLoad
>> event.
>>
>>
>>
>> Surely there is a similar technique in ASP.NET using the System.XML
>> namespace, but after a day and a half I wave the white flag! Any
>> suggestions? Thanks in advance!
>



Relevant Pages

  • Re: Problem modifying XML view definitions from installed C# Add-in
    ... > attempts to modify an XML view definition for an Outlook folder (similar ... > It works fine on my development machine, but when I distribute the add-in ... > public void OnDisconnection(Extensibility.ext_DisconnectMode ...
    (microsoft.public.outlook.program_addins)
  • Re: extracting part of xml
    ... Given the following an XML file called items.xml with the following ... public void readItemsthrows FileNotFoundException, ... // get the list of children of the root element ... Jean-Paul H. ...
    (comp.lang.java.programmer)
  • Re: extracting part of xml
    ... Given the following an XML file called items.xml with the following ... public void readItemsthrows FileNotFoundException, ... Element root = doc.getRootElement; ... // put better handling of exception here ...
    (comp.lang.java.programmer)
  • Re: XML and Java from Beginner
    ... If it is then you should not be parsing the XML manual. ... public void charactersthrows SAXException { ... public void startElement(String namespaceURI, String localName, String rawName, Attributes atts) throws SAXException { ...
    (comp.lang.java.programmer)
  • Re: User defined SAX Events
    ... startElement(), endElement() etc... ... mappings] public void endEmployee() ... XML is the programmer's duct tape. ...
    (comp.lang.java.programmer)