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]

Re: checking for element in CDATA


> I have write a xsl to check if there is an element
> present in CDATA, how to do this.

CDATA means character data, so by definition there are never any
elements in CDATA.

Your example input is the same input as

<element name="ArticleHistory">
   <example>&lt;ArticleHistory>
      &lt;RegistrationYear>2001&lt;/RegistrationYear>
      &lt;Received>
         &lt;Year>1999&lt;/Year>
         &lt;Month>9&lt;/Month>
         &lt;Day>7&lt;/Day>
       &lt;/Received>
   &lt;/ArticleHistory>
  </example>
</element>


so the test you want is

<xsl:if test="contains(example,'&lt;ArticleHistory&gt;')">
.....
</xsl:if>

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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]