Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Custom XML through DITA Specialization in XMetaL

2,951 views

Published on

The "X" in XML stands for "extensible," and many organizations benefit from designing or adapting XML structural rules for their own needs. The Darwin Information Typing Architecture (DITA) is an XML language designed to be customized, using a feature called "specialization." XMetaL Author Enterprise is easily configured to work with DITA specializations. You can get up and running with a specialization in minutes, and if you have some knowledge of programming you can also customize XMetaL menus and toolbars for an optimal user experience. In this session, we'll show how to set up XMetaL to work with a realistic example of a specialized DITA document type.

Published in: Technology
  • Be the first to comment

Custom XML through DITA Specialization in XMetaL

  1. 1. Episode 17 Custom XML through DITA Specialization Su-Laine Yeo, Solutions Consultant January 2011 in 37 minutes
  2. 2. Agenda <ul><li>Today’s slides are on http://www.slideshare.net/XMetaL </li></ul><ul><li>Custom XML with DITA specialization: </li></ul><ul><ul><li>Using a realistic example </li></ul></ul><ul><ul><li>You can download the free example package </li></ul></ul><ul><ul><li>Use example as a model for creating your own specialization </li></ul></ul>
  3. 3. DITA specializations <ul><li>Why DITA specialization? </li></ul><ul><li>Step 1: Put specialized DTD files in place </li></ul><ul><li>Step 2: Make XMetaL provide a “DITA authoring experience” for the document type </li></ul><ul><li>Step 3: Add a template for creating new documents </li></ul><ul><li>Step 4: Optimize the user experience in XMetaL </li></ul><ul><li>Step 5: Customize the publishing system </li></ul><ul><li>Power user tips </li></ul>
  4. 4. Features of base DITA <ul><li>Basic element types: paragraphs, lists, tables, cross-references </li></ul><ul><li>Reuse features: conditional text, content references </li></ul><ul><li>Good tool support </li></ul><ul><li>Wide adoption </li></ul>
  5. 5. Custom XML facilitates automated formatting <ul><li>Example of specialized DITA source: </li></ul>HTML output of the above:
  6. 6. Custom XML facilitates integration with data sources <ul><li>E.g. produce API documentation by parsing source code and pulling out comments </li></ul><ul><ul><li>e.g. JavaDocs </li></ul></ul>
  7. 7. Specialized DTDs enable custom XML <ul><li>Features of base DITA plus: </li></ul><ul><ul><li>Custom elements </li></ul></ul><ul><ul><li>Custom attributes </li></ul></ul><ul><ul><li>Additional rules </li></ul></ul><ul><ul><li>Removal of elements that you don’t need </li></ul></ul>
  8. 8. Examples of specialized DTDs <ul><li>In DITA Open Toolkit “plugins” built by others: </li></ul><ul><ul><li>http://sourceforge.net/projects/dita-ot/files/ </li></ul></ul><ul><li>Grow your own: </li></ul><ul><ul><li>http://www.xiruss.org/tutorials/dita-specialization/ </li></ul></ul>
  9. 9. Specialized DTDs and plugins <ul><li>Recommended practice: Create a folder containing: </li></ul><ul><ul><li>your specialized DTDs </li></ul></ul><ul><ul><li>files for extending the DITA Open Toolkit to produce custom output </li></ul></ul><ul><li>This folder is called a “ plugin ” </li></ul><ul><li>But note: Not all plugins contain specialized DTDs </li></ul>
  10. 10. Step 1: Put specialized DTD files in place
  11. 11. Where to put DTD files <ul><li>Anywhere, but usually in a folder within: </li></ul><ul><ul><li>C:Program FilesCommon FilesXMetaL SharedDITA_OTplugins </li></ul></ul><ul><ul><li>or </li></ul></ul><ul><ul><li>C:Program FilesCommon FilesXMetaL SharedDITA_OTdemo </li></ul></ul><ul><li>You don’t have to put specialized DTD files in more than one place </li></ul>
  12. 12. Step 2: Make XMetaL recognize a document type as being DITA
  13. 13. Document “treated as DITA” DITA-specific menus and styling Invisible features such as copy/paste from Word, automatic ID generation
  14. 14. Document “not treated as DITA” No “Reuse” or “Paragraph” menus Not styled like other DITA documents
  15. 15. Quick configuration <ul><li>Copy the PUBLIC identifier from either the DTD or a sample document. You should see something like this: </li></ul><ul><ul><li>PUBLIC &quot;-//IBM//DTD DITA API Classifier Reference Type//EN&quot; </li></ul></ul><ul><li>Click Tools > Select Specialized DTD </li></ul>
  16. 16. Now, paste Paste the PUBLIC identifier without quotes
  17. 17. Oops! <ul><li>How to fix mistakes made with the “Select Specialized DTD” command: </li></ul><ul><li>Delete the subfolder from C:Program FilesXMetaL 6.0AuthorDITAXACs </li></ul><ul><li>Remove the item from C:Program FilesXMetaL 6.0AuthorRulesdita_specialized.soc </li></ul><ul><li>Remove the item from C:Program FilesXMetaL 6.0AuthorDITAXACsdita_xac_catalog_specialized.xml </li></ul>
  18. 18. Step 3: Add a template for creating new documents
  19. 19. New documents <ul><li>With the setup so far, you can edit existing documents that use the specialized DTD </li></ul><ul><li>Next, configure XMetaL so that you can easily create new documents that use the specialized DTD </li></ul>
  20. 20. Templates folder <ul><li>Files in the “Templates” folder automatically appear in the File > New dialog. </li></ul>
  21. 21. Tip: Put stuff in the template <ul><li>Instructions at: http://forums.xmetal.com/index.php/topic,284 </li></ul>
  22. 22. <ul><li>Step 4: Customize how specialized elements display in XMetaL </li></ul>
  23. 23. Default styling in XMetaL
  24. 24. Optimized styling in XMetaL
  25. 25. What controls styling in XMetaL? Default styling comes from base DITA stylesheets that are installed with XMetaL Custom styling comes from this file, which you can edit
  26. 26. Edit this file!
  27. 27. Important: Style using the “class” attribute <ul><li>Don’t do this: </li></ul><ul><li>Do this instead: </li></ul>
  28. 28. Tip: Turn on display of the “class” attribute <ul><li>By default, the “class” attribute does not display in the Attribute Inspector </li></ul><ul><li>Click Tools > DITA Options. </li></ul>
  29. 29. Step 5: Customize the publishing system <ul><li>The DITA Open Toolkit includes: </li></ul><ul><ul><li>stylesheets to produce general-purpose output in multiple formats </li></ul></ul><ul><ul><li>extension points for adding custom stylesheets for each format </li></ul></ul><ul><li>You must add a line to the catalog-dita_template.xml file </li></ul>
  30. 30. <ul><li>Power user tips </li></ul>
  31. 31. Configure the Reusable Components feature <ul><li>To use the Reusable Components feature with specialized elements, edit the following file: dcspecialized-typemods.ent </li></ul><ul><li>Put this file in the following places: </li></ul><ul><ul><li>C:Program FilesXMetaL 6.0AuthorDITADITA_OT_DTD </li></ul></ul><ul><ul><li>C:Program FilesCommon FilesXMetaL SharedDITA_OTdtd </li></ul></ul>
  32. 32. Advanced customization <ul><li>Custom forms, dialog boxes, menu items, keyboard shortcuts </li></ul><ul><li>Custom behavior when inserting elements </li></ul><ul><li>The XMetaL Developer product is recommended </li></ul><ul><li>See “Extending the XMetaL interface for your specialization” in the XMetaL Programmer’s Guide </li></ul>
  33. 33. Summary <ul><li>Custom XML markup facilitates consistent layout, integration with data sources, and powerful search </li></ul><ul><li>Create or download plugins for specialized DTD files </li></ul><ul><li>“ Select Specialized DITA DTD” command to get started </li></ul><ul><li>Customize templates, stylesheets, and editor behavior </li></ul>
  34. 34. <ul><li>Global Presence </li></ul><ul><ul><li>1,000 employees, ‘07 revenues of $110M </li></ul></ul><ul><ul><li>HQ in Japan; Corporate Offices in Vancouver and London; Sales Offices Worldwide </li></ul></ul><ul><li>Our Experience </li></ul><ul><ul><li>Established in 1979 </li></ul></ul><ul><ul><li>Market leader with over 2,500 customers </li></ul></ul><ul><li>Our Expertise </li></ul><ul><ul><li>Global provider of office productivity, information management, consumer & enterprise software </li></ul></ul><ul><ul><li>Framework for XML-based content creation, integration, visualization and delivery </li></ul></ul><ul><li>Our Credibility </li></ul><ul><ul><li>eContent 100 member in 2009 </li></ul></ul><ul><ul><li>KMWorld Trend-Setting Product Award 2009 </li></ul></ul><ul><ul><li>KM World “100 Companies that Matter” 2010 </li></ul></ul>About JustSystems 2,500 Customers, Marquee Brands
  35. 35. Global Customers Automotive Aerospace Publishing Other High-Tech Financial

×