How do I add false to a empty string?
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 62
- Joined: Thu Jun 26, 2014 9:00 pm
How do I add false to a empty string?
I would like to display the word false instead of an empty string "" for the . How do I do this?
My output which is wrong
Desired output adds the word false to the empty string
My xml code
My xslt code
Code: Select all
<ext:AddressReference ext:currentIndicator="">
My output which is wrong
Code: Select all
<ext:AddressReference ext:currentIndicator="true">
<nc:LocationReference s:ref="INT10566286"/>
</ext:AddressReference>
<ext:AddressReference ext:currentIndicator="">
<nc:LocationReference s:ref="INT4279606"/>
</ext:AddressReference>
Code: Select all
<ext:AddressReference ext:currentIndicator="true">
<nc:LocationReference s:ref="INT10566286"/>
</ext:AddressReference>
<ext:AddressReference ext:currentIndicator="false">
<nc:LocationReference s:ref="INT4279606"/>
</ext:AddressReference>
Code: Select all
<Address PartyCorrespondence="true" PartyCurrent="true" ID="10566286" Type="Standard">
<AddressLine2>772 Minnesota AVE</AddressLine2>
<AddressLine4>Big Lake, MN, 55309</AddressLine4>
<Street>Minnesota</Street>
<City>Big Lake</City>
<State>MN</State>
<Zip>55309</Zip>
</Address>
<Address ID="4279606" Type="Non Standard">
<AddressLine1>8435 OAK LANE</AddressLine1>
<AddressLine4>BECKER, MN, 55308</AddressLine4>
<City>BECKER</City>
<State>MN</State>
<Zip>55308</Zip>
</Address>
Code: Select all
<xsl:for-each select="Address">
<ext:AddressReference>
<xsl:attribute name="ext:currentIndicator"><xsl:value-of select="@PartyCurrent"/></xsl:attribute>
<nc:LocationReference>
<xsl:attribute name="s:ref"><xsl:text>INT</xsl:text><xsl:value-of select="@ID"/></xsl:attribute>
</nc:LocationReference>
</ext:AddressReference>
</xsl:for-each>
-
- Posts: 62
- Joined: Thu Jun 26, 2014 9:00 pm
Re: How do I add false to a empty string?
I fixed this by doing this:
Code: Select all
<xsl:attribute name="ext:currentIndicator">
<xsl:choose>
<xsl:when test="@PartyCurrent = 'true'">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
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