We have covered the basic knowledge of XML. Now there are some standard rules you need to follow when you work with XML files. Any validation of the rules will throw you an error by any standard XML processor including the one used by BI Publisher. Good news is, XML has only a few rules and all the rules actually make sense and most importantly they are easy enough to follow.
So here is a list of main rules to remember for you at least.
- All XML Elements must have a closing tag
- Element and Attribute names are case sensitive
- Element must be properly nested
- Documents must have a root element
- Attribute Values must be quoted
- White Space value is preserved
- Element/Attribute Values can contain letters, numbers, and other characters
- Element Name Must not start with a number or punctuation character
- Element Name Must not start with the letters ‘xml’ (or XML)
- Element Name cannot contain spaces
I’ve seen many users at our clients have encountered errors when they developed or run BI Publisher reports (RTF template or Data template) because of the non-compliance with the above rules. As you know currently we still need to develop the Data Template files manually and many of us uses text editors to edit the XML format files. And we make some typo, forgot single/double quotes, mistakenly put a space in the element name, or forgot to end the node with closing element. All of these cases will throw you out an error. Also there is another type of problem because of the strict rules listed above. For example when you are developing a RTF Template but couldn’t get any data in the output even though there should be a data and you have mapped the XML element data in the RTF Template. This can often be the case where you have typed the element name in lower case when the element name is presented in upper case in your XML data. Yes, XML Element name is case sensitive! So you need to make sure if the XML Element name is upper case or lower case (or combination) in the XML data file first then need to correctly type the name in your RTF Template.
Many cases when you start developing Data Template or RTF Template and get some strange error that you have no idea are caused by violations of the above rules. So let’s keep those rules in your mind when you work with Data Template and RTF Template.
Provided by Kanichiro Nishida, Consulting Manager, Oracle EPM & BI Consulting