home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / downloads / 401065 / WPO11 / Data1.cab / _C775B14E867E40C0B4C0A6430C50D041 < prev    next >
Text File  |  2003-03-07  |  5KB  |  152 lines

  1. Lesson 3: Creating an XML document
  2.  
  3. Lesson 3: Creating an XML document
  4.  
  5. In this lesson, you will create a letter in XML using the WordPerfect XML Editor. The letter will be based on the letter.wpt template you created in lesson 2.
  6.  
  7. In this lesson, you'll
  8.  
  9.   explore the WordPerfect XML Editor
  10.   
  11.   create a new XML document
  12.   
  13.   insert elements
  14.   
  15.   insert text
  16.   
  17. You'll need about 40 minutes to complete this lesson.
  18.  
  19. Exploring the WordPerfect XML Editor
  20.  
  21. You create, open, edit, and save XML documents using the WordPerfect XML Editor. The WordPerfect XML editing environment is an extension of the familiar WordPerfect word-processing environment. An XML-specific Property bar and XML-specific menu commands are available only within the WordPerfect XML editing environment.
  22.  
  23. To learn about the elements of the WordPerfect XML Editor window
  24.  
  25.   Click any of the elements in the picture below.
  26.   
  27.  and are visible in the XML Tree window. You can double-click error message icons for more information about the error.
  28.  
  29. A visual representation of where a graphic appears in the document also appears in the XML Tree window as .
  30.  
  31. You can move and size the XML Tree window.
  32.  
  33. WordPerfect XML Editor window
  34.  
  35. You work within the WordPerfect XML Editor window to insert elements, text, tables, and graphics into XML documents.
  36.  
  37. Inserting elements and text into an XML document
  38.  
  39. After you exit the wizard and complete the process of creating a WordPerfect template, WordPerfect opens a blank XML document in the WordPerfect XML editing environment with the default XML Property bar.
  40.  
  41. Before you type the text of the letter, you must insert element tags. The WordPerfect Auto-Insert feature automatically inserts all the required elements defined in the DTD into your XML document . Any element defined as optional in the DTD is not automatically inserted. The generic layout created in lesson 2 presents the element tags in a more readable display.
  42.  
  43. To insert elements
  44.  
  45. 1.    In WordPerfect, click the XML button on the property bar, then click Elements.
  46.  
  47. 2.    In the Elements dialog box, click the Valid Elements option button.
  48.  
  49. The Valid Elements list shows the elements that can be inserted at the current point in the document.
  50.  
  51. 3.    Click the Insert button to insert all valid elements defined in the WordPerfect template into the blank XML document.
  52.  
  53. 4.    When the Edit Attributes dialog box appears for the tag Salutation, click the Edit Value button.
  54.  
  55. 5.    In the Attribute Value box, choose Miss, then click the Select button.
  56.  
  57. A checkmark appears in the Present column beside the attribute name title.
  58.  
  59. 6.    In the Error\Present\Attribute Name box, choose Surname, then click the Edit Value button.
  60.  
  61. 7.    In the Value box, type "Smith", click the OK button, then click the Close button to close the Edit Attributes dialog box.
  62.  
  63. Note
  64.  
  65.   To begin a new XML document based on the template created in Lesson 2, use the File, New From Project command in WordPerfect.
  66.   
  67. Tip
  68.  
  69.   To insert elements, you can also use the Valid Elements list box on the property bar or the Valid Elements command (by right-clicking in the XML document).
  70.   
  71. To insert text
  72.  
  73. 1.    Position the cursor between the Company Name start and end tags, then type "Corel Corporation."
  74.  
  75. 2.    Position the cursor between the element tags below and type the corresponding text.
  76.  
  77. Element    Text
  78.  
  79. Street    1600 Carling Avenue
  80.  
  81. City    Ottawa
  82.  
  83. Region    Ontario
  84.  
  85. Para    We received payment in the amount of 275 for the following items. It is a pleasure doing business with you. If there is anything else that you require, please feel free to contact me.
  86.  
  87. Adieu    Yours sincerely
  88.  
  89. Author    Alexander Day
  90.  
  91. 3.    Position the cursor before the end tag for Address. Notice that the Valid Elements list box on the Property bar shows Postal Code as a valid element at this point in the document. Postal Code was not inserted automatically into the document because it is defined as an optional element in letter.dtd.
  92.  
  93. 4.    From the Valid Elements list box on the Property bar, choose Postal Code.
  94.  
  95. 5.    Position the cursor between the Postal Code start and end tags, then type "K1Z 8R7".
  96.  
  97. Click here to see what the document should look like at this point.
  98.  
  99. Inserting a symbol
  100.  
  101. XML is based on the Unicode character set. All symbols are already mapped, so there is no need to define an external entity reference in the DTD for most symbols.
  102.  
  103. To insert a symbol
  104.  
  105. 1.    In the XML document, position the cursor in front of "275."
  106.  
  107. 2.    Click the Insert menu, Symbol.
  108.  
  109. 3.    From the Set button, choose Typographic Symbols.
  110.  
  111. 4.    Choose the symbol for the British Pound  (number 4,11).
  112.  
  113. 5.    Click the Insert And Close button.
  114.  
  115. Saving an XML document
  116.  
  117. XML documents are validated by default when you save them.
  118.  
  119. To save the XML document
  120.  
  121. 1.    Click the File menu, Save.
  122.  
  123. 2.    In the File Name box, type "letter," then click the Save button.
  124.  
  125. 3.    In the Save As XML dialog box, click the OK button to accept the default settings for saving.
  126.  
  127. 4.    In the XML Validation dialog box, click No.
  128.  
  129. 5.    Click the File menu, Close to close letter.xml.
  130.  
  131.  
  132.  
  133. Summary of Lesson 3
  134.  
  135. In this lesson, you learned about
  136.  
  137.   the WordPerfect XML Editor
  138.   
  139.   creating a new XML document
  140.   
  141.   inserting elements
  142.   
  143.   inserting text
  144.   
  145. In Lesson 4, you'll create a document layout for the letter by formatting elements using the WordPerfect XML Project Designer.
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.