Home » Developer & Programmer » JDeveloper, Java & XML » XML: Printing NEWLINE character in output through XMLTransform
XML: Printing NEWLINE character in output through XMLTransform [message #234624] Wed, 02 May 2007 13:17
rasa
Messages: 45
Registered: February 2006
Member
Folks:

I am trying to transform an XML Datagram into ordinary text. I am using XMLType.transform to achieve this. However, my problem is with the output not being generated with NEWLINE -- chr(10) -- character. So, while I need this output:

Desired Output:
Jamestown
2007-03-28
523736560
2007-03-29
WED


I am getting this:

Current Output:
Jamestown2007-03-285237365602007-03-29WED


Here is the script:

Script:
-- Created on 5/2/2007 by RARUL 
DECLARE
    -- Local variables here
    v_XML  XMLType := XMLType('<offers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                 xsi:noNamespaceSchemaLocation="xsd.xsd">
                                    <submit type="DAM" date="2007-03-28" name="MKTPART1" mode="NORMAL"/>
                                    <offer name="Jamestown" flag="true" version_no="1.0">
                                        <standing date="2007-03-29" type="WED"/>
                                        <identifier external_id="523736560"/>
                                    </offer>
                               </offers>');
    v_XSLT XMLType := XMLType('<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">    
                                     <xsl:output method="text"/>                
                                     <xsl:template match="/"> 
                                         <xsl:value-of select="/offers/offer/@name"/><xsl:text>&#xA;</xsl:text>
                                         <xsl:value-of select="/offers/submit/@date"/><xsl:text>&#xA;</xsl:text>
                                          <xsl:value-of select="/offers/offer/identifier/@external_id"/><xsl:text>&#xA;</xsl:text>
                                         <xsl:value-of select="/offers/offer/standing/@date"/><xsl:text>&#xA;</xsl:text>
                                         <xsl:value-of select="/offers/offer/standing/@type"/><xsl:text>&#xA;</xsl:text>
                                     </xsl:template>
                               </xsl:stylesheet>');
BEGIN
    -- Test statements here
    DBMS_OUTPUT.PUT_LINE(XMLType.transform(v_XML, v_XSLT).getStringVal());

END;
Previous Topic: Report inside a frame or tooltip in 10g report
Next Topic: Calculation Field (merged)
Goto Forum:
  


Current Time: Thu Apr 18 09:18:19 CDT 2024