[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl question

Subject: xsl question
From: "Alankar Chowdhury" <alankar@xxxxxxxxxxxxxxxxx>
Date: Tue, 04 Apr 2000 14:01:45 +0800
xsl question
Hey all,

I have a xml document which looks something like this :

<?xml version="1.0" encoding="UTF-8"?>
<dmx>

<dmxpsub min="0000000001">
<SubscriberNumber>100000000011113FFF</SubscriberNumber>
<ForwardSubscriberNumber>311110000000001FFF</ForwardSubscriberNumber>
<DialingPlanID>0</DialingPlanID>
<Password>0000</Password>
<actual_phone>YES</actual_phone>
<esn>0</esn>
<dmxpsscfb>
<ActivationStatus>OPERATIVE</ActivationStatus>
<provision_status>EXPLICIT</provision_status>
<world_number>0123456789012345</world_number>
</dmxpsscfb>
<dmxpssmct>
<ActivationStatus>OPERATIVE</ActivationStatus>
<provision_status>EXPLICIT</provision_status>
<mct_option>0</mct_option>
</dmxpssmct>
<dmxpssmrsum>
<ActivationStatus>OPERATIVE</ActivationStatus>
<provision_status>EXPLICIT</provision_status>
<pilot_min>100000000011113FFF</pilot_min>
</dmxpssmrsum>
</dmxpsub>
:
:
</dmx>

Now I want to display this information in the form of a table.  I can do

this using a simple stylesheet with <xsl:value-of> and other elements.

The problem I am facing is I am generating this xml document
dynamically, so some of the tags from the document might be missing(
they are optional)
<tr style="text-align:left;position:relative;background-color:pink">
  <td style="background-color:lightgreen"><xsl:value-of
select="@min"/></td>
         <td align="center"><xsl:value-of
select="SubscriberNumber"/></td>
         <td align="center"><xsl:value-of
select="ForwardSubscriberNumber"/></td>
  <td align="center"><xsl:value-of select="DialingPlanID"/></td>
  <td align="center"><xsl:value-of select="Password"/></td>
  <td align="center"><xsl:value-of select="actual_phone"/></td>
        </tr>

If I use somethinf like this and if the password tag is not included in
the document, then the password coloumn in the table is left blank.  Can

someone suggest me, how to check if a tag is present in the document.
please consider that there is more data in the document, so I can not
have a <xsl:if> statement to check if each tag is persent or not ..
If any doubts about my question pls mail me :

Thanks
alankar





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.