以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  xslt 问题,酬谢  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=128103)


--  作者:testok
--  发布时间:3/20/2014 7:46:00 PM

--  xslt 问题,酬谢

写类似下面的东西,就3个小功能点。做个判断,然后相应的改另外一个字段的值
qq 1984415
300酬谢
<xsl:template match="*[contains(local-name(),'__')]">
                                                                                <xsl:element name="{substring-before(local-name(),'__')}">
                                                                                        <xsl:for-each select="@*">
                                                                                                <xsl:copy/>
                                                                                        </xsl:for-each>
                                                                                        <xsl:apply-templates select="." mode="TechnicalFields"/>
                                                                                        <xsl:apply-templates select="node()"/>
                                                                                </xsl:element>
                                                                        </xsl:template>
                                                                        <xsl:template match="/*">
                                                                                <xsl:variable name="ns_prefix" select="substring-before(name(),':')"/>
                                                                                <xsl:element name="{$ns_prefix}:PurchaseOrderBundleMaintainRequest_sync" namespace="http://sap.com/xi/SAPGlobal20/Global">
                                                                                        <xsl:for-each select="@*">
                                                                                                <xsl:copy/>
                                                                                        </xsl:for-each>
                                                                                        <BasicMessageHeader xmlns=""/>
                                                                                        <xsl:apply-templates/>
                                                                                </xsl:element>
                                                                        </xsl:template>
                                                                        <xsl:template match="//BuyerParty">
                                                                                <xsl:copy>
                                                                                        <xsl:attribute name="actionCode"><xsl:value-of select="'04'"/></xsl:attribute>
                                                                                        <xsl:for-each select="@*">
                                                                                                <xsl:copy/>
                                                                                        </xsl:for-each>
                                                                                        <xsl:apply-templates/>
                                                                                </xsl:copy>
                                                                        </xsl:template>


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
93.750ms