|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] apply-templates - A doubt.
Hello, I am looking for a method to overcome my problem. Thanks for your help. I have an xml a.xml file like this: <?xml version="1.0"?> // root <?xml-stylesheet type="text/xsl" href="a.xsl"?> <first> <puid>abc</puid> <suid>123<suid/> <suid>456<suid/> </first> For this I have a stylesheet like this: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="first"> <html> <body> <i>puids:</i><br/> <xsl:apply-templates select="puid"/><br/> <i>suids:</i><br/> <xsl:apply-templates select="suid"/><br/> </body> </xsl:template> <xsl:template match="puid"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="suid"> <xsl:value-of select="."/> </xsl:template> Now, the question is It is possible that, my xml file sometime does not contain any suid. In this case, i should not even print the suids: heading also. I cannot put this within the template match since it will be printed then for each suid. How do I overcome this problem? Please help me in solving this problem, Regards, Thanks, Nirmala 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








