私は次のXMLを持っています
<?xml version="1.0" encoding="utf-8" ?>
<listGroup name="Chemistry Lists">
<chemistryAnalysisMethod tableName="List Chemistry Analysis Method">
<option>
<Value>BTEX</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Carbonates</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Chlorinated Hydrocarbons</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Explosives</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Halogenated Hydrocarbons</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Heavy Metals</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Herbicides</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Metals</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>OCP</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Organophosphorus Pesticides</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Organotins</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>PAH</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>PAH/Phenols</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>PCB</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Pesticides</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Phenols</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Phthalates</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>SVOC</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>TPH</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>VOC</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Dissolved Mercury by FIMS</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Dissolved Metals by ICPMS</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>Nitrite and Nitrate</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
<option>
<Value>OE - Wet</Value>
<ContainerType />
<RequiredVolume />
<Preservative />
<HoldTime />
<NumberofJars />
<Filtered>false</Filtered>
</option>
</chemistryAnalysisMethod>
</listGroup>
要素でソートしたいのでValue
、次のXSLTを書きました
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
exclude-result-prefixes="xsl">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="/serverInterface">
<interface>
<xsl:attribute name="firstFormAPIName">
<xsl:value-of select="@firstFormAPIName"/>
</xsl:attribute>
<xsl:for-each select="listGroup/*">
<xsl:sort select="@tableName" />
<xsl:element name="list">
<xsl:attribute name="tableName">
<xsl:value-of select="@tableName" />
</xsl:attribute>
</xsl:element>
</xsl:for-each>
<xsl:for-each select="form">
<xsl:if test="not(@enabled) or @enabled='always' or @enabled='yes'">
<xsl:element name="form">
<xsl:attribute name="apiName">
<xsl:value-of select="@apiName" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@title" />
</xsl:attribute>
<xsl:attribute name="template">
<xsl:value-of select="@template" />
</xsl:attribute>
<xsl:attribute name="fieldDataTableName">
<xsl:value-of select="@fieldDataTableName" />
</xsl:attribute>
<xsl:if test="not(@apiName='projectForm')">
<xsl:attribute name="parentFieldDataTableName">
<xsl:value-of select="@parentFieldDataTableName" />
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="*[not(name()='group') and not(name()='serverInterface') and not(name()='list')]" />
</xsl:element>
</xsl:if>
<xsl:for-each select="group">
<xsl:if test="not(@enabled) or @enabled='always' or @enabled='yes'">
<xsl:element name="form">
<xsl:attribute name="apiName">
<xsl:value-of select="@apiName" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@title" />
</xsl:attribute>
<xsl:attribute name="template">
<xsl:value-of select="@template" />
</xsl:attribute>
<xsl:attribute name="fieldDataTableName">
<xsl:value-of select="../@fieldDataTableName" />
</xsl:attribute>
<xsl:attribute name="parentFieldDataTableName">
<xsl:value-of select="../@parentFieldDataTableName" />
</xsl:attribute>
<xsl:apply-templates select="*[not(name()='group') and not(name()='serverInterface') and not(name()='list')]" />
</xsl:element>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</interface>
<xsl:apply-templates>
</xsl:apply-templates>
</xsl:template>
<xsl:template match ="listGroup/chemistryAnalysisMethod">
<xsl:apply-templates>
<xsl:sort select="Value"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="option">
<xsl:value-of select="Value"/>
</xsl:template>
<xsl:template match="*[not(name()='group') and not(name()='serverInterface') and not(name()='list')]">
<xsl:if test="not(@enabled) or @enabled='always' or @enabled='yes'">
<xsl:element name="{name()}">
<xsl:choose>
<xsl:when test="name()='shortcut'">
</xsl:when>
<xsl:when test="name()='label'">
</xsl:when>
<xsl:when test="name()='blowCount'">
</xsl:when>
<xsl:when test="name()='photo'">
</xsl:when>
<xsl:when test="name()='color'">
</xsl:when>
<xsl:when test="name()='munsellColor'">
</xsl:when>
<xsl:when test="name()='advancementMethod'">
</xsl:when>
<xsl:when test="name()='button'">
</xsl:when>
<xsl:when test="name()='constituentPercentages'">
</xsl:when>
<xsl:when test="name()='orientation'">
</xsl:when>
<xsl:when test="name()='gpsControl'">
</xsl:when>
<xsl:when test="name()='constituents'">
</xsl:when>
<xsl:when test="name()='rockType'">
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@requiredValue='always' or @requiredValue='yes'">
<xsl:attribute name="requiredValue">true</xsl:attribute>
<xsl:attribute name="apiName">
<xsl:value-of select="@apiName" />
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="requiredValue">false</xsl:attribute>
<xsl:attribute name="apiName">
<xsl:value-of select="@apiName" />
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="@*[not(name()='requiredValue' or name()='enabled' or name()='moveable')]">
<xsl:copy-of select="." />
</xsl:for-each>
<xsl:copy-of select="*" />
</xsl:element>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
私がそうしようとしているとき、変換は行われません。