У меня есть XML-документ следующим образом:
<OrdersSchedulePDFView>
<OrdersSchedulePDFViewRow>
<Items>
<ItemDesc>Content1</ItemDesc>
<ItemDesc>Content2</ItemDesc>
</Items>
<Locations>
<LocName>Content3</LocName>
<LocName>Content4</LocName>
</Locations>
</OrdersSchedulePDFViewRow>
</OrdersSchedulePDFView>
Пожалуйста, дайте мне пример файла xsl, где я могу получить элементы ItemDesc и LocName через шаблон. Заранее спасибо Это мой xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:template match="OrdersSchedulePDFView">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:for-each select="OrdersSchedulePDFViewRow">
<fo:page-sequence master-reference="all">
<fo:flow flow-name="xsl-region-body">
<xsl:template match="Locations">
<xsl:copy>
<xsl:apply-templates select="LocName"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Items">
<xsl:copy>
<xsl:apply-templates select="ItemDesc"/>
</xsl:copy>
</xsl:template>
</fo:flow>
</fo:page-sequence>
</xsl:for-each>
</fo:root>
</xsl:template>
</xsl:stylesheet>
<xsl:template match="LocName">
(если для элементов, которые мы, возможно, не видим, нет пространства имен), но что должен делать шаблон? - person Stefan Hegny   schedule 25.04.2017<xsl:template match="OrdersSchedulePDFViewRow"> <xsl:value-of select="OrdersSchedulePDFViewRow/Locations/LocName"/>
и познакомьтесь с xslt/xpath и следуйте совету michael.hor257k - person Stefan Hegny   schedule 25.04.2017