xsl-list
[Top] [All Lists]

RE: test boolean expression in an attribute

2005-08-26 04:50:21
contains is a function, not an operator. Write contains(@id, 'fon_10')

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Stefan Thull [mailto:pop3(_at_)stefan-thull(_dot_)de] 
Sent: 26 August 2005 12:28
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] test boolean expression in an attribute

Hello,
I use a project management software, which produce a a 
xml-file as result.
It produces output with ids like:
-------example--------
<Task Id="nZA1" >
  <Name>Bauteil A 01</Name>
  <SubTasks>
   <Task Id="nZA1.ae06" >
    <Name>Technik</Name>
    <ParentTask>nZA1</ParentTask>
    <SubTasks>
     <Task Id="nZA1.ae06.fon_10" >
      <Name>Systemtelefon 10</Name>
      <ParentTask>nZA1.ae06</ParentTask>
     </Task>
    </SubTasks>
   </Task>
   <Task Id="nZA1.ae07" >
    <Name>Technik</Name>
    <ParentTask>nZA1</ParentTask>
    <SubTasks>
     <Task Id="nZA1.ae07.fon_10" >
      <Name>Systemtelefon 10</Name>
      <ParentTask>nZA1.ae07</ParentTask>
     </Task>
    </SubTasks>
   </Task>
  </SubTasks>
 </Task>
-------- end -----
Now I want every <Task> with an 'fon_10' in its Id.

I tried it with:
</xsl:template>    
    <xsl:template match="//Task">
       <xsl:if test="@Id contains 'fon_10'">
        <p>
            <xsl:value-of select="Name"/>
        </p>
           </xsl:if>
    </xsl:template>
but it throws an error.
" Error in expression @Id contains 'fon_10': Unexpected token 
<name> beyond 
end of expression"

Do you have a hint for me?
Tahnk you in advance
Stefan Thull

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>