Xml 删除子标记并将其值与父标记的名称关联
请问,使用XSLT1.0是否可以实现这一点 示例输入是Xml 删除子标记并将其值与父标记的名称关联,xml,xslt,transform,Xml,Xslt,Transform,请问,使用XSLT1.0是否可以实现这一点 示例输入是 <Variable_Attributes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <Row> <MATNR>3006921_CAR</MATNR> <REFERENCE> <uom>EA</uom> <p
<Variable_Attributes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<Row>
<MATNR>3006921_CAR</MATNR>
<REFERENCE>
<uom>EA</uom>
<product_id>3006921_EA</product_id>
<quantity>6</quantity>
</REFERENCE>
</Row>
<Row>
<MATNR>3006921_CAR</MATNR>
<REFERENCE>
<uom>CAR</uom>
<product_id>3006921_EA</product_id>
<quantity>6</quantity>
</REFERENCE>
</Row>
</Variable_Attributes>
xsl:element
允许您计算结果元素的名称,例如
<xsl:template match="REFERENCE">
<xsl:element name="{local-name()}{uom}">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="uom"/>
当然,基本处理将由标识转换模板完成
<xsl:template match="REFERENCE">
<xsl:element name="{local-name()}{uom}">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="uom"/>