Same name sibling elements

Here should go questions about transforming XML with XSLT and FOP.
ameyzzin
Posts: 8

Same name sibling elements

Tue Feb 15, 2005 1:54 am

How can i write a single XSL that will get cpad from under cpadPtAddr and cpad from under cpadPtAddrFlr and output it top a pipe delimited text file.

IO have two xsls that can do this seperately but match template works only for either cpadptAddr or cpadPtAddrFLr

Code: Select all

<?xml version="1.0"?>
<te>
   <add>
      <alp>45</alp>
      <aun>01</aun>
      <seq>401C</seq>
      <apr/>
      <asu/>
      <alo>6802</alo>
      <ahi>6811</ahi>
      <loF>1</loF>
      <hiF>15</hiF>
      <asn>RUSTICA</asn>
      <ri>1</ri>
      <con>0</con>
      <cn>65</cn>
      <city>
         <cinm>WESTMINSTER</cinm>
      </city>
      <zip>
         <code>21158</code>
         <cmt>2</cmt>
      </zip>
      <urb>
         <unm/>
      </urb>
      <st>
         <stnm>MD</stnm>
      </st>
      <typ>CIR</typ>
      <rla>0</rla>
      <cds>0</cds>
      <rlex>
         <ri>2</ri>
         <stnm>6804</stnm>
      </rlex>
      <cpadPtAddr>
         <cpadStrNum>6804</cpadStrNum>
         <CPaD>
            <cpadMsgID>4</cpadMsgID>
            <cpadMsgType>20</cpadMsgType>
            <cpadExtMsg>ENTERTHECODE</cpadExtMsg>
            <cpadNAP>100</cpadNAP>
            <cpadDIADDecides>0</cpadDIADDecides>
            <cpadDays>0111111</cpadDays>
            <cpadStartDate/>
            <cpadEndDate/>
         </CPaD>
      </cpadPtAddr>
      <cpadPtAddrFlr>
         <cpadStrNum>6804</cpadStrNum>
         <cpadFlr>15</cpadFlr>
         <CPaD>
            <cpadMsgID>15</cpadMsgID>
            <cpadMsgType>20</cpadMsgType>
            <cpadExtMsg>BRING BACK</cpadExtMsg>
            <cpadNAP>100</cpadNAP>
            <cpadDIADDecides>0</cpadDIADDecides>
            <cpadDays>0111111</cpadDays>
            <cpadStartDate/>
            <cpadEndDate/>
         </CPaD>
      </cpadPtAddrFlr>
   </add>
</te>
george
Site Admin
Posts: 2100

Tue Feb 15, 2005 12:23 pm

Hi,

It is not clear what output you are expecting nor what is exactly the problem you encountered. You can match on both of cpadPtAddr and cpadPtAddrFlr elements if you use something like match="cpadPtAddr | cpadPtAddrFlr" in an xsl template.
If that does not help please provide more details like current stylesheet, expeced output.

Best Regards,
George
ameyzzin
Posts: 8

Wed Feb 16, 2005 1:17 am

Thanks george ,i need to OR it like you suggested..sorry for not being clear abt my doubts...i got it working

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests