You could try this...

<xsl:when test="sht:Cell[sht:Name='Start_Date']/@ValueType !=  'DATE'">

Sincerely,

Nick Nagels
IT Specialist @ KULeuven for EuroGenTest
Tel. +0032 16 33 01 43
Herestraat 49 bus 602
B-3000 Leuven
MSN Messenger: [EMAIL PROTECTED]


Oleg Konovalov wrote:
Hi,

I am trying to do an enhancement to Cocoon 2.0/XSLT1.0  application:
add a date validation of Excel cells (named Start_Date) in  SQLTransformer,
so if a Type of that cell is not a DATE, insert that row into  Error table
(otherwise to the Main table).


I  tried:
<xsl:when test='not(sht:Cell[sht:Name="Start_Date"]/@ValueType =  "DATE")' >
and:
<xsl:when  test='not(sht:Cell/sht:Name[.="Start_Date"]/@ValueType = "DATE")'>
but  neither worked (seems to stop - no exceptions).

Unfortunately I can not  get an input XML [Cocoon pipelines sometimes are
very difficult to  debug,
inserting serializer doesn't produce anything]

Here is a code  snippet. It uploads Excel file, converts it to XML and
processes  it.

<xsl:template  match="/">

...<xsl:apply-templates/>

</xsl:template>


<xsl:template  match='sht:Row'>

<!-- do some integrity checks. If they fail, put  them into the
error_table -->

<xsl:choose>

   <xsl:when
test='not(sht:Cell[sht:Name="Start_Date"]/@ValueType="DATE")'>

     <xsl:call-template name='buildStatement'>

      <xsl:with-param  name='row' select='.'/>

       <xsl:with-param
name='table'><xsl:text>load_member_reject</xsl:text></xsl:with-param>

       <xsl:with-param name='notes'>

         <xsl:text>Start_ Date  has a wrong type or date is not
formatted properly (record  ignored)</xsl:text>

      </xsl:with-param>

     </xsl:call-template>

  </xsl:when>

... other  validations

otherwise - insert in  main_table

</xsl:choose>

</xsl:template>


I  am new to XSLT/XPATH/Cocoon and have nobody else to ask.
Sorry for the newbie  question.

Any help is very appreciated.

Thank you in  advance,
Oleg.






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to