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]
Other format: [Raw text]

finding whether starts-with or not prob


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@uta.fi          *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


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