D
Debbiedo
My software program outputs an XML Driving Directions file that I need
to input into an Access table (although if need be I can import a dbf
or xls) so that I can relate one of the fields (fromStop) and its
associated driving directions back to a relational database. I have
asked my software vendor for solutions but thus far they have not come
up with anything. I am totally unfamiliar with XML so I am struggling
with how to do this. I have been perusing SAMS "Teach yourself XML in
24 Hours" and am getting a better idea of what XML is; however, the
book does not seem to address solving my specific problem.
Suggestions or solutions anyone?
Sample of XML file and resulting table velow.
<NAIRECTIONS>
<ROUTE id="1" name="BUS9A00 - BUS9A34">
<PATH id="1" fromStop="BUS9A00" toStop="BUS9A01">
<STRINGS>
<STRING style="normal" text="East on MAIN"/>
<STRING style="Cumul_length" text="0 mi"/>
<STRING style="summary" text="Drive 0.2 mi"/>
<STRING style="length" text="0.2 mi"/>
</STRINGS>
</DIRECTION>
<STRINGS>
<STRING style="normal" text="Left on PINE"/>
<STRING style="Cumul_length" text="0.2 mi"/>
<STRING style="summary" text="Drive 0.1 mi"/>
<STRING style="length" text="0.1 mi"/>
</STRINGS>
</DIRECTION>
<STRINGS>
<STRING style="normal" text="Right on 3RD"/>
<STRING style="Cumul_length" text="0.3 mi"/>
<STRING style="summary" text="Drive 0.3 mi"/>
<STRING style="length" text="0.3 mi"/>
</STRINGS>
</DIRECTION>
</PATH>
<PATH id="2" fromStop="BUS9A01" toStop="BUS9A02">
<STRINGS>
<STRING style="normal" text="Left on 8TH"/>
<STRING style="Cumul_length" text="0.6 mi"/>
<STRING style="summary" text="Drive 1.3 mi"/>
<STRING style="length" text="1.3 mi"/>
</STRINGS>
</DIRECTION>
</PATH>
<PATH id="3" fromStop="BUS9A02" toStop="BUS9A03">
<STRINGS>
<STRING style="normal" text="Left on ELM"/>
<STRING style="Cumul_length" text="1.9 mi"/>
<STRING style="summary" text="Drive 0.5 mi"/>
<STRING style="length" text="0.5 mi"/>
</STRINGS>
</DIRECTION>
<STRINGS>
<STRING style="normal" text="End at YARD"/>
<STRING style="Cumul_length" text="2.4 mi"/>
<STRING style="summary" text="Drive 0.4 mi"/>
<STRING style="length" text="0.4 mi"/>
</STRINGS>
</DIRECTION>
</PATH>
</ROUTE>
</NAIRECTIONS>
Access table needs to look like this
fromStop toStop normal1 length1
normal2 length2 normal3 length3
BUS9A00 BUS9A01 East on MAIN 0.2 mi Left on PINE
0.1 Right on 3RD 0.3
BUS9A01 BUS9A02 Left on 8TH 1.3
BUS9A02 BUS9A03 Left on ELM 0.5 End at YARD 0.4
Only one route per XML file (although this could change). Routes can
have as few as 3 stops (PATH) or as many as 50. Each PATH element has
its own record. PATH attributes fromStop and toStop only appear once
per record. The number of STRINGS attributes "normal" and "length" are
variable. There could have as many as 50 driving directions (normal
and length) per record!
Cuurently using XMLPad 3.0 and MS Access 2003 for Win XP.
Any and all help greatly appreciated.
to input into an Access table (although if need be I can import a dbf
or xls) so that I can relate one of the fields (fromStop) and its
associated driving directions back to a relational database. I have
asked my software vendor for solutions but thus far they have not come
up with anything. I am totally unfamiliar with XML so I am struggling
with how to do this. I have been perusing SAMS "Teach yourself XML in
24 Hours" and am getting a better idea of what XML is; however, the
book does not seem to address solving my specific problem.
Suggestions or solutions anyone?
Sample of XML file and resulting table velow.
<NAIRECTIONS>
<ROUTE id="1" name="BUS9A00 - BUS9A34">
<PATH id="1" fromStop="BUS9A00" toStop="BUS9A01">
<STRINGS>
<STRING style="normal" text="East on MAIN"/>
<STRING style="Cumul_length" text="0 mi"/>
<STRING style="summary" text="Drive 0.2 mi"/>
<STRING style="length" text="0.2 mi"/>
</STRINGS>
</DIRECTION>
<STRINGS>
<STRING style="normal" text="Left on PINE"/>
<STRING style="Cumul_length" text="0.2 mi"/>
<STRING style="summary" text="Drive 0.1 mi"/>
<STRING style="length" text="0.1 mi"/>
</STRINGS>
</DIRECTION>
<STRINGS>
<STRING style="normal" text="Right on 3RD"/>
<STRING style="Cumul_length" text="0.3 mi"/>
<STRING style="summary" text="Drive 0.3 mi"/>
<STRING style="length" text="0.3 mi"/>
</STRINGS>
</DIRECTION>
</PATH>
<PATH id="2" fromStop="BUS9A01" toStop="BUS9A02">
<STRINGS>
<STRING style="normal" text="Left on 8TH"/>
<STRING style="Cumul_length" text="0.6 mi"/>
<STRING style="summary" text="Drive 1.3 mi"/>
<STRING style="length" text="1.3 mi"/>
</STRINGS>
</DIRECTION>
</PATH>
<PATH id="3" fromStop="BUS9A02" toStop="BUS9A03">
<STRINGS>
<STRING style="normal" text="Left on ELM"/>
<STRING style="Cumul_length" text="1.9 mi"/>
<STRING style="summary" text="Drive 0.5 mi"/>
<STRING style="length" text="0.5 mi"/>
</STRINGS>
</DIRECTION>
<STRINGS>
<STRING style="normal" text="End at YARD"/>
<STRING style="Cumul_length" text="2.4 mi"/>
<STRING style="summary" text="Drive 0.4 mi"/>
<STRING style="length" text="0.4 mi"/>
</STRINGS>
</DIRECTION>
</PATH>
</ROUTE>
</NAIRECTIONS>
Access table needs to look like this
fromStop toStop normal1 length1
normal2 length2 normal3 length3
BUS9A00 BUS9A01 East on MAIN 0.2 mi Left on PINE
0.1 Right on 3RD 0.3
BUS9A01 BUS9A02 Left on 8TH 1.3
BUS9A02 BUS9A03 Left on ELM 0.5 End at YARD 0.4
Only one route per XML file (although this could change). Routes can
have as few as 3 stops (PATH) or as many as 50. Each PATH element has
its own record. PATH attributes fromStop and toStop only appear once
per record. The number of STRINGS attributes "normal" and "length" are
variable. There could have as many as 50 driving directions (normal
and length) per record!
Cuurently using XMLPad 3.0 and MS Access 2003 for Win XP.
Any and all help greatly appreciated.