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: How do I format this query to see each XML document from start to end?

Re: How do I format this query to see each XML document from start to end?

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Fri, 27 May 2005 00:53:56 +0200
Message-ID: <d75k20$qk1$04$1@news.t-online.com>


g3000 schrieb:
> I figured out I need to set long, my real goal was to get my format to
> be like what I listed in my second post instead I get
>
> SQL> select xmlelement( "provider",
> 2 xmlattributes( '09.01.00' as "version"),
> 3 xmlelement("HeaderInfo",
> 4 xmlforest(cmd_seq as "cmd_seq",
> 5 corps_id as "corps_id",
> 6 dea_id as "dea_id",
> 7 entity_seq as "entity_seq",
> 8 facility_uic as "facility_uic")),
> 9 xmlelement("Detail",
> 10 xmlforest(fname||' '||lname||''||suffix as "Name",
> 11 paygrade_id as "Paygrade",
> 12 rate as "Rate",
> 13 ssn as "SSN",
> 14 start_date as "Start Date",
> 15 stop_date as "Stop Date",
> 16 username as "Username",
> 17 view_sens_ind as "Sensitive")))
> 18 from sams.provider order by cmd_seq;
>
> XMLELEMENT("PROVIDER",XMLATTRIBUTES('09.01.00'AS"VERSION"),XMLELEMENT("HEADERINF
> --------------------------------------------------------------------------------
> <provider
> version="09.01.00"><HeaderInfo><cmd_seq>860</cmd_seq><corps_id>HC</cor
> ps_id><entity_seq>861</entity_seq><facility_uic>00000000</facility_uic></HeaderIn
> fo><Detail><Name>CHRIS
> BOYLES</Name><Paygrade>CIV</Paygrade><Rate>CIV</Rate><SS
> N>001010001</SSN><Start_x0020_Date>01-JAN-00</Start_x0020_Date><Username>QUACK_1
> 67</Username><Sensitive>Y</Sensitive></Detail></provider>
>
> I want
> <Provider version="9.01">
> <HeaderInfo>
> </HeaderInfo>
> <Detail>
> </Detail>
> ( a header and detail for each row, all rows enclosed in Provider
> tags )
> </Provider>
>
> any ideas?
>

IIRC, whitespaces are not meaningful,so oracle gives you valid xml and you are responsible to format it accordingly your wishes ( ever xslt processors don't obliged to implement attribute "indent", they *may* it only ) , but maybe i am wrong ...
Anyway , hope you find somewhat useful here: http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1827993798549

Best regards

Maxim Received on Thu May 26 2005 - 17:53:56 CDT

Original text of this message

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