Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with XMLType transform
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>
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