Hallo, first of all, i am not very familiar when it comes to xml and similiar, so please dont punish me with my beginner question :D
I have a xml file looking like this :
<?xml version="1.0" encoding="utf-8" ?>
<mainstuff>
<category_major>
<project_name>Dream</project_name>
<project_attribute>Version 1.0</project_attribute>
<category_A></category_A>
<category_B></category_B>
<category_C></category_C>
</category_major>
</mainstuff>
Then i got a XSLT File looking like this :
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
<xsl:output method="xml" indent="yes"/>
<!--<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>-->
<xsl:template match="/">
<xsl:element name="mainstuff">
<xsl:attribute name="version">1.0</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="category_major">
<xsl:element name="category_major">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="category_A">
<xsl:element name="category_A">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="category_B">
<xsl:element name="category_B">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="category_C">
<xsl:element name="category_C">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
I want to avoid the two parameters "project_name" and "project_attribute". I want a result like this :
<?xml version="1.0" encoding="utf-8" ?>
<mainstuff>
<category_major>
<category_A></category_A>
<category_B></category_B>
<category_C></category_C>
</category_major>
</mainstuff>
But what i get is this after tranformation :
<?xml version="1.0" encoding="utf-8"?>
<mainstuff version="1.0">
<category_major>
**Dream
Version 1.0**
<category_A />
<category_B />
<category_C />
</category_major>
</mainstuff>
The text is still in it. How can i fix it. What am I doing wrong ? And how can I realise to get Parameters but without the text within it ? In my example an output like this :
<?xml version="1.0" encoding="utf-8" ?>
<mainstuff>
<category_major>
**<project_name></project_name>
<project_attribute></project_attribute>**
<category_A></category_A>
<category_B></category_B>
<category_C></category_C>
</category_major>
</mainstuff>
Thanks for your help :D