This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

FW: prefix namespace




-----Original Message-----
From: Victor Weike Xin (Houston) [mailto:Weike.Xin@channelinx.com]
Sent: Tuesday, August 28, 2001 6:41 PM
To: 'XSL-List@lists.mulberrytech.com'
Subject: [xsl] prefix namespace


Hi There! 
I want to use xml file to generate a fix length txt file. 
the xml file as below:(certainly altered)
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project:Invoice SYSTEM "Invoice.dtd"> 
<Project:Invoice xmlns:projected="http://www.project.com/Invoice";>
	<Project:RecieverId>ContractNumber</Project:RecieverId>
	<Project:InvoiceNum>200679</Project:InvoiceNum>
	<Project:InvoiceDate>06/13/2001</Project:InvoiceDate>
	<Project:DueDate>07/03/01</Project:DueDate>
	<Project:RemitTo>
		<Project:Company>
			<Project:Name>Project Company</Project:Name>
			<Project:Address>P.O. BOX 999999</Project:Address>
			<Project:City>AAAA BBBB </Project:City>
			<Project:State>TX</Project:State>
			<Project.PostalCode>79999</Project.PostalCode>
			<Project:Phone/>
		</Project:Company>
	</Project:RemitTo> 
........................ 
</Project:Invoice>
 
The xslt that I created: 
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >
<xsl:template match="/"><xsl:apply-templates /></xsl:template>
<xsl:output method="text"/>
<xsl:variable name="slength"><xsl:text> 

</xsl:text></xsl:variable> 
<!--above variable contains 240 spaces will be use extension instead.--> 
<xsl:template match="Project:Invoice">
<!--<xsl:template match="*">-->
<xsl:text>H1</xsl:text>
<xsl:text>5065382361 </xsl:text>
<xsl:text>079632485ORAP </xsl:text>
<xsl:value-of
select="substring(Project:RemitTo/Project:Company/Project:Name,0,3)" />
<xsl:call-template name="fix_length" >
<xsl:with-param name="item" select="Project:InvoiceNum" />
<xsl:with-param name="length">50</xsl:with-param>
</xsl:call-template> 
<xsl:text> 
</xsl:text> 
...................... 
</xsl:template> 
<xsl:stylesheet> 
The Problem is as below: 
When I use <xsl:template match="Project:Invoice"> in my xsl stylesheet 
The result is : 
ContractNumber 
200679 
06/13/2001
07/03/01 
	Project Company
	P.O. BOX 999999
	AAAA BBBB
	TX
	79999
	........ 
	the only value of element were populated from xml file. 
When I use <xsl:template match="*"> in my xsl stylesheet 
The result is 
H15065382361 079632485ORAP 
the only hard cod data were populated but not value of element in xml file. 
Can you help me to resolve this?
Thanks. 
Victor


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]