FIT2043 Lecture Notes - Lecture 12: Single Source Publishing, Xslt, Xml
![](https://new-preview-html.oneclass.com/eJn8zGYplZMrjX3pOELOmxoyWAR13L2a/bg1.png)
L12 - Single Sourcing
A documentation methodology that enables you to reuse the information that you develop
How it works
● Store information on the project on a server somewhere
● Mark it up well so that software will be able to find particular sections
○ This is in regards to the tags used for XML
● Extract the necessary info from the marked-up files on the server
○ Can use XSLT for this
Advantages
● Reusing modules saves time and money
●Increases usability of your documentation
● Usability standards can be enforced more easily in modular documents
How to write for single sourcing
● Modular Writing
○ Reusable
○ Non-sequential
● Focus on content, not formatting (Semantics vs Structural)
○ Designed to be read in a predefined sequence
○ Written for a particular documentation format
○ Needs extensive rewriting for reuse
● Granularity
○ Size/Level of reusable modules
■ E.g. Paragraph, Chapter, Section Levels?
○ Cannot be too fine, or too coarse. If too fine, the amount will be
overwhelming. If too coarse, reusability is compromised.
● Key Idea: XML inputs makes it easy for the writer, and enable an output which is
easy to read for the reader.
How to design XML languages to support single sourcing
● Need to extract components out of XML source files based on their meaning
● XML markup needs to be semantic
○ What the content means
HTML
● Structural and presentational
● Using XSLT transforms to produce HTML from structural XMl → No problems!
○ Reusing information in that XML → no thanks… practically impossible
● Semantic Attributes:
○ Possibility #1: <section content="Requirements">
+ Can write an XPath to pull out required content
match="section[@content='Requirements']"
- Can’t validate with XML Schema
- Can’t ensure content attributes are unique
- Harder to show that required sections are present
Document Summary
A documentation methodology that enables you to reuse the information that you develop. Store information on the project on a server somewhere. Mark it up well so that software will be able to find particular sections. This is in regards to the tags used for xml. Extract the necessary info from the marked-up files on the server. Usability standards can be enforced more easily in modular documents. Focus on content, not formatting ( semantics vs structural ) Designed to be read in a predefined sequence. Cannot be too fine, or too coarse. If too fine, the amount will be overwhelming. Key idea: xml inputs makes it easy for the writer, and enable an output which is easy to read for the reader. How to design xml languages to support single sourcing. Need to extract components out of xml source files based on their meaning. Using xslt transforms to produce html from structural xml no problems!