Its fair that i put some effort in trying out this myself first, here is my xml code. My xsl works fine but i can only get to the parent node and i dont know how to get the text from the child element(Entries\Reference)
<?xml version="1.0"?>
<Catalog>
<Book id="bk101">
<Author>Garghentini, Davide</Author>
<Title>XML Developer's Guide</Title>
<Genre>Computer</Genre>
<Price>44.95</Price>
<a:Entries>
<a:Reference>
<a:ISBN>a0WER8501d2b60c73567f83</a:ISBN>
<a:Description>Classics</a:Description>
<a:EventDate>2015-08-25T00:00:00</a:EventDate>
<a:UnitCost>750.0000</a:UnitCost>
<a:UnitPrice>1380.0000</a:UnitPrice>
<a:UnitPriceInBaseCurrency>1380.0000</a:UnitPriceInBaseCurrency>
</a:Reference>
<a:Reference>
<a:ISBN>a0cVSFWREW01d2b60c73567f83</a:ISBN>
<a:Description>horror</a:Description>
<a:EventDate>2015-6-25T00:00:00</a:EventDate>
<a:UnitCost>150.0000</a:UnitCost>
<a:UnitPrice>130.0000</a:UnitPrice>
<a:UnitPriceInBaseCurrency>130.0000</a:UnitPriceInBaseCurrency>
</a:Reference>
</a:Entries>
<PublishDate>2000-10-01</PublishDate>
<Description>applications with XML.</Description>
</Book>
<Book id="bk102">
<Author>Garcia, Debra</Author>
<Title>Midnight Rain</Title>
<Genre>Fantasy</Genre>
<Price>5.95</Price>
<PublishDate>2000-12-16</PublishDate>
<Description>A former architect battles corporate zombies.</Description>
</Book>
</Catalog>
This is my xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" >
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/">Author,Title,Genre,Price,PublishDate,Description
<xsl:for-each select="//Book">
<xsl:value-of select="concat( Author,',',Title,',',Genre,',',Price,',',PublishDate,',',Description,'
')"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
and this is the output in csv
Author,Title,Genre,Price,PublishDate,Description
Garghentini, Davide,XML Developer's
Guide,Computer,44.95,2000-10-01,applications with XML.
Garcia, Debra,Midnight Rain,Fantasy,5.95,2000-12-16,A former architect
battles corporate zombies.
But i want to also get the output from the child element so i want to see something like this and also its values.i dont know how i can achieve this.
Author,Title,Genre,Price,PublishDate,Description,ISBN,Description,EventDate,UnitCost
a:without binding it to a namespace. That's not allowed in XML and a document like this cannot be processed at all.