Rank: Newbie
Joined: 2/27/2015 Posts: 2 Location: WI
|
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
Code:<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 code
Code:<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>
|