The Exclude from XML Output property enables you to suppress both the XML tag and associated data output, including child data, for the selected group or column. If you choose to exclude an object, it will not output the XML tag, attributes, data values and child data, for example, columns within groups. This property is useful for reformatting the XML document to exclude data that may be deemed redundant or unnecessary.
Applies to |
Reports, groups, and columns. | ||||
Values |
| ||||
Default |
No | ||||
Required/Optional |
Optional |
Suppose you want to create XML output that limits the data to a few, specific elements. Currently, your XML output includes Department Number, Department Name, and Location. It looks like the following:
<G_DEPTNO>
<DEPTNO>10</DEPTNO>
<DNAME>ACCOUNTING</DNAME>
<LOC>NEW
YORK</LOC>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO>20</DEPTNO>
<DNAME>RESEARCH</DNAME>
<LOC>DALLAS</LOC>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO>30</DEPTNO>
<DNAME>SALES</DNAME>
<LOC>CHICAGO</LOC>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO>40</DEPTNO>
<DNAME>OPERATIONS</DNAME>
<LOC>BOSTON</LOC>
</G_DEPTNO>
You decide to remove the <LOC> tag and its associated data.
In the Data Model view, double-click the LOC column to display the Property Inspector and set the Exclude from XML Output property to Yes.
The XML output will now look as follows:
<LIST_G_DEPTNO>
<G_DEPTNO>
<DEPTNO>10</DEPTNO>
<DNAME>ACCOUNTING</DNAME>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO>20</DEPTNO>
<DNAME>RESEARCH</DNAME>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO>30</DEPTNO>
<DNAME>SALES</DNAME>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO>40</DEPTNO>
<DNAME>OPERATIONS</DNAME>
</G_DEPTNO>
</LIST_G_DEPTNO>
If you wish to remove the <LIST_G_DEPTNO> or <G_DEPTNO> tag without excluding child data (such as DEPTNO or DNAME), click the group G_DEPTNO in the data model and display its Property Inspector. Delete the XML tag G_DEPTNO from the XML Tag property value and delete the LIST_G_DEPTNO XML tag from the Outer XML Tag property value.
Suppose you have decided to use attributes in your XML output which now looks like this:
<G_DEPTNO>
<DEPTNO
NAME="ACCOUNTING" LOCATION="NEW YORK">10</DEPTNO>
<DNAME>ACCOUNTING</DNAME>
<LOC>NEW
YORK</LOC>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO
NAME="RESEARCH" LOCATION="DALLAS">20</DEPTNO>
<DNAME>RESEARCH</DNAME>
<LOC>DALLAS</LOC>
</G_DEPTNO>
To eliminate redundancy, you will need to exclude the DNAME and LOC elements from XML output.
In the Data Model view, double-click the DNAME and LOC columns to display their Property Inspectors and set the Exclude from XML output property to Yes.
The resulting XML output will look as follows:
<G_DEPTNO>
<DEPTNO
NAME="ACCOUNTING" LOCATION="NEW YORK">10</DEPTNO>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO
NAME="RESEARCH" LOCATION="DALLAS">20</DEPTNO>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO
NAME="SALES" LOCATION="CHICAGO">30</DEPTNO>
</G_DEPTNO>
<G_DEPTNO>
<DEPTNO
NAME="OPERATIONS" LOCATION="BOSTON">40</DEPTNO>
</G_DEPTNO>
Copyright © 1984, 2005, Oracle. All rights reserved.