Section 4.5.  Working with attributes

Prev don't be afraid of buying books Next

4.5. Working with attributes

So far, our discussion has focused on elements. XML attributes are less visible in Word. You must go to a separate Attributes dialog to assign, edit or remove values for the attributes of an element.

To assign a value to an attribute:

1. Right-click the article element, either in its start-tag icon or in the top part of the XML Structure task pane.

2. Click Attributes. This will bring up the Attributes dialog as shown in Figure 4-8.

Figure 4-8. The Attributes dialog




3. In the top part of the dialog, select the attribute for which you want to specify a value. Only the attributes that are declared for the element type are listed. If no schema is associated, the individual element's actual attributes are shown.

4. The dialog then displays the type of the attribute. Specify a value in the Value box.

5. Once you have entered a value, click Add. The button text now turns to Modify, which is the way it is shown in the dialog.

If you enter a value that is invalid for that type, you will receive the message "This attribute value is not allowed." In our example, the value of the id attribute must conform to the type ID. This means that it must start with a letter or underscore and contain only letters, digits, underscores and periods.

You can also modify or delete the value for an attribute by selecting it in the bottom section of the dialog and clicking the appropriate button.

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net