RE: XSL Element testing whether empty, or not!

2002-11-21 Thread Kazmír, Jaroslav
TRY THIS:

xsl:variable name=xtest
   xsl:value-of select=department/
/xsl:variable

xsl:choose
xsl:when test=string($xtest)!=''
NON EMPTY
/xsl:when
xsl:otherwise
EMPTY
/xsl:otherwise
/xsl:choose

Jaykay

-Original Message-
From: Scherler, Thorsten [mailto:[EMAIL PROTECTED]] 
Sent: Donnerstag, 21. November 2002 14:57
To: Cocoon-Users (E-Mail)
Subject: XSL Element testing whether empty, or not!

Hello group,

newbie question:
How can you test whether a Element contain information or not? I mean
something like the DB command is not Null // is null.

Example:
data.xml
case 1) departmentElektro/department 
case 2) department / 

I want to have the word Department in front of the value as soon as the
departmentis not empty/department.
I figured out that the string-length(./department/text()) is 19 as soon
department /. If  departmentis not empty/department is  19.
So I have written the following xsl (knowing that is a work around but not a
solution).
xsl:variable name=xtest
xsl:value-of select=string-length(./department/text())/
/xsl:variable
fo:block
xsl:choose
xsl:when test=$xtest19Abteilung: xsl:value-of
select=./department/text()/
/xsl:when
xsl:when test=$xtestlt;20
xsl:value-of select=./department/text()/
/xsl:when
/xsl:choose

Is there a better way to do it?

 Mit freundlichem Gruss,
 
 Thorsten Scherler
 Marketing / Telefonmarketing
 
 Weidmüller GmbH  Co.
 P.O. Box 2807
 33058 Paderborn
 Tel.:+ 49 - 5252-960-350
 Fax:+ 49 - 5252-960-116
 eMail: [EMAIL PROTECTED]
 http://www.weidmueller.de
 
 

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




esql - dynamic result table

2002-11-19 Thread Kazmír, Jaroslav








Hello,



Does someone know how generate dynamical result table,
without using esql:get-columns/?

I would like to get column, where in the first line will be label's of column and another lines will be

Generated directly from result.



I am in this way:



 esql:results

    xsp:logic

    int columns = esql:get-column-count/;

    /xsp:logic

    table class=dotted cellspacing=0 cellpadding=2 width=100%

   row

 xsp:attribute name=bgcolor#AA/xsp:attribute

 xsp:logic

 for (int x=1; x lt; columns+1; x++) {          

    data

   b

 esql:get-column-name column=1/

 

   /b

    /data

 }

   /xsp:logic

   /row

   esql:row-results

 row

    xsp:logic

 for (int x=1; x lt; columns+1; x++) {          

    data

 esql:get-ascii column=1/

   /data

     }

   /xsp:logic

 /row

   /esql:row-results

    /table

 /esql:results



Everything is fine, but I don't know how I could
change attributes number COLUMN in tags

esql:get-column-name/ and
esql:get-ascii/ and remove value "1" by value of variable "x".



Thanx for some suggestion and help.



JayKay



-


JaroslavKazmir
 Institute of Information Systems  Information Management
 JOANNEUM RESEARCH Forschungsgesellschaft mbH
 Steyrergasse 17, A-8010 Graz, AUSTRIA







 phone:
+43-316-876-1140
fax: +43-316-876-1191
 web: http://iis.joanneum.at
 e-mail: mailto:[EMAIL PROTECTED]
-










Logicsheet - condition

2002-10-31 Thread Kazmír, Jaroslav








Hello all users,



I have one easy example, which doesn't work. I look at
it for a long time and I don't know if I made some

Important mistake in codewriting or why id didn't work
L



I made a own logicsheet xsp-formfun
like this:



?xml
version=1.0 encoding=ISO-8859-1?



xsl:stylesheet

  version=1.0

  xmlns:xsp=http://apache.org/xsp

  xmlns:xsp-formfun=http://apache.org/xsp/form-function

  xmlns:xsl=http://www.w3.org/1999/XSL/Transform





  xsl:variable
name=prefixxsp-formfun/xsl:variable



  xsl:template match=xsp:page

    xsl:copy

  xsl:apply-templates select=@*/

  xsl:apply-templates/

    /xsl:copy

  /xsl:template



  xsl:template match=xsp-formfun:check

   xsl:variable name=tempname

 xsl:copy-of select=name/

   /xsl:variable



   xsl:choose

 xsl:when test=normalize-space($tempname)='true'

 ONEtrue

 /xsl:when

 xsl:otherwise

 ONEfalse

 /xsl:otherwise

   /xsl:choose



  TEMPNAME:xsl:copy-of
select=$tempname/

  /xsl:template



  !--
This template simply copies stuff that doesn't match other --

  !--
templates and applies templates to any children.   --

  xsl:template match=@*|node()
priority=-1

    xsl:copy

  xsl:apply-templates select=@*|node()/

    /xsl:copy

  /xsl:template



/xsl:stylesheet





In .XSP I have these lines:



     xsp-formfun:check

    namexsp-request:get-parameter
name=visited//name


/xsp-formfun:check



And I know, that variable visibled has a true value, but by
the calling xsp-formfun:check the both variables

Name and also $tempname has also true value (I see it in the
output window), but the contition is never passed

-
only the xsl:otherwise
part.



Do you know why and which type of mistake I did?



Thanx a lot.



Jaroslav Kazmir





-


JaroslavKazmir
 Institute of Information Systems  Information Management
 JOANNEUM RESEARCH Forschungsgesellschaft mbH
 Steyrergasse 17, A-8010 Graz, AUSTRIA







 phone:
+43-316-876-1140
fax: +43-316-876-1191
 web: http://iis.joanneum.at
 e-mail: mailto:[EMAIL PROTECTED]
-










A href in XLS file

2002-10-21 Thread Kazmír, Jaroslav








Hello,



I have these structure, which I got from DB using esql:get-xml.



LUR xmlns="" ...

 PU

   UserID5UserID

   Email[EMAIL PROTECTED]/Email

 /PU

/LUR



I made an XSL file for format this string, but I have problem
with clickable Email.



When I used somethink like that, I got email into HREF
attributes, but the address is added to the end of the current URL address:



xsl:template match=Email

    b

  i18n:textregistration_email/i18n:text

  a

    xsl:attribute name=href

  mailto:xsl:value-of
select=. /

    /xsl:attribute

    xsl:value-of select=. /

  /a

  br/

    /b

  /xsl:template



I tried to change the template, but I don't know how I
could call the value of Email from the structure otherwise. In this case the
calling of mailto: is perfect, but the Email address is missing. I tried to
find calling the value in the manual, but I only found calling of attributes of
class or calling the children class.



  xsl:template match=Email

    b

  i18n:textregistration_email/i18n:text

  a
href="mailto:{Email}

    xsl:value-of select=. /

  /a

  br/

    /b

  /xsl:template



Can anyone help me?



Thanx a lot.



Jaroslav Kazmir



-


JaroslavKazmir
 Institute of Information Systems  Information Management
 JOANNEUM RESEARCH Forschungsgesellschaft mbH
 Steyrergasse 17, A-8010 Graz, AUSTRIA







 phone:
+43-316-876-1140
fax: +43-316-876-1191
 web: http://iis.joanneum.at
 e-mail: mailto:[EMAIL PROTECTED]
-