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

  1. Working with layouts
  2.  
  3. WordPerfect lets you create, open, edit, and save XML document layouts.
  4.  
  5. Layouts define the actions the application performs when XML documents are being created. You can define one or more layouts for an XML document by assigning formatting to different elements in a document. Layouts also define how documents display and how they print from WordPerfect. 
  6.  
  7. You can also customize layouts according to where elements are positioned in a document's hierarchy. For more information on defining element hierarchy, see "To define the element hierarchy."
  8.  
  9. In this section, you'll learn about
  10.  
  11.   creating and editing layouts
  12.   
  13.   opening and saving layouts
  14.   
  15. Creating and editing layouts
  16.  
  17. You can create a new layout for an XML document without changing the XML markup and you can create a generic layout that makes it easier to read XML documents in the WordPerfect XML Editor. 
  18.  
  19. You can use the sample template files or you can use them as examples for creating your own templates and layouts. The sample templates are installed in the \Program Files\Corel\WordPerfect Office 11\Template\Custom WP Templates\XML folder.
  20.  
  21. When you specify a layout for an element, you define the rules that specify the format and content of the element. These rules can take effect at the element start tag or the element end tag. You can define when the layout is applied to the element.
  22.  
  23. You can also define or modify element rules that associate formatting with each element in an XML document. For more information on formatting elements, see Formatting XML documents.
  24.  
  25. To create a document layout
  26.  
  27. 1    In the Project editor, Click File  New  Layout.
  28.  
  29. 2    Click Tools  Create generic rules.
  30.  
  31. This adds elements from a DTD.
  32.  
  33. 3    Click File  Close.
  34.  
  35. 4    Click Yes.
  36.  
  37. 5    Type a name for the layout in the Layout name box.
  38.  
  39. 6    Click Save.
  40.  
  41. The new layout is displayed in the Layouts list.
  42.  
  43. Note
  44.  
  45.   If you associate a new layout file with an existing XML document that contains elements that are not defined in the current WordPerfect template, these elements appear as unknown elements in the Element list; for example, [Unknown] Memo. Elements with invalid parent elements, attributes, or attribute values appear as invalid elements in the Element list; for example, [Invalid].
  46.   
  47. Tips
  48.  
  49.   You can also choose an element by clicking the Elements button on the property bar.
  50.   
  51.   You can also create a new document layout by clicking the Layout  button on the property bar.
  52.   
  53. To create a generic layout
  54.  
  55. 1    In the WordPerfect XML Project Designer, open or create a layout.
  56.  
  57. 2    Click Tools  Create generic rules.
  58.  
  59. 3    Click File  Save.
  60.  
  61. 4    Type a name for the generic layout in the Layout name box.
  62.  
  63. Note
  64.  
  65.   You must save the XML document with the new generic layout and reopen it in the WordPerfect XML Editor to see the changes.
  66.   
  67. Tip
  68.  
  69.   You can also create a generic layout when you create an XML document using the wizard.
  70.   
  71. To specify the layout for an element
  72.  
  73. 1    In the WordPerfect XML Project Designer, open or create an XML project.
  74.  
  75. 2    Choose an element from the Element rule list.
  76.  
  77. 3    Click Edit  Edit rule.
  78.  
  79. 4    Click in the Rule entry for start tag list.
  80.  
  81. 5    Click the Element rule menu to insert the codes you want to associate with the start tag for the element.
  82.  
  83. 6    Click in the Rule entry for end tag (before revert) list.
  84.  
  85. 7    Click the Element rule menu and choose the codes you want to take effect before WordPerfect exits the element.
  86.  
  87. 8    Click in the Rule entry for end tag (after revert) list.
  88.  
  89. 9    Click the Element rule menus and choose any codes you want to take effect after WordPerfect exits the element.
  90.  
  91. 10    Choose one of the following options from the Selected condition list:
  92.  
  93.   Normal-applies the layout to every element that meets the specified conditions
  94.   
  95.   First-applies the layout to only the first element that meets the specified conditions.
  96.   
  97. Notes
  98.  
  99.   Element rule menus are used to insert new codes, therefore default settings always display for the features you select.
  100.   
  101.   If an element meets the conditions of the rule and occurs several times in a document, the rule is applied to the element the first time it occurs under a parent element. For example, if the element <PARA> occurred in the element <BODY> and in the element <PS>, the rule is applied the first time <PARA> occurred in <BODY> and the first time it occurred in <PS>, not just the first time <PARA> occurred in the document.
  102.   
  103. Tips
  104.  
  105.   You can also select an element by clicking Edit  Element selection.
  106.   
  107.   For more information about formatting element rules, see "Working with elements."
  108.   
  109. To copy layout definitions
  110.  
  111. 1    In the WordPerfect XML Project Designer, open an existing layout file.
  112.  
  113. 2    Click File  Retrieve.
  114.  
  115. 3    Choose a layout from the Categories/projects list.
  116.  
  117. 4    Type the name of the WordPerfect template in the File name box.
  118.  
  119. 5    Click Retrieve.
  120.  
  121. Tip
  122.  
  123.   You can add the Retrieve button to the toolbar by clicking Tools   Settings  Toolbar edit. From the File category, choose Retrieve, then click Add.
  124.   
  125. To edit a layout
  126.  
  127. 1    In the WordPerfect XML Project Designer, open an existing layout file.
  128.  
  129. 2    Choose an element from the Element rule list.
  130.  
  131. 3    Click Edit  Edit rule.
  132.  
  133. Opening and saving layouts
  134.  
  135. You can open existing layouts in the WordPerfect XML Project Designer.
  136.  
  137. After you have formatted all the elements in an XML document, you can save the layout information as a layout component of the WordPerfect template or as text. Saving layout information as text makes it easier for you to verify element rules.
  138.  
  139. To open a layout
  140.  
  141. 1    In the WordPerfect XML Project Designer, click File  Retrieve.
  142.  
  143. 2    Choose a layout from the Categories/projects list.
  144.  
  145. 3    Click Retrieve.
  146.  
  147. 4    Click Select.
  148.  
  149. To save a new layout
  150.  
  151. 1    In the WordPerfect XML Project Designer, open or create an XML project.
  152.  
  153. 2    Click File  Save as.
  154.  
  155. 3    Type a name for the layout in the Layout name box.
  156.  
  157. 4    Click Save.
  158.  
  159. To save layout information for all elements in a file
  160.  
  161. 1    In the WordPerfect XML Project Designer, open or create an XML project.
  162.  
  163. 2    Click File  Save as.
  164.  
  165. 3    Choose a category from the Category/projects list.
  166.  
  167. 4    Click the folder icon beside the File name box.
  168.  
  169. 5    Type a name in the File name box.
  170.  
  171. 6    Choose WPCSS from the File type list.
  172.  
  173. 7    Click Open to return to the File save dialog box.
  174.  
  175. Note
  176.  
  177.   The format of the textual output is similar to a CSS (cascading style sheet) and is called WPCSS (WordPerfect cascading style sheet).
  178.   
  179.  
  180.  
  181.  
  182.