Xml-fo

wxdqz

New Member
What is wrong with this code .
why the for-each loop not working?

<?xml version="1.0" encoding="UTF-8" ?>
- <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:ns1="urn:GoogleSearch" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns1:GoogleSearchResult">
- <xsl:template match="/">
- <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <fo:layout-master-set>
- <fo:simple-page-master master-name="general" page-height="6in" margin-bottom="0.5in" margin-left="1in" margin-right="1in">
<fo:region-body margin-top="0.5in" margin-bottom="0.5in" />
<fo:region-before extent="1.0in" />
<fo:region-after extent="0.5in" />
</fo:simple-page-master>
- <fo:simple-page-master master-name="otherpages" page-height="6in" margin-bottom="0.5in" margin-left="1in" margin-right="1in">
<fo:region-body margin-top="0.5in" margin-bottom="0.5in" />
<fo:region-before extent="1.0in" />
<fo:region-after extent="0.5in" />
</fo:simple-page-master>
</fo:layout-master-set>
- <fo:page-sequence master-reference="general" initial-page-number="1">
- <fo:flow flow-name="xsl-region-body">
- <fo:block font-size="30pt" font-family="Verdana" background-color="#eeddff">
<fo:external-graphic src=http://www.webdeveloper.com/forum/archive/index.php/"file:logo_sm.gif" />
</fo:block>
- <fo:block>
Results from
<xsl:value-of select="//return/startIndex" />
-
<xsl:value-of select="//return/endIndex" />
from total of
<xsl:value-of select="//return/estimatedTotalResultsCount" />
for
<xsl:value-of select="//return/searchQuery" />
in (
<xsl:value-of select="//return/searchTime" />
) seconds.
</fo:block>
</fo:flow>
</fo:page-sequence>
- <fo:page-sequence master-reference="otherpages" initial-page-number="auto">
- <fo:static-content flow-name="xsl-region-before">
- <fo:block font-size="20pt" font-family="serif" line-height="30pt" background-color="yellow">
p.
<fo:page-number />
Result for query
<xsl:value-of select="//return/searchQuery" />
</fo:block>
</fo:static-content>
- <fo:flow flow-name="xsl-region-body">
- <fo:block>
<xsl:apply-templates select="//return/resultElements/item" />
</fo:block>
</fo:flow>
</fo:page-sequence>
- <xsl:template match="//return/resultElements/item">
- <xsl:for-each select="//return/ResultElements/item">
- <fo:block font-size="12pt" color="green">
<xsl:value-of select="//return/ResultElements/directoryTitle" />
</fo:block>
- <fo:block font-size="12pt" color="green">
<xsl:value-of select="//return/ResultElements/summary" />
</fo:block>
- <fo:block font-size="12pt" color="green">
<xsl:value-of select="//return/ResultElements/snippet" />
</fo:block>
- <fo:block font-size="12pt" color="green">
<xsl:value-of select="//return/resultElements/item/URL" />
-
<xsl:value-of select="//return/resultElements/item/cachedSize" />
- cached >
</fo:block>
</xsl:for-each>
</xsl:template>
</fo:root>
</xsl:template>
</xsl:stylesheet>
 
Back
Top