XSLT to format XML for Filemaker or mySQL Import
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 11
- Joined: Sat Jan 14, 2006 7:17 pm
- Contact:
XSLT to format XML for Filemaker or mySQL Import
I have a library of XML files which I'd ideally like to put into a database. These XML files contain data about various different products with different specs, details, etc. As a result XML files may contain several variables.
The constants, are <Product_Group>, <Product_Name> and <Table>. Only one of each always exists.
The variables would be the number of <Bullet> tags, the number of columns (total <TD> tags per row) and the number of rows themselves (<TR>). The sample below only shows a table with two rows (one being the header row). These XML files could contain as many as 20-50 additional rows beneath the header row, each representing a new product with a different SKU falling within the catagory indicated in the <Product_Group> (in this case "Euro Boards").
Firstly, I'm not sure where to begin writing an XSLT that would format my XML for import into a database, Filemaker or mySQL.
Secondly, I'm just not sure how to begin writing an XSLT which would work with so many variables.
Do you have any input which would help?
I've included sample code below:
******************************************************************************************
******************************************************************************************
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Product_Group>
<Product_Name>Euro Boards</Product_Name>
<Bullet>• Bullet copy 1</Bullet>
<Bullet>• Bullet copy 2</Bullet>
<Bullet>• Bullet copy 3</Bullet>
<TABLE>
<THR>
<TD>
<Chart_Header_Red>SKU</Chart_Header_Red>
</TD>
<TD>
<Chart_Header>Mfr. No. </Chart_Header>
</TD>
<TD>
<Chart_Header>Frame</Chart_Header>
</TD>
<TD>
<Chart_Header>Size (W x H)</Chart_Header>
</TD>
<TD>
<Chart_Header>Qty. </Chart_Header>
</TD>
<TD>
<Chart_Header>Sale Price</Chart_Header>
</TD>
<THR>
<TR>
<TD>
<SKU>46217034 </SKU>
</TD>
<TD>
<Chart_Copy>QRP564T </Chart_Copy>
</TD>
<TD>
<Chart_Copy>Titanium Finish</Chart_Copy>
</TD>
<TD>
<Chart_Copy>4 x 3 </Chart_Copy>
</TD>
<TD>
<Chart_Copy>EA </Chart_Copy>
</TD>
<TD>
<Price>$39.95</Price>
</TD>
</TR>
</TABLE>
</Product_Group>
******************************************************************************************
******************************************************************************************
I'm just not at all certain where to even start.
Thank you in advance for any help you can offer.
-lmm
The constants, are <Product_Group>, <Product_Name> and <Table>. Only one of each always exists.
The variables would be the number of <Bullet> tags, the number of columns (total <TD> tags per row) and the number of rows themselves (<TR>). The sample below only shows a table with two rows (one being the header row). These XML files could contain as many as 20-50 additional rows beneath the header row, each representing a new product with a different SKU falling within the catagory indicated in the <Product_Group> (in this case "Euro Boards").
Firstly, I'm not sure where to begin writing an XSLT that would format my XML for import into a database, Filemaker or mySQL.
Secondly, I'm just not sure how to begin writing an XSLT which would work with so many variables.
Do you have any input which would help?
I've included sample code below:
******************************************************************************************
******************************************************************************************
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Product_Group>
<Product_Name>Euro Boards</Product_Name>
<Bullet>• Bullet copy 1</Bullet>
<Bullet>• Bullet copy 2</Bullet>
<Bullet>• Bullet copy 3</Bullet>
<TABLE>
<THR>
<TD>
<Chart_Header_Red>SKU</Chart_Header_Red>
</TD>
<TD>
<Chart_Header>Mfr. No. </Chart_Header>
</TD>
<TD>
<Chart_Header>Frame</Chart_Header>
</TD>
<TD>
<Chart_Header>Size (W x H)</Chart_Header>
</TD>
<TD>
<Chart_Header>Qty. </Chart_Header>
</TD>
<TD>
<Chart_Header>Sale Price</Chart_Header>
</TD>
<THR>
<TR>
<TD>
<SKU>46217034 </SKU>
</TD>
<TD>
<Chart_Copy>QRP564T </Chart_Copy>
</TD>
<TD>
<Chart_Copy>Titanium Finish</Chart_Copy>
</TD>
<TD>
<Chart_Copy>4 x 3 </Chart_Copy>
</TD>
<TD>
<Chart_Copy>EA </Chart_Copy>
</TD>
<TD>
<Price>$39.95</Price>
</TD>
</TR>
</TABLE>
</Product_Group>
******************************************************************************************
******************************************************************************************
I'm just not at all certain where to even start.
Thank you in advance for any help you can offer.
-lmm
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service