I need to write a clause into my xslt that says if an element is present display text node and if it is not present, display nothing. I can find how to write if the text node is a particular word but not if the element is present.
Any advice is much appreciated.
PS: new to xslt/xml etc
Eg: XML represents a book containing pages. One version of the page has a header. Underneath is a table with four columns and 20 rows. Under this is a footer. This footer is not on the other version of the page. My xslt needs to transform the xml into a webpage representing this visually.
the xml therefore has an element of <Footer> which has a minOccurs of 0 in the schema.
This can be done by omitting the comparison e.g.
However, a cleaner way ultimately getting what you want is to use xsl:templates
So for xml
The xsl
illustrates the way this can be done.
check out w3schools xpath tutorial for more information on selecting.