Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


xsl:if test fails when source xml element on 2 lines

From: KW <kevinw@------.--.--->
To: NULL
Date: 5/1/2007 9:58:00 AM
I have the following xml...

<person>
    <name>Kevin</name>
    <email>
    </email>
</person>

I have the followng xsl...

<xsl:choose>
    <xsl:when test="person/email != ''>
        <xsl:text>Email Not Empty</xsl:text>
    </xsl:when>
    <xsl:otherwise>
        <xsl:text>Email Is Empty</xsl:text>
    </xsl:otherwise>
</xsl:choose>

The first test is attempting to determine if the element is not
"empty", but with the example xml, it is evaluating to true because
the test is seeing the newline created from the Email element being on
two lines. I would like to evaulate a node like Email so that even if
it is on two lines, there is still "no email address" in the element.
I do not have control over the source file, so I need to come up with
a test to correctly evaluate this.

I appreciate any help you can provide!

Kevin



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent