Subject: Re: [xsl] Fwd: XSL question From: Peter Flynn <peter@xxxxxxxxxxx> Date: Mon, 19 Mar 2001 22:47:47 +0000 |
On Sun, 03 Jan 1904, Tony Felik wrote: > How can I handle two empty tags? > for example: > > <xsl:if test="Invoicing/Customer/state[.!=''] and > Invoicing/Customer/country[.!='']"> > > (if both the country and the state are empty tags). > By "empty" I meant: </state> a tag without text. I hope you mean <state/> because the end-tag </state> cannot exist without a start-tag, which would imply it was not declared EMPTY. You can't change the meaning of "empty": it has a very specific predefined meaning in XML. If I understand you right, you want to test for the presence or absence of an element which is declared EMPTY (ie you know from a DTD that the element is permitted at that point, you just want to find out if it's there in this file). To do this, use just <xsl:if test="Invoicing/Customer/state">...</xsl:if> You only have to test for presence, because empty elements can't have content anyway (it's different with elements which may have text content, because sometimes you want to distinguish between the presence/absence of such an element, and whether or not it contains some text. But in your case this doesn't apply.) ///Peter XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Fwd: XSL question, B. Tommie Usdin | Thread | RE: [xsl] Reg Counters, Diamond, Jason |
Re: [xsl] How to modify xsl:param w, Robert Koberg | Date | Re: [xsl] How to modify xsl:param w, Robert Koberg |
Month |