Embedded XSLT

Soldato
Joined
11 Feb 2004
Posts
4,532
Location
Surrey, UK
I'm hoping someone can help me create XSLT and embed it into the following XML file. It's a big ask I know. I've not succeeded so far and I'm wondering if it's because the XML uses the MS Office schema.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<ss:Styles/>
<ss:Worksheet ss:Name="Information">
<ss:Table>
<ss:Row>
<ss:Cell>
<ss:Data ss:Type="String">Column Heading 1</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Column Heading 2</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Column Heading 3</ss:Data>
</ss:Cell>
</ss:Row>
<ss:Row>
<ss:Cell>
<ss:Data ss:Type="String">Column Data Row 1</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Column Data Row 2</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Column Data Row 3</ss:Data>
</ss:Cell>
</ss:Row>
</ss:Table>
</ss:Worksheet>
</ss:Workbook>
 
Soldato
OP
Joined
11 Feb 2004
Posts
4,532
Location
Surrey, UK
Hi Andy,
Been on hols but damn happy to see a reply to this thread!
Basically I need to transform the XML into CSV using XSLT so the information can be fed into an application which excepts XML but only when XSLT is used.
The XSLT would be separate from the original XML as opposed to inline.
I'll try your sample out and get back to you - cheers! :)

Domo
 
Soldato
OP
Joined
11 Feb 2004
Posts
4,532
Location
Surrey, UK
This should help clear things up and describes exactly what it is I've been trying to achieve.
XML:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<ss:Styles/>
<ss:Worksheet ss:Name="Information">
<ss:Table>
<ss:Row>
<ss:Cell>
<ss:Data ss:Type="String">Make</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Model</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Colour</ss:Data>
</ss:Cell>
</ss:Row>
<ss:Row>
<ss:Cell>
<ss:Data ss:Type="String">Ford</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Focus</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Green</ss:Data>
</ss:Cell>
</ss:Row>
<ss:Row>
<ss:Cell>
<ss:Data ss:Type="String">Volkswagen</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Golf</ss:Data>
</ss:Cell>
<ss:Cell>
<ss:Data ss:Type="String">Black</ss:Data>
</ss:Cell>
</ss:Row>
</ss:Table>
</ss:Worksheet>
</ss:Workbook>

The output should look like:
Make,Model,Colour
Ford,Focus,Green
Volkswagen,Golf,Black

By all means message me if needed. :)
 
Soldato
OP
Joined
11 Feb 2004
Posts
4,532
Location
Surrey, UK
That would be ideal - but the answer is no because it's for an automated feed from a cloud db into a locally hosted application.
The cloud produces the XML file which the app cannot read - hence the requirement for XSLT to perform the necessary transformation since the app can read in CSV.
 
Back
Top Bottom