xslt 2.0 分组

把数据拆成200个一组

 

xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
    <xsl:template match="/">
        <a>
            <xsl:for-each-group select="x/data" group-adjacent="(position()-1) idiv 200 ">
                <sfdc:create xmlns:sfdc="urn:partner.soap.sforce.com">
                    <xsl:for-each select="current-group()">
                        <sObjects>
                            <type>bbbbbtype>
                            <Material__r>
                                <type>dddtype>
                                <PN_NO__c>
                                    <xsl:value-of select="material"/>
                                PN_NO__c>
                            Material__r>
                            <Sub_Material__r>
                                <type>Product__ctype>
                                <PN_NO__c>
                                    <xsl:value-of select="sub_material"/>
                                PN_NO__c>
                            Sub_Material__r>
                            <Plant__c>
                                <xsl:value-of select="plant"/>
                            Plant__c>
                        sObjects>
                    xsl:for-each>
                sfdc:create>
            xsl:for-each-group>
        a>
    xsl:template>
xsl:stylesheet>

 

转载于:https://www.cnblogs.com/caihemm/p/7998135.html

你可能感兴趣的:(xslt 2.0 分组)