I am just getting to grips with XML and I was wondering if you could help me
with something that no-one seems able or willing to help with..
I have an XSLT file which should be transforming a straight XML file
To another XML file
As you can see the second one is not being output with the element names I
have defined in the XSLT, its just plain text.
The XSLT is given below, all I need is a bit of info on how to make it
output in the same way as the original file (plain xml).
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match = "/">
<xsl:for-each select="Booking/segment">
<xsl:element name="res">
<xsl:value-of select="Reserva tionNumber" />
</xsl:element>
<xsl:element name="Nights">
<xsl:value-of select="Numbero fDays" />
</xsl:element>
<xsl:element name="MAdults">
<xsl:value-of select="Numbero fMaleAdults" />
</xsl:element>
<xsl:element name="FAdults">
<xsl:value-of select="Numbero fFemaleAdults" />
</xsl:element>
<xsl:element name="MChildren ">
<xsl:value-of select="Numbero fMaleChildren" />
</xsl:element>
<xsl:element name="FChildren ">
<xsl:value-of select="Numbero fFemaleChildren " />
</xsl:element>
<xsl:element name="From">
<xsl:value-of select="From" />
</xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Thanks in advance
with something that no-one seems able or willing to help with..
I have an XSLT file which should be transforming a straight XML file
To another XML file
As you can see the second one is not being output with the element names I
have defined in the XSLT, its just plain text.
The XSLT is given below, all I need is a bit of info on how to make it
output in the same way as the original file (plain xml).
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match = "/">
<xsl:for-each select="Booking/segment">
<xsl:element name="res">
<xsl:value-of select="Reserva tionNumber" />
</xsl:element>
<xsl:element name="Nights">
<xsl:value-of select="Numbero fDays" />
</xsl:element>
<xsl:element name="MAdults">
<xsl:value-of select="Numbero fMaleAdults" />
</xsl:element>
<xsl:element name="FAdults">
<xsl:value-of select="Numbero fFemaleAdults" />
</xsl:element>
<xsl:element name="MChildren ">
<xsl:value-of select="Numbero fMaleChildren" />
</xsl:element>
<xsl:element name="FChildren ">
<xsl:value-of select="Numbero fFemaleChildren " />
</xsl:element>
<xsl:element name="From">
<xsl:value-of select="From" />
</xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Thanks in advance
Comment