[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Issue with formatting

Subject: Issue with formatting
From: ms <mina_hurray@xxxxxxxxx>
Date: Wed, 1 Nov 2006 07:56:37 -0800 (PST)
bms10 60
I have tried everything possible and have failed to
format this XML.

My XSLT looks like this:

<xsl:template match="states">
		<br/>
		<xsl:if test="//state/sym='R'">
			<table width="100%">
				<tr>
					<td colspan="6">
						<b>STATES: </b>
					</td>
				</tr>
				<tr>
					<td width="9%">
						<u>Val1</u>
					</td>
					<td width="15%">
						<u>Val2</u>
					</td>
					<td width="7%">
						<u>Val3</u>
					</td>
					<td width="7%">
						<u>Val4</u>
					</td>
					<td width="9%">
						<u>Val5</u>
					</td>
					<td width="21%">
						<u>Val6</u>
					</td>
					<td width="15%">
						<u>Val7</u>
					</td>
					<td width="7%">
						<u>Val8</u>
					</td>
				</tr>
				<xsl:for-each select="//state">
					<xsl:choose>
						<xsl:when test="sym='R'">
							<tr>
								<td>
									<xsl:value-of select="Val1"/>
								</td>
								<td>
									<xsl:value-of select="Val2"/>
								</td>
								<td>
									<xsl:choose>
									
											<xsl:value-of select="Val3"/>
								
								</td>
								<td>
									<xsl:value-of select="Val4"/>
								</td>
								<xsl:variable name="v1">
									<xsl:value-of select="Val1"/>
								</xsl:variable>
								<xsl:variable name="v2">
									<xsl:value-of select="Val2"/>
								</xsl:variable>
						
								<!-- Returns the part description, stock
number and indicator from SCEPTRE-->
								<xsl:apply-templates
select="document(concat($docato-server,'/getinfo.dox?...........)"/>
							</tr>
						</xsl:when>
					</xsl:choose>
				</xsl:for-each>
			</table>
		</xsl:if>
	</xsl:template>
	<xsl:template match="results">
		<tr>
			<xsl:apply-templates/>
		</tr>
	</xsl:template>
	<xsl:template match="data">
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="data/Val5">
		<td>
			<xsl:value-of select="."/>
		</td>
	</xsl:template>
	<xsl:template match="data/Val6">
		<td>
			<xsl:value-of select="node()"/>
		</td>
	</xsl:template>
	<xsl:template match="data/Val7">
		<td>
			<xsl:value-of select="node()"/>
		</td>
	</xsl:template>
	<xsl:template match="data/Val8">
		<td>
			<xsl:value-of select="node()"/>
		</td>
	</xsl:template>


Now, Val1, Val2, Val3, Val4 are available in the input
XML SO I am not concerned about them becoz they format
fine.

Val5, Val6, Val7, and Val8 are retrieved thru a server
call using JSP where it return the XML which looks
like  below:

<results>

	<data>
<Val5>COURTAULDS AEROSPACE INC</Val5>
<Val6>PAINT, POLYURETHANE, RED; BMS10-60; 1 OZ
KIT;</Val6>
<Val7>00-0310-3-0962</Val7>
<Val8>P</Val8>
</data>

	<data>
<Val5>COURTAULDS AEROSPACE INC</Val5>
<Val6>PAINT, POLYURETHANE, RED; BMS10-60; 3 OZ
KIT;</Val6>
<Val7>00-0310-3-0963</Val7>
<Val8>P</Val8>
</data>

	<data>
<Val5>COURTAULDS AEROSPACE INC</Val5>
<Val6>PAINT, POLYURETHANE, RED; BMS10-60; 6 OZ
KIT;</Val6>
<Val7>00-0310-3-0964</Val7>
<Val8>P</Val8>
</data>

	<data>
<Val5>COURTAULDS AEROSPACE INC</Val5>
<Val6>PAINT, POLYURETHANE, RED; BMS10-60; 24 OZ
KIT;</Val6>
<Val7>00-0310-3-0965</Val7>
<Val8>P</Val8>
</data>
</results>

How do I format this to XHTML view. The above XSLT
does not seem to work on this. Thank you for all your
help. 




 
__________________________________________________________________________________________
Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster. 
(http://advision.webevents.yahoo.com/mailbeta) 

Current Thread

Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.