How do I display timeServed in xsl transformation based on x
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 62
- Joined: Thu Jun 26, 2014 9:00 pm
How do I display timeServed in xsl transformation based on x
How do I use when to display nothing if timeServed="8:25 AM" is not provided in xml document? Right now it is displaying time because there is time in xml. What do I do so when there is no timeServed nothing is displayed?
My xml
my xsl
My xml
Code: Select all
<xsl:template match="NotificationEvent[@notificationType='ProtectionOrderService']">
<ext:ProtectionOrderService>
<ext:ProtectionOrderServiceTime>
<xsl:value-of select="mscef:formatTime(concat(@dateServed,' ',@timeServed))"/>
</ext:ProtectionOrderServiceTime>
</ext:ProtectionOrderService>
</xsl:template>
Code: Select all
<NotificationEvent notificationType="ProtectionOrderService" timeServed="8:25 AM" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"></NotificationEvent>
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: How do I display timeServed in xsl transformation based
See here example 2:
http://www.w3schools.com/xsl/el_when.asp
So for your case:
Regards,
Adrian
http://www.w3schools.com/xsl/el_when.asp
So for your case:
Code: Select all
<xsl:when test="@timeServed">
...
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 62
- Joined: Thu Jun 26, 2014 9:00 pm
Re: How do I display timeServed in xsl transformation based
It is now working but I used if instead. Thanks for your helpadrian wrote:See here example 2:
http://www.w3schools.com/xsl/el_when.asp
So for your case:Regards,Code: Select all
<xsl:when test="@timeServed">
...
Adrian
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service