Jump to content

How to retrieve list of String in xslt


Guest Denis

Recommended Posts

Guest Denis

Hi!i,m new with xslt and xml...but i have succeed partially...I have a probleme and I dont know why I cant start a topic to put it there!!!I can display a list of object but the list of String I cant!there is the code..xml file:<?xml version='1.0' encoding='UTF-8' ?> <CaDetailVo> <caDetailTaskList> <CaDetailTaskVo> <containmentPlan/> <implementationPlan>implementation plan 1</implementationPlan> <longTermCa/> <rootCauseAnalysis>root cause 1</rootCauseAnalysis> </CaDetailTaskVo> <CaDetailTaskVo> <containmentPlan/> <implementationPlan>implementation plan 2</implementationPlan> <longTermCa/> <rootCauseAnalysis>root cause 2</rootCauseAnalysis> </CaDetailTaskVo> </caDetailTaskList> <snList> <String>123456789</String> <String>987654321</String> <String>112233445</String> </snList></CaDetailVo>no problem with the caDetailTaskList because I have an other level(vo) inside it..but the list of string :Spart of XSLT file:<fo:block font-size="10pt"><fo:table table-layout="fixed" width="100%" border-collapse="separate" > <fo:table-column column-width="13cm"/> <fo:table-body> <xsl:apply-templates select="caDetailTaskList"/> </fo:table-body></fo:table></fo:block><fo:block font-size="10pt" font-weight="normal" line-height="20pt">SERIAL NUMBER</fo:block><fo:block font-size="10pt"><fo:table table-layout="fixed" width="100%" border-collapse="collapse" > <fo:table-column column-width="8cm" /> <fo:table-body> <xsl:apply-templates select="snList"/> </fo:table-body> </fo:table></fo:block><!-- ========================= --><!-- child element: caDetailTaskList --><!-- ========================= --><xsl:template match="caDetailTaskList"> <fo:table-row break-before="page"> <fo:table-cell> <fo:block> <fo:table table-layout="fixed" width="100%" border-collapse="separate"> <fo:table-column column-width="4cm"/> <fo:table-column column-width="4cm"/> <fo:table-column column-width="5cm"/> <fo:table-header> <fo:table-row font-family="sans-serif" font-size="10" background-color="rgb(200,200,255)" color="blue"> <fo:table-cell><fo:block font-weight="bold" >Implementation Plan</fo:block></fo:table-cell> <fo:table-cell><fo:block font-weight="normal">RootCause Analysis</fo:block></fo:table-cell> <fo:table-cell><fo:block font-weight="normal"></fo:block></fo:table-cell> </fo:table-row> </fo:table-header> <fo:table-body> <xsl:apply-templates select="CaDetailTaskVo"/> </fo:table-body> </fo:table> </fo:block> </fo:table-cell> </fo:table-row></xsl:template><!-- ========================= --><!-- child element: CaDetailTaskVo --><!-- ========================= --><xsl:template match="CaDetailTaskVo"> <fo:table-row break-before="page"> <fo:table-cell> <fo:block> <xsl:value-of select="implementationPlan"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:value-of select="rootCauseAnalysis"/> </fo:block> </fo:table-cell> </fo:table-row></xsl:template><!-- ========================= --><!-- child element: snList --><!-- ========================= --><xsl:template match="snList"> <fo:table-row > <fo:table-cell> <fo:block> <fo:table table-layout="fixed" width="100%" border-collapse="separate"> <fo:table-column column-width="10cm"/> <fo:table-body> <fo:table-row > <fo:table-cell> <fo:block> <xsl:value-of select="String"/> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:block> </fo:table-cell> </fo:table-row></xsl:template>---------------------Do you know how I can read the list of String like in my xml file? or I have to put the String in an object before the insertion in the list??it's a blocking issue at work...would appreciate with a quick answer ;-)by the way...im using FOP jar file(0.93) to produce pdf from the xml and xsl file ;-)thanks,Denis

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...