The document discusses using uniform resource locators (URLs) and pipelines of processors to enable dynamic conversion between different structured content formats. Consistent structure is important for enabling automatic processing. URLs can encode conversion pipelines so that content like Excel files can be referenced in DITA topics and other XML documents through simple URLs. This allows for cross-format publishing and editing content in one format that can be saved in another.
Managerial Accounting 5th Edition by Stacey Whitecotton test bank.docx
All You Need is Structure
1. All you need is structure
George Bina
george@oxygenxml.com
@georgebina #LavaCon
2. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
All you need is love structure
All you need is love structure
All you need is love structure, love structure
Love Structure is all you need
5. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Overview
l The idea
l The implementation
6. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Overview
l The idea
l The implementation
l Conclusions and Q&A
7. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Cooking & Single Source Publishing
8. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Single Source Publishing
XML
9. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Ingredients
DITA Map
DITA Topic 1
Image 1
Image 2
Image 3
DITA Topic 2
ready to use ingredients ready to use DITA resources
10. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Ingredients
DITA Map
DITA Topic 1
Image 1
Image 2
Image 3
DITA Topic 2
11. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Getting ready-to-use resources
Manual mill
Copy / Paste
Manual conversion
Industrial mill
Conversion process
Small/automatic
on-demand mill
Dynamic conversion
WheattoflourExceltoDITA
12. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
This is what we want to solve!
How can we make cookies when we have wheat
but not flour?
How can we use DITA publishing when we have
Excel files instead of DITA topics or instead of
images?
(or Markdown, HTML, Java, CSV, and so on)
13. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Dynamic conversion
Manual mill
Copy / Paste
Manual conversion
Industrial mill
Conversion process
Small/automatic
on-demand mill
Dynamic conversion
WheattoflourExceltoDITA
15. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Structure
l Structure is important
16. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Structure
l Structure is important
not necessarily the actual form
of encoding that structure
not necessarily the actual form
of encoding that structure
at a logical level...
17. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Structure
l Structure is important
Consistent what is really
not necessarily the actual form
of encoding that structure
not necessarily the actual form
of encoding that structure
at a logical level...
18. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Structure
l Structure is important
l Consistent structure → automatic processing
Consistent what is really
not necessarily the actual form
of encoding that structure
not necessarily the actual form
of encoding that structure
at a logical level...
19. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Structure
l Structure is important
l Consistent structure → automatic processing
Consistent what is really
not necessarily the actual form
of encoding that structure
not necessarily the actual form
of encoding that structure
So we can convert from one form of encoding to another
at a logical level...
20. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Consistent structure
Can be obtained if we use some sort of validation:
• for XML we have many options:
• DTD, XML Schema, Relax NG, NVDL
• Schematron
• Custom XSLT/XQuery scripts
• For other formats not so many options
• Tool specific (for example Excel validation expressions)
• Mostly limited to individual values
21. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Existing structured content
22. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Existing structured content
Structured content = XML, for example DITA
23. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Existing structured content
Structured content = XML, for example DITA
We may have also other structured content
24. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Existing structured content
Structured content = XML, for example DITA
We may have also other structured content
- in more or less consistent formats
25. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Existing structured content
Structured content = XML, for example DITA
We may have also other structured content
- in more or less consistent formats
l HTML files
l Markdown
l Excel or other spreadsheets
l CSV
l Java source files
l etc.
26. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Existing structured content
Structured content = XML, for example DITA
We may have also other structured content
- in more or less consistent formats
l HTML files
l Markdown
l Excel or other spreadsheets
l CSV
l Java source files
l etc.
- that cannot move to XML/DITA over night
27. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Existing structured content
Structured content = XML, for example DITA
We may have also other structured content
- in more or less consistent formats
l HTML files
l Markdown
l Excel or other spreadsheets
l CSV
l Java source files
l etc.
- that cannot move to XML/DITA over night
- that cannot move to XML/DITA at all
29. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Use URLs to encode dynamic conversions
Idea
30. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Use URLs to encode dynamic conversions
Idea
sample.xls
31. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Use URLs to encode dynamic conversions
DITA
Topic
(table)
XML
Idea
sample.xls
32. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Use URLs to encode dynamic conversions
http://example.com/convertExcel2DITA?file=sample.xls
DITA
Topic
(table)
XML
Idea
sample.xls
33. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Use URLs to encode dynamic conversions
excel2dita:/sample.xls
DITA
Topic
(table)
XML
Idea
http://example.com/convertExcel2DITA?file=sample.xls
sample.xls
34. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Let’s see this in action!
Demonstrate use of an Excel file as a DITA topic
35. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
User perspective
Just add
excel2dita:/
in front of a reference to an Excel file to get a
DITA topic!
36. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Not limited to DITA
We can use the same idea for different use cases:
- convert to/from other types of XML documents: DocBook,
TEI, XHTML, PI-Mod, etc.
- generate dynamic SVG images from data in Excel, CSV,
etc. formats
- process an Excel sheet with XML processing languages
like XSLT, XQuery and XProc
- etc.
37. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Cross-format DITA publishing
Cross-format publishing using DITA tools of
l entire documents
- just refer a “virtual” topic from a DITA map
l parts of a document
- refer the “virtual” topic in a DITA map as resource only
- conref the part that you want from a published topic
Similar concepts can be applied to other XML
document types (for example using XInclude)
38. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
The DITA Glass project
Moving from idea to implementation
http://www.github.com/oxygenxml/dita-glass
Allows to define conversion pipelines and associate
them to a URL scheme
39. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Processors pipeline - read only
P1P2...P(n)
Original contentConverted content
Support “convert:” URLs:
convert:/pipelineStepN/.../pipelineStep1!/targetContentURL
URL Handler which converts content via a pipeline of stages
40. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
CSV to DITA
convert:/processor=xslt;ss=urn:processors:csvtext2dita.xsl/processor=wrap!/x.csv
WrapXSL
...
x.csvDITA topic
wrapcsvtext2dita.xsl
41. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Processors pipeline – read/write
l A pipeline may also contain reverse processors
which define the processing applied when the
file is saved
l So you can potentially edit content in one
format and save in another
P1P2...P(n)
RP1 RP2 ... RP(m)
Target fileEdited file
42. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
CSV to DITA round-trip
convert:/rprocessor=xslt;ss=urn:processors:dita2csv.xsl/
processor=xslt;ss=urn:processors:csvtext2dita.xsl/processor=wrap!/x.csv
WrapXSL
RP2 ... RP(m)
x.csvDITA topic
dita2csv.xsl
wrapcsvtext2dita.xs
43. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
How we get to a simple URL?
excel2dita:/sample.xls
from a “convert” URL that specifies the processing
pipeline:
convert:/processor=xslt;ss=/path/to/excel2d.xsl/
processor=excel!/sample.xls
44. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
URL Syntax Example
convert:/processor=xslt;ss=/path/to/excel2d.xsl/processor=excel!/sample.xls
excel2dita:/sample.xls
45. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
URL Syntax Example
convert:/processor=xslt;ss=/path/to/excel2d.xsl/processor=excel!/sample.xls
excel2dita:/sample.xls
<rewriteURI
rewritePrefix="convert:/processor=xslt;ss=/path/to/excel2d.xsl/processor=excel!/”
uriStartString="excel2dita:/” />
XML Catalog
46. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Excel to XML
JSON to XML
HTML to XHTML
Apply XSLT/XQuery processing
Apply JavaScript processing
Apply Java processing
Wrap Text in an XML element
Implemented processors
47. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Examples of original formats
HTML
Other XML format
Markdown
Excel
Comma separated values (CSV)
Documentation in custom HTML format
Documentation embedded directly in code
48. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Excel to DITA
l Excel to XML
l XML to DITA Topic
<topicref href="convert:/proc=xslt;ss=excel2d.xsl/proc=excel;sn=sample!/sample.xls"/>
<topicref href="excel2dita:/sample.xls"/>
49. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Potential Benefits
l Dynamically create DITA tables from
spreadsheet tables
l Various table column computations are
automatically done in Excel.
l Single source content
50. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
HTML to DITA
l HTML to XHTML
l XHTML to DITA
<topicref href="convert:/proc=xslt;ss=h2d.xsl/proc=xhtml!/care.html" format="dita"/>
<topicref href="html2dita:/care.html" format="dita"/>
51. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Potential Benefits
l Use online tools to gather content
l Use existing content published by some other
entity
l Single source content
52. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
MarkDown to DITA
l MarkDown to HTML
l HTML to XHTML
l XHTML to DITA
<topicref href="convert:/proc=xslt;ss=h2d.xsl/proc=xhtml/proc=js;js=converter.js..!/sample.md"/>
<topicref href="md2dita:/sample.md"/>
53. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Potential Benefits
l Gather API-related input from developers
l Single source content
54. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
XML Schema to DITA
l Preserve annotations
l Show content model
<topicref href="convert:/processor=xslt;ss=urn:proc:xsdToTopic.xsl!/personal.xsd"/>
<topicref href="xsd2dita:/personal.xsd"/>
<element name="name">
<annotation>
<documentation>Specifies the person
family and given name.</
documentation>
</annotation>
<complexType>
<all>
<element ref="p:family"/>
<element ref="p:given"/>
</all>
</complexType>
</element>
55. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Potential Benefits
l Integrate basic XML Schema documentation in
DITA-based project.
l Single source content
56. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Javadoc to DITA
l Javadoc HTML to XHTML
l XHTML to DITA
<topicref
href="convert:/proc=xslt;ss=urn:proc:jdToTopic.xsl/proc=xhtml!/ButtonEditor.html"/>
<topicref href="javadoc2dita:/ButtonEditor.html"/>
57. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Potential Benefits
l Publish DITA conversion of Javadoc to PDF
l Single source content
58. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Java to DITA
l Java to XML
l XHTML to DITA
<topicref href="convert:/processor=xslt;ss=urn:processors:javaToTopic.xsl/
processor=java;jars=urn:processors:jars;ccn=j.to.xml.JavaToXML!/WSAuthorEditorPage.java"/
>
<topicref href="javadoc2dita:/WSAuthorEditorPage.java"/>
59. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Potential Benefits
l Access to source documentation and Java
class structure in DITA as syntax diagrams
l Single source content
60. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Dynamic reports in DITA
l Excel to XML
l XML to SVG
l SVG referred in DITA topic
<image href="convert:/proc=xslt;ss=sales.xsl/proc=excel;sn=sample!/sales.xls"/>
61. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Potential Benefits
l Publish graphs which dynamically change in
time
l Single source content
62. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
CSV to DITA (and back...)
l CSV (Comma separated values) to DITA
l DITA to CSV
<topicref href="convert:/rprocessor=xslt;ss=urn:processors:dita2csv.xsl/
processor=xslt;ss=urn:processors:csvtext2dita.xsl/processor=wrap
!/sample.csv" format="dita"/>
63. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Potential Benefits
l Convert database exports to DITA tables
l Edit DITA tables and update CSV content
64. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Let’s see all these conversions
Demonstrate publishing a map referring Excel,
MarkDown, Java, CSV, etc. to PDF and
WebHelp
Demonstrate CSV round-tripping to DITA
65. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
DITA-Glass Project and
presentation samples
https://github.com/oxygenxml/dita-glass
66. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Related work
DITA-OT Plugins to enable DITA-OT to process
MarkDown and HTML as Lightweight DITA
67. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Other use
Define a DITA project in Excel and process that
with XSLT to generate the project structure
Related work to this is the model2DITA framework
that uses XML instead of Excel to store the
DITA project structure
68. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Conclusions
l DITA Glass can seamlessly bring together
different formats in a single DITA publication
l Simple, yet very powerful idea – just refer a
resource thought a URL
l A generic approach, not limited to DITA - see
the Excel data to SVG graphics example
l Proof of concept implementation available in
oXygen XML Editor
69. @georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.
All you need is structure
Thank you
Questions?
george@oxygenxml.com
@georgebina
http://www.oxygenxml.com