First, thanks to Rx for posting code to import XML into Access. That code example got me further along than anything else I've found.
The data that I'm working with is stock options price data from Yahoo!Finance. (I'm using MS Access 2010.) The problem I have is that the second example code for XML without a style sheet only imports sub-child elements. Below are the first few lines of a file that I want to import.
I tried adding references to Microsoft XML v3.0, v4.0 & v6.0. None of them impacted the final result. Only sub-child elements were imported for each of these references.
It has been many years since I worked with XML and I'm completely unfamiliar with using Access to work with XML. Any pointers as to how to get the parent and child elements imported also would be much appreciated.
TIA,
Nolan
PS Since I'm a newbie I can't include the link the XML file includes. If this is relevant I can spell it out for any interested parties.
PPS Since I couldn't maintain formatting that would make the XML easy to read I've attached a screen shot of the first two records from the XML file.
NM
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
-<query yahoo:lang="en-US" yahoo:created="2013-12-11T15:13:05Z" yahoo:count="11" xmlns:yahoo="{link omitted as requested}">
<!-- total: 11093 -->
<!-- engine5.yql.gq1.yahoo.com -->
-<results>-<optionsChain symbol="SPY" expiration="2013-12-13">-<option symbol="SPY131221C00020000" type="C"><strikePrice>20</strikePrice><lastPrice>150.53</lastPrice><change>0</change><changeDir/><bid>160.15</bid><ask>160.39</ask><vol>10</vol><openInt>10</openInt></option>+<option symbol="SPY131221C00030000" type="C">-<option symbol="SPY131221C00035000" type="C"><strikePrice>35</strikePrice><lastPrice>132.90</lastPrice><change>0</change><changeDir/><bid>145.17</bid><ask>145.4</ask><vol>30</vol><openInt>70</openInt></option>
The data that I'm working with is stock options price data from Yahoo!Finance. (I'm using MS Access 2010.) The problem I have is that the second example code for XML without a style sheet only imports sub-child elements. Below are the first few lines of a file that I want to import.
I tried adding references to Microsoft XML v3.0, v4.0 & v6.0. None of them impacted the final result. Only sub-child elements were imported for each of these references.
It has been many years since I worked with XML and I'm completely unfamiliar with using Access to work with XML. Any pointers as to how to get the parent and child elements imported also would be much appreciated.
TIA,
Nolan
PS Since I'm a newbie I can't include the link the XML file includes. If this is relevant I can spell it out for any interested parties.
PPS Since I couldn't maintain formatting that would make the XML easy to read I've attached a screen shot of the first two records from the XML file.
NM
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
-<query yahoo:lang="en-US" yahoo:created="2013-12-11T15:13:05Z" yahoo:count="11" xmlns:yahoo="{link omitted as requested}">
<!-- total: 11093 -->
<!-- engine5.yql.gq1.yahoo.com -->
-<results>-<optionsChain symbol="SPY" expiration="2013-12-13">-<option symbol="SPY131221C00020000" type="C"><strikePrice>20</strikePrice><lastPrice>150.53</lastPrice><change>0</change><changeDir/><bid>160.15</bid><ask>160.39</ask><vol>10</vol><openInt>10</openInt></option>+<option symbol="SPY131221C00030000" type="C">-<option symbol="SPY131221C00035000" type="C"><strikePrice>35</strikePrice><lastPrice>132.90</lastPrice><change>0</change><changeDir/><bid>145.17</bid><ask>145.4</ask><vol>30</vol><openInt>70</openInt></option>