Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with XMLType transform

Re: Problem with XMLType transform

From: <raji_kb02_at_yahoo.co.in>
Date: 9 Mar 2006 04:12:56 -0800
Message-ID: <1141906376.358965.223290@u72g2000cwu.googlegroups.com>


Sorry Zogg, I am not able to reproduce what you are getting. For me it is working fine.

Here is the code I tried.

 declare
 lxml xmltype := xmltype('<EIN>
<segment_id>EIN</segment_id>
<earned_income_type>EIWA</earned_income_type>
<employer_name>ATC TEMPE</employer_name>
<earned_income_occurrence_cnt>01</earned_income_occurrence_cnt>
<earned_income_amount>001360.00</earned_income_amount>
<date_income_received>20050708</date_income_received>
<hours_worked>000080</hours_worked>
<earned_income_frequency_code>2</earned_income_frequency_code>
 </EIN>');
 lxsl xmltype := xmltype('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.  w3.org/1999/XSL/Format">
<xsl:output method="xml"/>
<xsl:template match="EIN">

     <EIN>
       <xsl:copy-of select="./segment_id"/>
       <xsl:copy-of select="./employer_name"/>
       <xsl:copy-of select="./earned_income_occurrence_cnt"/>
       <xsl:for-each select="./earned_income_amount">
         <EIN_Gross>
           <xsl:copy-of select="."/>
         </EIN_Gross>
       </xsl:for-each>
       <xsl:copy-of select="./earned_income_frequency_code"/>
     </EIN>

</xsl:template>

 </xsl:stylesheet>');
 lstr varchar2(4000);
 begin
 lxml := lxml.transform(lxsl);
 --lstr := lxml.getStringVal();
 select lxml.getStringVal() as nn into lstr from dual;
 dbms_output.put_line(substr(lstr,1,255));
 dbms_output.put_line(substr(lstr,256,255));
 end;
 /

<EIN>
  <segment_id>EIN</segment_id>
  <employer_name>ATC TEMPE</employer_name>

<earned_income_occurrence_cnt>01</earned_income_occurrence_cnt>   <EIN_Gross>

<earned_income_amount>001360.00</earned_income_amount>   </EIN_Gross>
  <earned_income_freq
uency_code>2</earned_income_frequency_code> </EIN>

PL/SQL procedure successfully completed. Received on Thu Mar 09 2006 - 06:12:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US