对于每个Apache FOP

时间:2017-04-17 16:57:10

标签: xml xslt xsl-fo apache-fop

我有一个问题。这是我的xml

<OrdersSchedulePDFView>
 <OrdersSchedulePDFViewRow>
  <ScheduleDesc>График № 6723</ScheduleDesc>
  <Ridesc>Каждый день</Ridesc>
  <Items>
     <ItemDesc>Пельмени Родной Дом Премиум 1кг пл/пак</ItemDesc>
     <ItemDesc>Пельмени Алекон Мини 900г пл/пак</ItemDesc>
  </Items>
  <Locations>
     <LocName>Ноймайер</LocName>
     <LocName>Беллинсгаузен</LocName>
  </Locations>
 </OrdersSchedulePDFViewRow>
</OrdersSchedulePDFView>

如何为xsl-fo.xsl中的Items和Locations元素编写for-each 我需要通过Apache FOP渲染PDF文件。 这是xsl文件的片段,但它不正确:

<xsl:template match="OrdersSchedulePDFView">                
        <xsl:for-each select="./OrdersSchedulePDFViewRow">        

           <xsl:value-of select="ScheduleDesc"/>                            
            <xsl:value-of select="Ridesc"/>                                     
              <xsl:template match="OrdersSchedulePDFViewRow">
               <xsl:for-each select="./Locations">
                  <xsl:value-of select="LocName"/>          
                </xsl:for-each>             
                <xsl:for-each select="./Items">                                                                
                 <xsl:value-of select="ItemDesc"/>
                </xsl:for-each>             

        </xsl:for-each>
    </fo:root>
</xsl:template>   

0 个答案:

没有答案