Need Help getting baddly structured XML file from web into table

  • I have no clue what I'm doing, I use to be able to program > 20 years ago but all knowledge has seem to left me! What I would like to do is poll the site every x minutes and download parse the information into a table. I have no access to the xml structure so I'm unable to change the format. There is no namespace in the file, depending on what tool I use I'm able to get the information manually, currently using excel to poll every x minutes. Microsoft Access see's the scheme as 4 tables, unknown how to post file but I have a pdf that shows relationship.

    Any and all help greatly appreciated.

    xmlfeed.rb

    <?xml version='1.0' encoding='UTF-8'?>

    <currentConditions>

    <deviceName>My Device</deviceName>

    <readingDateTime>07/01/2013 23:22:06</readingDateTime>

    <tempUnits>Fahrenheit</tempUnits>

    <form>1T2T3T4T</form>

    <ports>

    <port number="1" name="rack">

    <condition type="temperature">

    <currentReading>81.8</currentReading>

    <highLimit>95</highLimit>

    <lowLimit>10</lowLimit>

    <alarmStatus>0</alarmStatus>

    <prevAlarmStatus>0</prevAlarmStatus>

    </condition>

    </port>

    <port number="2" name="output_ac">

    <condition type="temperature">

    <currentReading>61.7</currentReading>

    <highLimit>95</highLimit>

    <lowLimit>10</lowLimit>

    <alarmStatus>0</alarmStatus>

    <prevAlarmStatus>0</prevAlarmStatus>

    </condition>

    </port>

    <port number="3" name="input_ac">

    <condition type="temperature">

    <currentReading>78.7</currentReading>

    <highLimit>95</highLimit>

    <lowLimit>10</lowLimit>

    <alarmStatus>0</alarmStatus>

    <prevAlarmStatus>0</prevAlarmStatus>

    </condition>

    </port>

    <port number="4" name="cutbox">

    <condition type="temperature">

    <currentReading>80.0</currentReading>

    <highLimit>95</highLimit>

    <lowLimit>10</lowLimit>

    <alarmStatus>0</alarmStatus>

    <prevAlarmStatus>0</prevAlarmStatus>

    </condition>

    </port>

    </ports>

    <errorReadingSensor>0</errorReadingSensor>

    </currentConditions>

    Scheme made from some online service stored locally

    <?xml version="1.0" encoding="UTF-8"?>

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <!-- Inferred on Fri Jun 28 17:20:28 EDT 2013 by Basic IG generator, TwoStep(Iname (with attributes), Automaton Merging State(Greedy(k,h-context), State Removal(Weighted)), Chained(Empty Children, Nested Concatenation)), Basic XSD exporter -->

    <!-- global types -->

    <xs:complexType name="Tcondition">

    <xs:sequence>

    <xs:element name="currentReading" type="xs:string"/>

    <xs:element name="highLimit" type="xs:string"/>

    <xs:element name="lowLimit" type="xs:string"/>

    <xs:element name="alarmStatus" type="xs:string"/>

    <xs:element name="prevAlarmStatus" type="xs:string"/>

    </xs:sequence>

    <xs:attribute name="type" type="xs:string" use="required"/>

    </xs:complexType>

    <xs:complexType name="Tport">

    <xs:sequence>

    <xs:element name="condition" type="Tcondition"/>

    </xs:sequence>

    <xs:attribute name="number" type="xs:string" use="required"/>

    <xs:attribute name="name" type="xs:string" use="required"/>

    </xs:complexType>

    <xs:complexType name="Tports">

    <xs:sequence>

    <xs:element name="port" type="Tport"/>

    <xs:element name="port" type="Tport" minOccurs="0" maxOccurs="unbounded"/>

    </xs:sequence>

    </xs:complexType>

    <xs:complexType name="TcurrentConditions">

    <xs:sequence>

    <xs:element name="deviceName" type="xs:string"/>

    <xs:element name="readingDateTime" type="xs:string"/>

    <xs:element name="tempUnits" type="xs:string"/>

    <xs:element name="form" type="xs:string"/>

    <xs:element name="ports" type="Tports"/>

    <xs:element name="errorReadingSensor" type="xs:string"/>

    </xs:sequence>

    </xs:complexType>

    <!-- top level element -->

    <xs:element name="currentConditions" type="TcurrentConditions"/>

    </xs:schema>

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply