Jump to content

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


winkimjr2

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

Xslt

<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>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...