I want to omit addressLine1 if Address element attribute has
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 62
- Joined: Thu Jun 26, 2014 9:00 pm
I want to omit addressLine1 if Address element attribute has
If the type attribute of the Address element = “Standard With Attention” I do not want to display AddressLine1. Instead I want to only display AddressLine2, AddressLine3 and AddressLine4.
My output:
Attn: Michael, 134 W Broadway ST NW, APT 3B, Washington, DC, 12345
Expected output:
134 W Broadway ST NW, APT 3B, Washington, DC, 12345
xml code
xslt code
My output:
Attn: Michael, 134 W Broadway ST NW, APT 3B, Washington, DC, 12345
Expected output:
134 W Broadway ST NW, APT 3B, Washington, DC, 12345
xml code
Code: Select all
<ProtectedAddresses>
<Address InternalAddressID="1618613567" Type="Standard With Attention">
<AddressLine1>Attn: Michael</AddressLine1>
<AddressLine2>134 W Broadway ST NW</AddressLine2>
<AddressLine3>APT 3B</AddressLine3>
<AddressLine4>Washington, DC, 12345</AddressLine4>
<Attention>James</Attention>
</Address>
</ProtectedAddresses>
Code: Select all
<xsl:for-each select="Addresses/Address">
<xsl:for-each select="ancestor::ProtectionOrder/ProtectionOrderParties/ProtectionOrderParty/DCProtectionOrderPartyAdditional/ProtectedAddresses/Address[@InternalAddressID=current()/@InternalAddressID]">
<xsl:for-each select="AddressLine1 | AddressLine2 | AddressLine3 | AddressLine4">
<xsl:value-of select="."/>
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>
<xsl:text>; </xsl:text>
</xsl:for-each>
</xsl:for-each>
-
- Posts: 17
- Joined: Sun Mar 01, 2015 8:26 am
Re: I want to omit addressLine1 if Address element attribute
Post by lief.erickson »
Since you know that you do not want AddressLine1 included in your output, in your XSLT change
to
-Lief
Code: Select all
<xsl:for-each select="AddressLine1 | AddressLine2 | AddressLine3 | AddressLine4">
Code: Select all
<xsl:for-each select="AddressLine2 | AddressLine3 | AddressLine4">
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