Skip to main content
Inspiring
January 20, 2010
Question

Return XML Object

  • January 20, 2010
  • 1 reply
  • 486 views

This part of creating the xml is done, what I am trying to accomplish now is to out the xml data with all the xml tags to the screen.

If I do a dump I could see the records but when I try to output the NumsAll to the screen it does not look good and appears on big horizontal lines

        <cfxml variable="NumsAll">
        <Nums>
            <cfoutput query="rs">
            <Num>
                <id>#id#</id>
                <oid>#oid#</oid>
                <short><![CDATA[#Trim(short)#]]></short>
                <long><![CDATA[#Trim(long)#]]></long>
                <Imp>#Trim(Imp)#</Imp>
                <cnt>#Trim(cnt)#</cnt>
                <cnt2>#Trim(cnt2)#</cnt2>
            </Num>
            </cfoutput>
        </Nums>
        </cfxml>

    This topic has been closed for replies.

    1 reply

    umuayoAuthor
    Inspiring
    January 20, 2010

    Never mind I had to add <![CDATA[#xxx#]]> to all the records being output and now its showing when u vew the source.

            <Nums>
                <cfoutput query="rs">
                <Num>
                    <id><![CDATA[#id#]]></id>
                    <oid><![CDATA[#oid#]]></oid>
                    <short><![CDATA[#Trim(short)#]]></short>
                    <long><![CDATA[#Trim(long)#]]></long>
                    <Imp>#Trim(Imp)#</Imp>
                    <cnt>#Trim(cnt)#</cnt>
                    <cnt2>#Trim(cnt2)#</cnt2>
                </Num>
                </cfoutput>
            </Nums>

    Dileep_NR
    Inspiring
    January 25, 2010

    hi,

    when you used 'cfoutput' for display the data, the tags automatically resolved as HTML, thats y the data displayed in a horizontal line.