This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
prefix namespace
- To: "'XSL-List at lists dot mulberrytech dot com'" <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] prefix namespace
- From: "Victor Weike Xin (Houston)" <Weike dot Xin at channelinx dot com>
- Date: Tue, 28 Aug 2001 19:41:14 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
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 will be use extension instead.-->
<xsl:template match="Poject:Invoice">
<!--<xsl:template match="*">-->
<xsl:text>H1</xsl:text>
<xsl:text>5065382361 </xsl:text>
<xsl:text>079632485ORAP </xsl:text>
<xsl:value-of
select="substring(Poject:RemitTo/Poject:Company/Poject:Name,0,3)" />
<xsl:call-template name="fix_length" >
<xsl:with-param name="item" select="/Poject: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="Poject: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