IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

I want to omit addressLine1 if Address element attribute has Standard With Attention Options · View
momokesh
Posted: Monday, March 2, 2015 6:40:44 PM
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>
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.