以文本方式查看主题

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


--  作者:testok
--  发布时间:3/20/2014 7:40: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>
更多 0
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
4,566.406ms