Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


xslt concatenation

From: rouble <rouble@-----.--->
To: NULL
Date: 1/14/2009 1:11:00 PM
Hi All,

I am just picking up xslt and I was wondering if I could get some
pointers. I have an xml body that looks like this:
   <location>
       <civic-address>
          <country>US</country>
          <A1>New York</A1>
          <A2>King's County</A2>
          <A3>New York</A3>
          <A4>Manhattan</A4>
          <A5>Morningside Heights</A5>
          <A6>Broadway</A6>
          <PRD>N</PRD>
          <POD>SW</POD>
          <STS>Street</STS>
          <HNO>123</HNO>
          <HNS>A</HNS>
          <LMK>Low Library</LMK>
          <LOC>Room 543</LOC>
          <FLR>5</FLR>
          <NAM>Joe's Barbershop</NAM>
          <PC>10027-0401</PC>
       </civic-address>
    </location>
   <location>
       <civic-address>
           ...
       </civic-address>
    </location>
   <location>
       <civic-address>
           ...
       </civic-address>
    </location>

I need to translate this (using xslt) to create a new element called
'street' that has the values of HNO HNS PRD A6 POD STS from one civic-
address. So the output should look like:
   <location>
       <civic-address>
          <country>US</country>
          <A1>New York</A1>
          <A2>King's County</A2>
          <A3>New York</A3>
          <A4>Manhattan</A4>
          <A5>Morningside Heights</A5>
          <street> 123 A N Broadway SW Street </street>
          <LMK>Low Library</LMK>
          <LOC>Room 543</LOC>
          <FLR>5</FLR>
          <NAM>Joe's Barbershop</NAM>
          <PC>10027-0401</PC>
       </civic-address>
   </location>
   <location>
       <civic-address>
           ...
       </civic-address>
    </location>
   <location>
       <civic-address>
           ...
       </civic-address>
    </location>

If any of HNO HNS PRD A6 POD STS are missing, they should just be
ignored. If all of them are missing, then a 'street' element should
not be created.

I am looking for tips on creating an efficient xslt for this.

TIA,
rouble


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent