SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Need Help getting baddly structured XML file from web into table


Need Help getting baddly structured XML file from web into table

Author
Message
kaykor
kaykor
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 5
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

[code="xml"]

<?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>

[code="xml"]

Scheme made from some online service stored locally

[code="xml"]

<?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>

[code="xml"]
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search