![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
When working with Instance resources, TIBCO Designer operates as a “schema-aware” editor, which means you can validate your XML documents against a DTD or XML Schema as you build them or after they have been created. In our example, we will create an XML document using the price list schema created in the first XML Schema Exercise (see XML Schema Exercises) as a template. The example will also demonstrate the customizable view you can create of the XML document as well as all documents you later create based on the same schema.
6. A dialog box will appear asking you to select an element to serve as the root element. The element price.list will appear as the default selection. Click OK.Figure 94 Content Panel
The factory bar, illustrated in Figure 94 above, is one way you can insert additional elements or attributes into your document; you can also double-click on an element within the tag area and use the drop-down window that appears to add components to your document. Figure 95 depicts the document-building options.Figure 95 Document-Building Options
1. To add the name attribute to the manufacturer element, click on manufacturer within the tag area. Once manufacturer is selected, name becomes an option on the factory bar. Click once on name to add it to the document.Figure 96 Factory Bar
2. Select promotion within the tag area, and use the factory bar to add the start.date and end.date attributes.Figure 97 Adding Element
1. If you right-click on the element manufacturer, a menu of options will appear. Select Element “manufacturer” > Color > Green to highlight the element with a green background.You will notice that the manufacturer element has now been highlighted in green. This makes finding the element to add data or content easy and identifies each occurrence of the element.
2. Use the same procedure to highlight the product element in yellow and the promotion element in blue.Figure 98 Highlight the Product Element
3. Now you can promote the child elements as well as the attributes of manufacturer to make the entry of data easier and the document view more manageable.
4. Now drag the element date.issued up to the right of the attribute name, on the same level of manufacturer.Figure 99 Promoting the Elements
5.
6. Figure 100 Promoting the Elements
7. To illustrate the entry of data, click to the right of the name attribute and enter a value that conforms to the data type, in this case a string.Figure 101 Enter Price
9. To add another product to the price list, highlight product in the tag area and then select product from the factory bar. Notice that the new product tag retains the formatting already specified for its element.Figure 102 Add Another Product
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |