Hi, I'm new to XML and need some advice on XSL.
suppose i want to convert the following xml to
---------------------------------------------------
<?xml version="1.0"?>
<body>
<section>
<caption>previous history</caption>
<list>
<item>
<caption>diabetic ketoacidosis</caption>
<content>dk</content>
</item>
<item>
<caption>severe hypoglycaemia</caption>
<content>sh</content>
</item>
</list>
</section>
<section>
<caption>comments</caption>
<list>
<item>
<caption>disease description</caption>
<content>early stage</content>
</item>
</list>
</section>
</body>
-------------------------------------------------------
TO
-------------------------------------------------------
<body>
<previous history>
<list>
<diabetic ketoacidosis>dk</diabetic ketoacidosis>
<severe hypoglycaemia>sh</severe hypoglycaemia>
</list>
</previous history>
<comments>
<list>
<disease description>early stage</disease description>
</list>
</comments>
</body>
--------------------------------------------------------
My XSL is as below, but it is not correct
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xslutput method="xml" indent="yes"/>
<xsl:template match="/">
<body>
<xsl:apply-templates select="/levelone/body/section"/>
</body>
</xsl:template>
<xsl:template match="section">
<xsl:element name="{./caption}">
<list>
<xsl:element name="{../list/item/caption}">
<xsl:value-of select="../list/item/content"/>
</xsl:element>
</list>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-----------------------------------------------------------
any kind soul pls advise
suppose i want to convert the following xml to
---------------------------------------------------
<?xml version="1.0"?>
<body>
<section>
<caption>previous history</caption>
<list>
<item>
<caption>diabetic ketoacidosis</caption>
<content>dk</content>
</item>
<item>
<caption>severe hypoglycaemia</caption>
<content>sh</content>
</item>
</list>
</section>
<section>
<caption>comments</caption>
<list>
<item>
<caption>disease description</caption>
<content>early stage</content>
</item>
</list>
</section>
</body>
-------------------------------------------------------
TO
-------------------------------------------------------
<body>
<previous history>
<list>
<diabetic ketoacidosis>dk</diabetic ketoacidosis>
<severe hypoglycaemia>sh</severe hypoglycaemia>
</list>
</previous history>
<comments>
<list>
<disease description>early stage</disease description>
</list>
</comments>
</body>
--------------------------------------------------------
My XSL is as below, but it is not correct
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xslutput method="xml" indent="yes"/>
<xsl:template match="/">
<body>
<xsl:apply-templates select="/levelone/body/section"/>
</body>
</xsl:template>
<xsl:template match="section">
<xsl:element name="{./caption}">
<list>
<xsl:element name="{../list/item/caption}">
<xsl:value-of select="../list/item/content"/>
</xsl:element>
</list>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-----------------------------------------------------------
any kind soul pls advise