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