- To open XML Notepad, click Start, point to Programs, point to Microsoft XML Notepad, and then click Microsoft XML Notepad. The interface shows two panes. The Structure pane on the left presents the beginning of an XML tree structure, with a Root_Element and Child_Element already created. Empty text boxes in the Values pane accept corresponding values.
- Change Root_Element to Catalog and Child_Element to Book, and add an attribute and three child elements to the Book child element.NOTE: When you insert the following values, do not include apostrophes. XML Notepad inserts them for you as your XML document requires.
- To insert an attribute for Book, right-click Book, point to Insert, and click Attribute. Next to the cube icon, type ID. To insert a value for this attribute, highlight ID and type Bk101 in the corresponding text box in the Values pane.
- To insert a child element for Book, right-click the folder icon next to Book, point to Insert, and click Child Element. A leaf icon appears. Type Author next to this icon, and then type Gambardella, Matthew in the corresponding text box in the Values pane.
- Add two more child elements: Title and Genre. Type XML Developer's Guide and
Computer in the corresponding text boxes in the Values pane.
- To add another Book child element to the Root node, right-click an existing Book element and click Duplicate. Fill in the values as needed.
- To add text to existing elements, highlight the node for which you would like to add a text node. On the Insert menu, click Text.
- To add comments to existing elements, highlight the node after which or in which you want to insert the comment. On the Insert menu, click Comment. If the highlighted node is expanded, the comment is inserted within the highlighted node. If the highlighted node is collapsed, the comment is inserted after the highlighted node.
- To change a node's type, highlight the node that you want to change. On the Tools menu, point to Change To and click the appropriate type.
NOTE: You cannot change the type of the root node or of nodes with children.
- To view the XML source of the document, on the View menu, click Source. The sample output resembles the following:Note the following message at the bottom of the View window:
<title>XML Developer's Guide</title>
Also, note that the XML declaration or processing instructions must be added with an external editor, such as Notepad.
The current XML definition is well formed.
- To save the XML document, on the File menu, click Save. To exit XML Notepad, on the File menu, click Exit.
ID do Artigo: 296560 - Última Revisão: 22/06/2014 - Revisão: 1