|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE:
><DEPOSIT>
> <A>fixedDeposit</A>
> <B>RecurringDeposit</B>
></DEPOSIT>
>
>In the above mentioned case, some times the value of
>either A or B will be null, but while i extract the
>info through stylesheet, i have to check for the
>element which has null and i must not print it.
Here's one way that only copies the element if its contents is not equal to
an empty string:
<xsl:template match="A|B">
<xsl:if test=". !=''">
<xsl:copy><xsl:apply-templates/></xsl:copy>
</xsl:if>
</xsl:template>
I'm sure there are other approaches. This way assumes that an empty A
element is represented as <A></A> or as <A/>. Potential whitespace will
complicate the situation.
Also, keep in mind that with schemas, real null values (as opposed to empty
elements) will be possible.
Bob DuCharme www.snee.com/bob <bob@
snee.com> "The elements be kind to thee, and make thy
spirits all of comfort!" Anthony and Cleopatra, III ii
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








