The Outer XML Attributes property specifies XML attributes for an outer XML tag. The purpose of adding an attribute to an outer tag is to further describe or pinpoint the data value for that tag.
Applies to |
Groups |
Default |
Blank |
Required/Optional |
Optional |
Outer XML attributes must be entered as space-separated, name-value pairs (as with HTML attributes). For example:
[attribute name]="&[report object name]"
where the text within square brackets ([ ]) is chosen by you. You may add as many attributes to this property as you wish by leaving a space between each one.
Suppose your report uses the following query:
SELECT deptno, job, ename, sal FROM EMP
You have decided to view this data as a group-left report with DEPTNO as the first-level group and JOB as the second-level group.
For the purposes of this example, you wish to reverse the order of output for the groups DEPTNO and JOB, from ascending to descending.
Your data model will look like the following:
Currently, your XML output looks like the following:
<MODULE1>
<LIST_G_DEPTNO>
<G_DEPTNO>
<DEPTNO>30</DEPTNO>
<LIST_G_JOB>
<G_JOB>
<JOB>SALESMAN</JOB>
<LIST_G_ENAME>
<G_ENAME>
<ENAME>ALLEN</ENAME>
<SAL>1600</SAL>
</G_ENAME>
<G_ENAME>
<ENAME>WARD</ENAME>
<SAL>1250</SAL>
</G_ENAME>
where one unique value for <JOB> applies to at least two occurrences of <G_ENAME>. Specifically, at least two employees (ALLEN and WARD) hold the job of SALESMAN. Instead of nesting the job title (<JOB>) in a separate XML tag on a separate line, you want to fold this unique value into the <LIST_G_ENAME> element since the value for <JOB> will occur once per occurrence of <LIST_G_ENAME>.
In the Data Model view, specify the following properties:
Group Object Property Action Value
G_ENAME Outer XML Attributes Type: JOBTITLE="&JOB"
JOB Exclude from XML Output Select: Yes
G_JOB XML Tag Delete: G_JOB
Your XML output now resembles the following:
<MODULE1>
<LIST_G_DEPTNO>
<G_DEPTNO>
<DEPTNO>30</DEPTNO>
<LIST_G_JOB>
<LIST_G_ENAME
JOBTITLE="SALESMAN">
<G_ENAME>
<ENAME>ALLEN</ENAME>
<SAL>1600</SAL>
</G_ENAME>
<G_ENAME>
<ENAME>WARD</ENAME>
<SAL>1250</SAL>
</G_ENAME>
Copyright © 1984, 2005, Oracle. All rights reserved.