Hello,

I have a large XML i am recovering data from. However,i cant seem to get more then 2 parameters out,whatever i type. i tried the following things already(without succes)

-Made a substring-between

-Made an extra call to a template and clarified additional parameters

-Changed the values of the xpath expressions themselves

<xsl:template name="output-tokens">
		<xsl:param name="list" />
		<xsl:param name="delimiter" />
		<xsl:param name="test"/>
		<xsl:param name="teller"/>
		<xsl:param name="firstrow"/>
		
			
        <xsl:param name="list1">Artikelnummer</xsl:param>
		<xsl:param name="list2">Omschrijving</xsl:param>
		<xsl:param name="list3">Afbeelding</xsl:param>
		<xsl:param name="list4">Prijs</xsl:param>
		<xsl:param name="list5">Verpakking</xsl:param>
		<xsl:param name="list6">Besteleenheid</xsl:param>
		<xsl:param name="list7">Prijseenheid</xsl:param>
		<xsl:param name="list8">Verp. per</xsl:param>
		<xsl:param name="list9">Vrij_1</xsl:param>
		<xsl:param name="list10">Vrij_2</xsl:param>
		<xsl:param name="list11">Vrij_3</xsl:param>
		<xsl:param name="list12">Vrij_4</xsl:param>
		<xsl:param name="list13">Vrij_5</xsl:param>
		<xsl:param name="list14">Vrij_6</xsl:param>
		<xsl:param name="list15">Vrij_7</xsl:param>
	
		
		
		
		
		
		
		<xsl:variable name="newlist">
			<xsl:choose>
				<xsl:when test="contains($list, $delimiter)"><xsl:value-of select="normalize-space($list)" /></xsl:when>
				<xsl:otherwise><xsl:value-of select="concat(normalize-space($list), $delimiter)"/></xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="first" select="substring-before($newlist, $delimiter)" />
		<xsl:variable name="remaining" select="substring-after($newlist, $delimiter)" />
		

		<xsl:variable name="newfirstrow">
			<xsl:choose>
				<xsl:when test="contains($firstrow, $delimiter)"><xsl:value-of select="normalize-space($firstrow)" /></xsl:when>
				<xsl:otherwise><xsl:value-of select="concat(normalize-space($firstrow), $delimiter)"/></xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="current" select="substring-before($newfirstrow, $delimiter)" />
		<xsl:variable name="firstremain" select="substring-after($newfirstrow, $delimiter)" />
		
	<!--	<xsl:if test="$remaining">
			<xsl:call-template name="subgroep">
				<xsl:with-param name="list" select="$remaining" />
				<xsl:with-param name="delimiter">
					<xsl:value-of select="$delimiter"/>
				</xsl:with-param>
				<xsl:with-param name="test" select="$test+1"/> 
				<xsl:with-param name="teller" select="$teller+1"/>
			</xsl:call-template>
			</xsl:if>-->
			
		
		
		<xsl:choose>
		<xsl:when test="$first">
		<fo:table-row>
		<fo:table-cell>
		<fo:block>Article No.</fo:block>
		</fo:table-cell>
		<fo:table-cell>
		<fo:block font-family="Times" font-size="7pt">
		<xsl:value-of select="$first" />
		</fo:block>
		</fo:table-cell>
		</fo:table-row>
		</xsl:when>
		
		<xsl:when test="5">
		<fo:table-row>
		<fo:table-cell>
		<fo:block>name</fo:block>
		</fo:table-cell>
		<fo:table-cell>
		<fo:block font-family="Times" font-size="7pt">
		<xsl:value-of select="5" />
		</fo:block>
		</fo:table-cell>
		</fo:table-row>
		</xsl:when>
		
		
		
		<xsl:when test="'6'">
		<fo:table-row>
		<fo:table-cell>
		<fo:block>Description</fo:block>
		</fo:table-cell>
		<fo:table-cell>
		<fo:block font-family="Times" font-size="7pt">
		<xsl:value-of select="'$list6'" />
		</fo:block>
		</fo:table-cell>
		</fo:table-row>
		</xsl:when>
		
		
		
		<xsl:when test="7">
		<fo:table-row>
		<fo:table-cell>
		<fo:block>Dimensions in mm</fo:block>
		</fo:table-cell>
		<fo:table-cell>
		<fo:block font-family="Times" font-size="7pt">
		<xsl:value-of select="$first" />
		</fo:block>
		</fo:table-cell>
		</fo:table-row>
		</xsl:when>
		
		
		
		<xsl:when test="8">
		<fo:table-row>
		<fo:table-cell>
		<fo:block>Weight in kilograms</fo:block>
		</fo:table-cell>
		<fo:table-cell>
		<fo:block font-family="Times" font-size="7pt">
		<xsl:value-of select="$first" />
		</fo:block>
		</fo:table-cell>
		</fo:table-row>
		</xsl:when>
		
		
		
		
		<xsl:when test="9">
		<fo:table-row>
		<fo:table-cell>
		<fo:block>Related products</fo:block>
		</fo:table-cell>
		<fo:table-cell>
		<fo:block font-family="Times" font-size="7pt">
		<xsl:value-of select="$first" />
		</fo:block>
		</fo:table-cell>
		</fo:table-row>
		</xsl:when>
		
		
			<xsl:when test="9">
		<fo:table-row>
		<fo:table-cell>
		<fo:block>Related products</fo:block>
		</fo:table-cell>
		<fo:table-cell>
		<fo:block font-family="Times" font-size="7pt">
		<xsl:value-of select="$first" />
		</fo:block>
		</fo:table-cell>
		</fo:table-row>
		</xsl:when>
		
			<xsl:when test="10">
		<fo:table-row>
		<fo:table-cell>
		<fo:block>Remarks</fo:block>
		</fo:table-cell>
		<fo:table-cell>
		<fo:block font-family="Times" font-size="7pt">
		<xsl:value-of select="$first" />
		</fo:block>
		</fo:table-cell>
		</fo:table-row>
		</xsl:when>
		</xsl:choose>
		
		
		
		
		<xsl:if test="$remaining">
			<xsl:call-template name="output-tokens">
				<xsl:with-param name="list" select="$remaining" />
				<xsl:with-param name="delimiter">
					<xsl:value-of select="$delimiter"/>
				</xsl:with-param>
				<xsl:with-param name="test" select="$test+1"/> 
				<xsl:with-param name="teller" select="$teller+1"/>
				<xsl:with-param name="firstrow" select="$firstremain"/>
			</xsl:call-template>
		</xsl:if>
	
	
	</xsl:template>
 
 </xsl:stylesheet>

Everything above this works just fine,and since the document is over 2k sentences,and is not relevant for my reqeust, i left it out.

Everything works fine until name value. It starts ignoring my table cells with selection values from "description" onwards. Any ideas?.

With kind greetings,

Henk.

Recommended Answers

All 2 Replies

anyone? know its kind of hard,but im really stuck here ^^

I'm sorry but i don't understand what you try to do...

Your XSLT is very odd, seems false to me.

Could you explain what you try to do with a more simple xml and xslt, please ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.