それは、XMLと似になるとハロー、すべての最初の が、私は私の初心者の質問で私を罰するいけないしてください、非常に精通していないです:Dどのように内部のすべてのパラメータを避けるために?
私はこのように見ているxmlファイルを持っている:
<?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>
それから私はこのように見ているXSLTファイルを得た:
<?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>
私は2つのパラメータ「PROJECT_NAME」と「project_attribute」を避けたいです。
<?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>
しかし、私は何を取得することは、これは形質転換の後にある:
<?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>
テキストはそれにまだある私は、このような結果が欲しいです。どのように私はそれを修正することができます。私は間違って何をしていますか?どのようにパラメータを取得することができますが、その中のテキストなしで実現することができますか?このような私の例では、出力:あなたの助けを
<?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>
ありがとう:D
に役立ちます願っています - どの結果欲しいですか?あなたは、パラメータとその値なしで結果を求めました。最後に、値なしのパラメータを求めましたか? –
私はそれぞれの結果が欲しいです。 1つずつ:D – Camal