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

finding whether starts-with or not prob

Subject: finding whether starts-with or not prob
From: Jarkko.Moilanen@xxxxxx
Date: Wed, 22 May 2002 08:44:36 +0300 (EEST)
xsl if starts with
Moro!

I have a small prob. I'm trying to apply a template inside another one. 
The tempalte is supposed to solve whether the <DocType> value is order or 
something else and depending from the result do something in both cases. 
I have been trying to solve whats wrong, but I can't find the reason why 
it is not working. I know this is not the best solution for this case, to 
find out the content of the element, but hey... who's perfect =)

XSL-FILE:(Part of it) 
<xsl:apply-templates select="Document/Information" />
<xsl:template match="Information">
</xsl:if>
		<xsl:if test="@SignStatus='Open'">
		<td bgcolor="#C4DAFE" width="50">
                <p ID="SignStatus"><font size="-1">
		<xsl:value-of select="@SignStatus" /> 
		</font>
		</p></td>
		</xsl:if>
       <!-- SINCE I AM "INSIDE" INFORMATION ELEMENT; I CAN CALL DIRECTLY
            THE DOCTYPE TEMPLATE, RIGHT? -->
		<xsl:apply-templates select="DocType" />
		
		<td bgcolor="#C4DAFE" width="124">
                <p ID="Sender"><font size="-2">
		<xsl:value-of select="Sender" /></font>
		</p></td>
</xsl:if>
</xsl:template>

<xsl:template match="DocType">
		<xsl:if test="not(starts-with(., 'order'))">
			<td bgcolor="#C4DAFE" width="50">
                	<p ID="type"><font size="-2">
			<xsl:value-of select="." /></font>
                   <!-- ISNT THE DOT POINTING TO THE DOCTYPE ELEMENTS CONTENT? -->
      			</p></td>
		</xsl:if>
		<xsl:if test="starts-with(., 'order')">
			<td bgcolor="#C4DAFE" width="50">
               		<p ID="type"><font size="-2"><b>
			<xsl:value-of select="." /></b></font>
			</p></td>
		</xsl:if>		
</xsl:template>


And the xml- file used here:
<?xml version="1.0"  encoding="ISO-8859-1" standalone="yes"?>
<Document>
<Information SignStatus="Open">
    <DocType>CDR</DocType>
    <Date>01/09/09</Date>
    <Clock>01:45:03</Clock>
    <Sender>Moilanen Jarkko</Sender>
    <Subject id="0000000004" id2="001">3. JPr hyökkäyskäsky Haminassa</Subject>
    <Subject2></Subject2>
    <Infofield>
    <Topic></Topic>
    </Infofield>
</Information>
</Document>


Cheers
Jarkko


******************************************************************
Jarkko Moilanen         *You are wise, witty, and wonderful,     *
Researcher/ ITCM        *but you spend too much time             *
jm60697@xxxxxx          *reading this sort of trash.             *
www.uta.fi/~jm60697     *                                        *
GSM: +358 50 3766 927   *                                        *
******************************************************************
* ITCM | Information Technology and Crisis Management            *
* http://www.itcm.org                                            *
******************************************************************

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


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-2013 All Rights Reserved.