Trouble Importing XML File using XSL

R

ridawg

Hey,

I'm trying to import the following XML file into an Access database:

<?xml version="1.0" encoding="UTF-8"?>
<CallLog>
<Calls>
<Call>
<Assigned_To>
<Area>Products</Area>
<Name>Jay Johnson</Name>
<Help_Desk_Number>789</Help_Desk_Number>
<Date_Assigned>2005-09-21</Date_Assigned>
</Assigned_To>
<Title>Test the title</Title>
<ID>id1-9212005</ID>
<Opened_By>John Smith</Opened_By>
<Date_Opened>2005-09-21</Date_Opened>
<Subject>Commercial Products</Subject>
<Priority>Medium</Priority>
<Status>Completed</Status>
<Type>Problem</Type>
<System>Billing</System>
<Description>This is a test of the description</Description>
<Closed>
<Closed_By>Jack Trades</Closed_By>
<Closed_Date>2005-09-21</Closed_Date>
<Resolution>This is the resolution</Resolution>
</Closed>
</Call>
</Calls>
</CallLog>

I would like to import this into 1 table. When using the import wizard it
imports this file and creates 3 tables (Calls, Assigned_To, & Closed). I've
tried to create an XSL file to transform the XML into one table but I can't
seem to get it to work.
Below is the XSL file I created:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" mlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:eek:utput method="xml" version="1.0" indent="yes" />
<xsl:template match="/">
<CallLog>
<xsl:for-each select="CallLog/Calls/Call">
<!-- From ID to Description I have no problems -->
<ID><xsl:value-of select="ID"/></ID>
<Title><xsl:value-of select="Title"/></Title>
<Opened_By><xsl:value-of select="Opened_By"/></Opened_By>
<Date_Opened><xsl:value-of select="Date_Opened"/></Date_Opened>
<Subject><xsl:value-of select="Subject"/></Subject>
<Type><xsl:value-of select="Type"/></Type>
<System><xsl:value-of select="System"/></System>
<Priority><xsl:value-of select="Priority"/></Priority>
<Status><xsl:value-of select="Status"/></Status>
<Description><xsl:value-of select="Description"/></Description>
<!-- Can't get the Assigned_To info to work -->
<Area><xsl:value-of select="Assigned_To/Area"/></Area>
<Assigned_Name><xsl:value-of

select="Assigned_To/Name"/></Assigned_Name>
<Date_Assigned><xsl:value-of

select="Assigned_To/Date_Assigned"/></Date_Assigned>
<Help_Desk_Number><xsl:value-of

select="Assigned_To/Help_Desk_Number"/></Help_Desk_Number>
<!-- Can't get the Closed info to work -->
<Closed_By><xsl:value-of
select="Closed/Closed_By"/></Closed_By>
<Closed_Date><xsl:value-of
select="Closed/Closed_Date"/></Closed_Date>
<Resolution><xsl:value-of select="Closed/Resolution"/></Resolution>
</xsl:for-each>
</CallLog>
</xsl:template>
</xsl:stylesheet>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top