Jump to content
Sign in to follow this  

I want to omit addressLine1 if Address element attribute has Standard With Attention

Recommended Posts

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
<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>


<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>

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...