Re: test if null
Hi All, first thank you very much from your answers, im very much enlightened about what my problem was. my xml reply is just returning either <sample /> if empty or <sample>abc</sample> if not and <sample> node don't have any children at all. so DC's node() won't work either. and none of the suggestions can solve it either. more power to the group! tnx On 6/29/05, Ragulf Pickaxe <ragulf.pickaxe@xxxxxxxxx> wrote: > Hi Jay, > > The solution that David Carlisle gave you first works. If you did not > get it to work, you should rather ask yourself (or the list) why it > didn't work for you. > > What we where discussing was not checking whether <sample> element was > present but whether it had a text() child. That is, the scope was > within the <sample> element. > > In this scope, using DC's solution is the most efficient way of > solving your problem. > > In short: > <xsl:if test="*">....</xsl:if> > does not distinguish between <sample/> and <sample>some text</sample> > > <xsl:if test="string-length(.)=0">....</xsl:if> > does not distinguish between <sample/> and <sample><sub/></sample> > > <xsl:if test="node()">....</xsl:if> > does distinguish between <sample/> and all variations of <sample>....</sample> > > I hope that you can see the difference. > > Regards, > Ragulf Pickaxe :-) > > > On 6/28/05, -= jay =- <deepsweech@xxxxxxxxx> wrote: > > Hi Ragulf, > > The node is always present, but im checking if it returns empty string or not > > like: > > <sample /> -->this is empty > > <sample>not empty</sample> ->not empty > > > > thanks guys! > > -- *-::jay::-*
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