Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Help in the xsl problem

From: "sonia" <sonia.kenkre@-----.--->
To: NULL
Date: 5/10/2005 11:15:00 PM
Hi i have developed an xml as follows

<?xml version="1.0" encoding="UTF-8"?>
<object>
	 <page>
		 <element-1>1</element-1>
		 <element-2>2</element-2>
		 <element-3>
			  <next-1>a</next-1>
			  <next-2>b</next-2>
		 </element-3>
	 </page>
		 <page>
		 <element-1>5</element-1>
		 <element-2>6</element-2>
		 <element-3>
			  <next-1>x</next-1>
			  <next-2>y</next-2>
		 </element-3>
	</page>
</object>
I require the following output on two seperate pages

Element1  1      Element2     2

Next-1     Next-2
a               b

and


Element1  5      Element2     6

Next-1     Next-2
x              y


The output that i am currently getting is
Element1  1      Element2     2
Element1  5      Element2     6

Next-1     Next-2
a            b
x            y


My xsl is as follows

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple A4">
	<fo:region-body/>

</fo:simple-page-master>
</fo:layout-master-set>


			<fo:page-sequence master-reference="simple A4">

				<fo:flow flow-name="xsl-region-body">

				<fo:block>
				<fo:table  table-layout="fixed" >
				<fo:table-column column-width="5cm"/>
				<fo:table-column column-width="5cm"/>
				<fo:table-column column-width="5cm"/>
				<fo:table-column column-width="5cm"/>

					<fo:table-body>

									<xsl:apply-templates select="object/page"/>

					</fo:table-body>
				</fo:table>
				</fo:block>


					<fo:table>
					<fo:table-column  column-width="3cm" />
					<fo:table-column  column-width="3cm"/>

					<fo:table-header>
			<fo:table-row>
				<fo:table-cell padding="2pt" border="0.5pt solid black">
					<fo:block>Next-1</fo:block>
				</fo:table-cell>
				<fo:table-cell padding="2pt" border="0.5pt solid black">
					<fo:block>Next-2</fo:block>
				</fo:table-cell>
			</fo:table-row>
		</fo:table-header>
					<fo:table-body>
									<xsl:apply-templates select="object/page/element-3"/>
					</fo:table-body>
				</fo:table>

				</fo:flow>
				</fo:page-sequence>
				</fo:root>
				</xsl:template>




				<xsl:template match="object/page">

				<fo:table-row>
			    <fo:table-cell>
				<fo:block>
						 Element 1:
		          </fo:block>
		          </fo:table-cell>
		          <fo:table-cell>
			  	<fo:block>
					   <xsl:value-of select="element-1" />
		          </fo:block>
		          </fo:table-cell>
		          <fo:table-cell>
				<fo:block>
					Element 2
		          </fo:block>
		          </fo:table-cell>
		          <fo:table-cell>
				  <fo:block>
    			     <xsl:value-of select="element-2"/>
				</fo:block>
				</fo:table-cell>
				</fo:table-row>

	</xsl:template>

		<xsl:template match="object/page/element-3">
		<fo:table-row>
				<fo:table-cell  border="0.5pt solid black">
			<fo:block>
					<xsl:value-of select="next-1" />
			</fo:block>
			</fo:table-cell>
			<fo:table-cell  border="0.5pt solid black">
			 <fo:block>
					<xsl:value-of select="next-2"/>
			</fo:block>
			</fo:table-cell>
			</fo:table-row>
		</xsl:template>


</xsl:stylesheet>


Please help as soon as possible

Thanks
Sonia



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent