소스 XML :XSLT : 합계
<Root>
<Data>
<Code>A</Code>
<Value>10</Value>
</Data>
<Data>
<Code>A</Code>
<Value>10</Value>
</Data>
<Data>
<Code>B</Code>
<Value>10</Value>
</Data>
<Data>
<Code>A</Code>
<Value>2</Value>
</Data>
<Data>
<Code>C</Code>
<Value>10</Value>
</Data>
<Data>
<Code>A</Code>
<Value>5</Value>
</Data>
<Data>
<Code>B</Code>
<Value>4</Value>
</Data>
<Data>
<Code>A</Code>
<Value>10</Value>
</Data>
<Data>
<Code>C</Code>
<Value>10</Value>
</Data>
<Data>
<Code>B</Code>
<Value>10</Value>
</Data>
<Data>
<Code>A</Code>
<Value>10</Value>
</Data>
<Data>
<Code>C</Code>
<Value>5</Value>
</Data>
....
</Root>
XSL-FO 코드 :
내 코드 (XSL-FO)은 각 열은 'A', 'B'의 내용을 포함 3 열을 포함, 'C'각 열이 나는 'A'의이 부분 합계를 얻을했습니다 테이블 바닥 글에 & 'C' 'B', 'B'의 값을 표시 할
<fo:table-body>
<xfd:table-row-repeat xpath="Root/Data" font-family="Arial Narrow" font-size="10pt" padding-after="0.55cm">
<xsl:if test="Code='A'">
<fo:table-cell>
<fo:block height="12pt">Value
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block height="12pt" border="0.1pt solid black" text-align="center">
<xsl:value-of select="Value" />
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block height="12pt">Points</fo:block>
</fo:table-cell>
</xsl:if>
</xfd:table-row-repeat>
</fo:table-body>
같은 코드, 'C'
(루트 데이터/코드 = 'A'/ 경우), 다른 2 열 ('B'& 'C')이 같은 부호로 구성<fo:table-body>
<xfd:table-row-repeat xpath="Root/Data" font-family="Arial Narrow" font-size="10pt" padding-after="0.55cm">
<xsl:if test="Code='A'">
<fo:table-cell>
<fo:block height="12pt">SubTotal
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block height="12pt" border="0.1pt solid black" text-align="center">
<--Here Sum of first 15 A's. if the A's or B's or C's exceed by 15, then the table flows to 2nd Page. In that case, 1st Page table-footer shows individual subtotals of first 15 A's, 15 B's and C's. In 2nd Page, the subtotals should contain Subtotal of first 15 A's+ Succeeding A's, in the same way B's and C's -->
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block height="12pt">Points</fo:block>
</fo:table-cell>
</xsl:if>
</xfd:table-row-repeat>
</fo:table-body>
15,여기에 XSL-FO 코드는 하나의 칼럼에 대해 도시된다. 세부
조건 :
Condition 1): when Root/Data/Code = 'A' or 'B' or 'C'
i need individual totals of 'A', 'B' and 'C' in Table-Footer individual Column.
Condition 2): inturn if individual count(Root/Data/Code) of 'A', 'B' & 'C' crosses 15. Then Page flows to 2nd Page then Table-Footer in 2nd Page needs to contains subtotal of first 15 A's + the sum of succeeding A's in the same way for B's And C's
즉 A의 20, 10의 B, 25의 C에서의 소스 XML에있는 경우. 'A', 'B'와 'C'의 합을 평가하기위한 코드 태그 통해 그룹화하여 키
In 1st Page, Table-Footer
SubtotalI(Value of 15 A's)=
SubtotalII(Value 10 B's)=
SubtotalIII(Value 15 C's)=
In 2nd Page, Table-Footer
SubtotalI(15 A's+ next 5 A's)=
SubtotalII(Value 10 B's)= <!--No Change as count of B's is less than 15 -->
SubtotalIII(15 C's + next 10 C's)=
나는 XSL을 사용하여이 논리를 시도하고있다. 내가 XSLT에 익숙하지 않기 때문에 xsl : key를 사용하여이 논리를 풀기가 너무 어렵다. 아무도이 논리를 해결하는 데 도움이 될 수 있습니까?
미리 감사드립니다.
XSLT에서 수행해야하는 작업이 아닙니다. XSL 변환은 문서의 구조를 변환하는 데 적합합니다. 그들은 논리 및 조건부 계산을 적용하는 데 그리 좋지 않습니다. – ColinE
질문을 다시 말씀해 주시겠습니까? 당신이 얻고 자하는 것이 확실하지 않습니다. – Lloyd
나는 나의 질문을 훨씬 더 분명하게했다. 지금 확인하십시오 – BVS