For each for Apache FOP

会有一股神秘感。 提交于 2019-12-13 08:44:48

问题


I have a question. This is my xml

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

How can I write for-each for Items and Locations elements in xsl-fo.xsl I need render PDF file via Apache FOP. This is fragment of xsl file, but it's not correct:

<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>   

来源:https://stackoverflow.com/questions/43455837/for-each-for-apache-fop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!