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: Some simple questions...


Hi José,

> Q1: How do I test if an element is empty without using
> string-length?

Convert its value to a string with the string() function. When you
convert a string to a boolean, it results in boolean true if the
string has any characters in it and boolean false if it doesn't. The
string() function also takes the current node as its default argument,
so you don't even have to put anything inside the brackets.

For example, to see whether to bother doing anything with your aluno
element, you could do:

<xsl:template match="aluno">
  <xsl:if test="string()">
    ... do something ...
  </xsl:if>
</xsl:template>

> Q2: Is there a nice XSLFO processor binary that I can easily install
> on a Windows or Linux system?

I found both XEP and FOP reasonably easy to install, especially as
they both have .bat and .sh files so that you can use them really
easily, without having to worry about classpath stuff despite the fact
they're written in Java. If you don't like using the command line,
then the Antenna House XSL Formatter is good, though it doesn't
support the full Recommendation yet, I think.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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]