This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: xsl question


<xsl:template match="dmxpsub">
	<xsl:if test="Password">
		<td align="center"><xsl:value-of select="Password"/></td>
	</xsl:if>
</xsl:template>

> -----Original Message-----
> From: Alankar Chowdhury [mailto:alankar@crtc.corp.mot.com]
> Sent: Tuesday, April 04, 2000 8:02 AM
> To: xsl-list@mulberrytech.com
> Subject: 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
> 


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]