diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb81d38 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Confluence schema + +XML schema for the Atlassian Confluence storage format. + +See the [documentation](https://grahamhannington.github.io/confluence-schema). \ No newline at end of file diff --git a/catalog.xml b/catalog.xml new file mode 100644 index 0000000..464bf1a --- /dev/null +++ b/catalog.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/confluence-page-example-with-xslt -promote-headings.xml b/confluence-page-example-with-xslt -promote-headings.xml new file mode 100644 index 0000000..c1ab0a8 --- /dev/null +++ b/confluence-page-example-with-xslt -promote-headings.xml @@ -0,0 +1,22 @@ + + + + +

Heading 1

+

Paragraph of text.

+

Heading 2

+

Paragraph of text.

+

Heading 3

+

Paragraph of text.

+

Heading 4

+

Paragraph of text.

+
Heading 5
+

Paragraph of text.

+

+ + + +

+
Heading 6
+

Paragraph of text.

+
diff --git a/confluence-page-example-with-xslt-wiki.xml b/confluence-page-example-with-xslt-wiki.xml new file mode 100644 index 0000000..29d5254 --- /dev/null +++ b/confluence-page-example-with-xslt-wiki.xml @@ -0,0 +1,191 @@ + + + + + + +]> + +

Markup created using the rich text editor

+

Roughly in order of appearance on the Confluence rich text editor toolbar, from left to right.

+

Markup that uses the same names as XHTML

+

Paragraph

+

Markup: Headings

+

Headings are a special type of block element.

+

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+

Markup: Block elements

+
Preformatted line 1
+ +Preformatted line 2
+ +Preformatted line 3
+
+

Quote

+
+

Markup: Inline elements

+

+ Bold +

+

+ Italic +

+

+ Underline +

+

Colour

+

+ Strikethrough

+

+ Subscript

+

+ Superscript

+

+ Monospace +

+

+ Bold Italic Underline Colour Strikethrough Subscript Superscript Monospace +

+

Markup: Lists

+ +
    +
  1. Numbered list item
  2. +
  3. +

    Paragraph nested in list item

    +

    Paragraph nested in list item

    +
  4. +
  5. Numbered list item
  6. +
+

Markup: Indent

+

Paragraph (indented once)

+

Paragraph (indented twice)

+
    +
  1. +
      +
    1. Numbered list item (indented once)
    2. +
    +
  2. +
+
Heading 5 (indented once)
+

Markup: Alignment

+

Paragraph (align left)

+

Paragraph (align center)

+

Paragraph (align right)

+
Heading 5 (align center)
+ +

Markup: Links to web page

+

+ Link to Google +

+

Markup: Tables

+ + + + + + + + + + + + + + + + + +
Column heading 1Column heading 2
Cell 1 Row 1 (spans two rows)Cell 2 Row 1 (highlighted)
Cell 2 Row 2
Cell 1 Row 3 (spans two columns)
+

Markup: Symbols

+

Symbols: ♣ (clubs)

+

Markup: Horizontal line

+
+

Markup: Line break

+

Line
+ break

+

Proprietary Confluence markup (ac:* and ri:* elements)

+

Markup: Links

+

Link to page:

+

+ + + + +

+

Link to user:

+

+ + + +

+

Link to attachment:

+

+ + + +

+

Link to external page:

+

+ http://www.google.com/ +

+

Markup: Images

+

Image on web:

+

+ + + +

+

Image attached to this page:

+

+ + + +

+

Markup: Emoticons

+

+ +

+

+ +

+

+ +

+

+ +

+

Markup: Code Block macro

+ + html/xml + Content]]> + +

Markup: Section and Column macros

+ + true + + + 50% + +

Left column

+
+
+ + 50% + +

Right column

+
+
+
+
+
diff --git a/confluence-page-example-with-xslt.xml b/confluence-page-example-with-xslt.xml new file mode 100644 index 0000000..2405768 --- /dev/null +++ b/confluence-page-example-with-xslt.xml @@ -0,0 +1,191 @@ + + + + + + +]> + +

Markup created using the rich text editor

+

Roughly in order of appearance on the Confluence rich text editor toolbar, from left to right.

+

Markup that uses the same names as XHTML

+

Paragraph

+

Markup: Headings

+

Headings are a special type of block element.

+

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+

Markup: Block elements

+
Preformatted line 1
+ +Preformatted line 2
+ +Preformatted line 3
+
+

Quote

+
+

Markup: Inline elements

+

+ Bold +

+

+ Italic +

+

+ Underline +

+

Colour

+

+ Strikethrough

+

+ Subscript

+

+ Superscript

+

+ Monospace +

+

+ Bold Italic Underline Colour Strikethrough Subscript Superscript Monospace +

+

Markup: Lists

+ +
    +
  1. Numbered list item
  2. +
  3. +

    Paragraph nested in list item

    +

    Paragraph nested in list item

    +
  4. +
  5. Numbered list item
  6. +
+

Markup: Indent

+

Paragraph (indented once)

+

Paragraph (indented twice)

+
    +
  1. +
      +
    1. Numbered list item (indented once)
    2. +
    +
  2. +
+
Heading 5 (indented once)
+

Markup: Alignment

+

Paragraph (align left)

+

Paragraph (align center)

+

Paragraph (align right)

+
Heading 5 (align center)
+ +

Markup: Links to web page

+

+ Link to Google +

+

Markup: Tables

+ + + + + + + + + + + + + + + + + +
Column heading 1Column heading 2
Cell 1 Row 1 (spans two rows)Cell 2 Row 1 (highlighted)
Cell 2 Row 2
Cell 1 Row 3 (spans two columns)
+

Markup: Symbols

+

Symbols: ♣ (clubs)

+

Markup: Horizontal line

+
+

Markup: Line break

+

Line
+ break

+

Proprietary Confluence markup (ac:* and ri:* elements)

+

Markup: Links

+

Link to page:

+

+ + + + +

+

Link to user:

+

+ + + +

+

Link to attachment:

+

+ + + +

+

Link to external page:

+

+ http://www.google.com/ +

+

Markup: Images

+

Image on web:

+

+ + + +

+

Image attached to this page:

+

+ + + +

+

Markup: Emoticons

+

+ +

+

+ +

+

+ +

+

+ +

+

Markup: Code Block macro

+ + html/xml + Content]]> + +

Markup: Section and Column macros

+ + true + + + 50% + +

Left column

+
+
+ + 50% + +

Right column

+
+
+
+
+
diff --git a/confluence-page-example.xml b/confluence-page-example.xml new file mode 100644 index 0000000..2c3f06a --- /dev/null +++ b/confluence-page-example.xml @@ -0,0 +1,184 @@ + + + +

Markup created using the rich text editor

+

Roughly in order of appearance on the Confluence rich text editor toolbar, from left to right.

+

Markup that uses the same names as XHTML

+

Paragraph

+

Markup: Headings

+

Headings are a special type of block element.

+

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+

Markup: Block elements

+
Preformatted line 1
+ +Preformatted line 2
+ +Preformatted line 3
+
+

Quote

+
+

Markup: Inline elements

+

+ Bold +

+

+ Italic +

+

+ Underline +

+

Colour

+

+ Strikethrough

+

+ Subscript

+

+ Superscript

+

+ Monospace +

+

+ Bold Italic Underline Colour Strikethrough Subscript Superscript Monospace +

+

Markup: Lists

+ +
    +
  1. Numbered list item
  2. +
  3. +

    Paragraph nested in list item

    +

    Paragraph nested in list item

    +
  4. +
  5. Numbered list item
  6. +
+

Markup: Indent

+

Paragraph (indented once)

+

Paragraph (indented twice)

+
    +
  1. +
      +
    1. Numbered list item (indented once)
    2. +
    +
  2. +
+
Heading 5 (indented once)
+

Markup: Alignment

+

Paragraph (align left)

+

Paragraph (align center)

+

Paragraph (align right)

+
Heading 5 (align center)
+ +

Markup: Links to web page

+

+ Link to Google +

+

Markup: Tables

+ + + + + + + + + + + + + + + + + +
Column heading 1Column heading 2
Cell 1 Row 1 (spans two rows)Cell 2 Row 1 (highlighted)
Cell 2 Row 2
Cell 1 Row 3 (spans two columns)
+

Markup: Symbols

+

Symbols: ♣ (clubs)

+

Markup: Horizontal line

+
+

Markup: Line break

+

Line
+ break

+

Proprietary Confluence markup (ac:* and ri:* elements)

+

Markup: Links

+

Link to page:

+

+ + + + +

+

Link to user:

+

+ + + +

+

Link to attachment:

+

+ + + +

+

Link to external page:

+

+ http://www.google.com/ +

+

Markup: Images

+

Image on web:

+

+ + + +

+

Image attached to this page:

+

+ + + +

+

Markup: Emoticons

+

+ +

+

+ +

+

+ +

+

+ +

+

Markup: Code Block macro

+ + html/xml + Content]]> + +

Markup: Section and Column macros

+ + true + + + 50% + +

Left column

+
+
+ + 50% + +

Right column

+
+
+
+
+
diff --git a/confluence-page-template-for-catalog.xml b/confluence-page-template-for-catalog.xml new file mode 100644 index 0000000..6005dd4 --- /dev/null +++ b/confluence-page-template-for-catalog.xml @@ -0,0 +1,8 @@ + + + +

Example document for validation with a catalog +— via the DOCTYPE public identifier and XML namespace URIs — +rather than containing explicit references to a DTD and a schema +— via the DOCTYPE system identifier and xsi:schemaLocation attribute.

+
\ No newline at end of file diff --git a/confluence-page-template.xml b/confluence-page-template.xml new file mode 100644 index 0000000..67aff00 --- /dev/null +++ b/confluence-page-template.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/confluence-ri.xsd b/confluence-ri.xsd new file mode 100644 index 0000000..2e9c08e --- /dev/null +++ b/confluence-ri.xsd @@ -0,0 +1,138 @@ + + + + + + Confluence page source XML schema: resource identifiers. + + Last updated 2012-05-04. + + Developed by Graham Hannington (Confluence user; no other affiliation with Atlassian). + + Copyright (c) 2012, Fundi Software. + All rights reserved. + + Distributed under the BSD 2-Clause license. + + + + + + + Confluence resource identifiers + + + + + + + + + + + + + + + + + + Confluence page + + + + + + + + + + + + Confluence blog post + + + + + + + + + + + + + Confluence attachment + + + + + + + + + + + + + + URL + + + + + + + + + + + Shortcut + + + + + + + + + + + + Confluence user + + + + + + + + + + + Confluence space + + + + + + + + + + + Content entity + + + + + + + + diff --git a/confluence-xhtml.xsd b/confluence-xhtml.xsd new file mode 100644 index 0000000..abec9b0 --- /dev/null +++ b/confluence-xhtml.xsd @@ -0,0 +1,719 @@ + + + + + + Confluence page source XML schema: + elements and attributes that have the same name as in XHTML 1.0 Strict, + with the following exceptions: + XHTML 1.0 Transitional s (strikethrough) and u (underline) elements; + proprietary data-atlassian-layout attribute on div elements. + + Last updated 2012-05-04. + + Developed by Graham Hannington (Confluence user; no other affiliation with Atlassian). + + Copyright (c) 2012, Fundi Software. + All rights reserved. + + Distributed under the BSD 2-Clause license. + + + + + + + + + + Imported names + + + + + + + + A single character, as per section 2.2 of [XML] + + + + + + + + + + + One or more digits + + + + + + + + + + + A Uniform Resource Identifier, see [RFC2396] + + + + + + + + + Style sheet data + + + + + + + + + Used for titles etc. + + + + + + + + Generic attributes + + + + + + + + associated style info + + + + + + + + Text elements + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "Inline" covers inline or "text-level" elements + + + + + + + + + + + + Block-level elements + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "Flow" mixes block and inline and is used for list items etc. + + + + + + + + + + + + + Content models for exclusions + + + + + + + a elements use "Inline" excluding a + + + + + + + + + + + + + + + pre uses "Inline" excluding big, small, sup or sup + + + + + + + + + + + + + + Generic language/style container + + + + + + + + + + + + + + + + Paragraph + + + + + + + + + + + + + + Headings: + There are six levels of headings from h1 (the most important) + to h6 (the least important). + + + + + + + Heading 1 + + + + + + + + + + + + + + + Heading 2 + + + + + + + + + + + + + + + Heading 3 + + + + + + + + + + + + + + + Heading 4 + + + + + + + + + + + + + + + Heading 5 + + + + + + + + + + + + + + + Heading 6 + + + + + + + + + + + + + + Lists + + + + + + + Unordered (bullet) list + + + + + + + + + + + + + + + Ordered (numbered) list + + + + + + + + + + + + + + List item + + + + + + + + + + + + + + + Horizontal rule + + + + + + + + + Preformatted text + + + + + + + + + + + + + + + Block-like quotation + + + + + + + + Deleted Text + + + + + + + + Anchor: + Content is "Inline" except that anchors shouldn't be nested + + + + + + + + + + + + + + + + + + + Inline elements + + + + + + + Generic language/style container + + + + + + + + + + + + + + + Forced line break + + + + + + + + + + + Emphasis + + + + + + + + Strong emphasis + + + + + + + + Program code + + + + + + + + Citation. (Cannot be entered directly using the Confluence rich text editor, but you can use the wiki markup dialog to insert it. For example: ??This is a citation?? + + + + + + + + Subscript + + + + + + + + Superscript + + + + + + + + Italic font + + + + + + + + Bold font + + + + + + + + Bigger font + + + + + + + + Smaller font + + + + + + + + Underline (from XHTML 1.0 Transitional, not Strict) + + + + + + + + Strikethrough (from XHTML 1.0 Transitional, not Strict) + + + + + + + Tables + + + + + + + Table + + + + + + + + + + + + + Table body + + + + + + + + + + + + + Table row + + + + + + + + + + + + + + Table header cell + + + + + + + + + + + + + + + + + Table data cell + + + + + + + + + + + + + + diff --git a/confluence.dtd b/confluence.dtd new file mode 100644 index 0000000..eaa2125 --- /dev/null +++ b/confluence.dtd @@ -0,0 +1,367 @@ + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/confluence.xsd b/confluence.xsd new file mode 100644 index 0000000..204805b --- /dev/null +++ b/confluence.xsd @@ -0,0 +1,222 @@ + + + + + + Confluence page XML schema: + "master" schema, defining document root element (confluence) + and other markup in the same namespace. + + Last updated 2012-05-04. + + Developed by Graham Hannington (Confluence user; no other affiliation with Atlassian). + + Copyright (c) 2012, Fundi Software. + All rights reserved. + + Distributed under the BSD 2-Clause license. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Root element of Confluence page or blog post + + + + + + + + Confluence macro + + + + + + + + + + + + + + + + + + + Rich text body of Confluence macro. A macro can contain only one (either rich or plain) text body. + + + + + + + + Plain text body of Confluence macro. A macro can contain only one (either rich or plain) text body. + + + + + + + + + + + Default (no name) parameter of Confluence macro. A macro can contain only one default parameter. + + + + + + + + + Named parameter of Confluence macro. A macro can contain many named parameters. + + + + + + + + + + + + Image + + + + + + + + + + + + + + + + + + + + + + + + + + Link + + + + + + + + + + + + + + + + + + + + + + Link body. A link can contain only one (either rich or plain text) body. + + + + + + + + Plain text link body. A link can contain only one (either rich or plain text) body. + + + + + + + + + Emoticon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/confluence2xhtml.xsl b/confluence2xhtml.xsl new file mode 100644 index 0000000..b4fb2fb --- /dev/null +++ b/confluence2xhtml.xsl @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + Confluence page + + + + + + + + + + + + + + + + + + + + +
+

+ + + + +

+ +
+ + +
+
+ + + +
+
+
+
+
+ + + + + + + + + =" + + + + + + " + + + +
\ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..348efc6 --- /dev/null +++ b/index.html @@ -0,0 +1,823 @@ + + + + + + +XML schema for the Confluence storage format + + + +

XML schema for the Confluence storage format

+
View the schema files in GitHub
+ +

This repository contains:

+ + + +

Getting started

+

Before you begin

+

You will need a validating XML editor.

+

For example (there are many alternatives):

+ +

The following procedure assumes that you have extracted all of the files in this package into one directory.

+

Procedure

+
    +
  1. Open the supplied file confluence-page-example.xml in your XML editor.
  2. +
  3. "Play" (edit the contents). +

    Explore the DTD/XSD-aware features of your XML editor, such as +(depending on your particular editor):

    + +
  4. +
+

Editing XML copied from the Confluence Source Editor plugin

+

About this task

+

The Confluence Source Editor plugin ("advanced editor") displays the source of a page as an XML snippet: +a collection of XML elements, without a single root element.

+

To edit the source as a document in a validating XML editor, you need to wrap the snippet in a root element.

+

This package supplies example XML documents that use the root element name ac:confluence.

+

Before you begin

+

You will need:

+ +

Procedure

+
    +
  1. In your XML editor, open the supplied file confluence-page-template.xml.
  2. +
  3. In Confluence: +
      +
    1. Edit a page (open a page in the rich text editor).
    2. +
    3. Open the page in the source editor.
    4. +
    5. Press Ctrl+A to select all of the source.
    6. +
    7. Press Ctrl+C to copy the source to the Clipboard.
    +
  4. +
  5. In your XML editor: +
      +
    1. Select the following comment: +
      +<!-- Replace this comment with your page source -->
      +
      +
    2. +
    3. Press Ctrl+V to paste the source copied from Confluence.
    4. +
    5. Edit the source.
    6. +
    7. When you have finished editing, select the source between the <ac:confluence> start tag and the </ac:confluence> end tag. +Do not select <ac:confluence> or </ac:confluence>.
    8. +
    9. Copy the selected source to the Clipboard.
    10. +
    +
  6. +
  7. In Confluence, press Ctrl+V to paste the edited source into the Source Editor plugin, replacing the original source.
  8. +
+

Editing XML accessed via WebDAV

+

The Confluence WebDAV plugin serves page source in the same manner as the Confluence Source Editor plugin: as an XML snippet (without a root element), +rather than an XML document; and with the file extension .txt, rather than, say, .xml.

+

Similar to the previous procedure for working with the Confluence Source Editor plugin, you need to wrap the snippet in a root element, +and then unwrap it before saving it back to Confluence.

+

I have added a comment to the Confluence Storage Format page +requesting a change to the behavior of the WebDAV plugin, +so far without response from Atlassian.

+

Using a catalog, rather than explicitly referring to the DTD/XSD in each document instance

+

To validate an XML document, an XML editor needs to know where to find the DTD/XSD files.

+

The supplied file confluence-page-template.xml contains explicit references to confluence.dtd and confluence.xsd:

+
+<!DOCTYPE ac:confluence SYSTEM "confluence.dtd">
+<ac:confluence ...
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.atlassian.com/schema/confluence/4/ac/ confluence.xsd">
+
+

This technique requires the DTD/XSDs to be in the same directory as the document (.xml). +(You can also use relative or absolute references to another directory.)

+

However, if your XML editor supports catalogs, then your documents do not need to explicitly refer to the correct location of the DTD/XSDs. +Instead, the XML editor uses a catalog to locate these files.

+

A catalog is a file that maps:

+ +

(This specific mapping behavior applies to files that you are accessing via a file system +— which is typical of a document editing environment — rather than via the web.)

+

The supplied file confluence-page-template-for-catalog.xml is an example of a document that you can use with a catalog. +The schemaLocation attribute is the same as before; the only difference is the DOCTYPE, which contains an FPI followed by a system identifier:

+
+<!DOCTYPE ac:confluence PUBLIC "-//Atlassian//Confluence 4 Page//EN" "http://www.atlassian.com/schema/confluence/4/confluence.dtd">
+
+

(The system identifier does not, in practice, need to point to an actual resource; +the XML editor will, by preference, attempt to locate the DTD via the catalog, using the FPI).

+

A catalog is supplied in the file catalog.xml.

+

The method for making a catalog available to an editor depends on the particular editor.

+

Using a catalog with Altova XMLSpy

+

Edit RootCatalog.xml in the XMLSpy installation folder +(for example, C:\Program Files\Altova\XMLSpy2012\), +and insert the following element before +the </catalog> end tag:

+
+<nextCatalog catalog="drive letter:/directory path to Confluence schema package/catalog.xml"/>
+
+

Restart XMLSpy.

+

Using a catalog with jEdit

+

Click Plugins ► Plugin Options... ► XML ► Catalogs, click the + (plus sign) button, and then select the supplied catalog.xml.

+

Restart jEdit.

+

Tip: In my experience, clicking ► Plugins ► XML ► Clear Resource Cache is not always effective.

+

Contents of this repository

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileDescription
catalog.xmlOASIS XML catalog
confluence.dtdDocument type definition (DTD)
confluence.xsdMaster XSD (W3C XML 1.0 Schema document)
confluence2xhtml.xslXSLT stylesheet: transforms Confluence storage format into XHTML (more like the rich text editor display than a "preview")
confluence-page-example.xmlExample Confluence page source XML document
confluence-page-example-with-xslt.xmlExample Confluence page source XML document containing a reference to the XSLT stylesheet confluence2xhtml.xsl (tip: open this in Firefox)
confluence-page-example-with-xslt-wiki.xmlExample Confluence page source XML document containing a reference to the XSLT stylesheet wikifier/confluence2wiki.xsl (tip: open this in Firefox)
confluence-page-template.xmlExample Confluence page source XML document with empty body
confluence-page-template-for-catalog.xmlExample Confluence page source XML document for use with catalog (no explicit reference to local copy of DTD/XSD)
confluence-ri.xsd
confluence-xhtml.xsd
xml.xsd
Other XSD files used by the master XSD
index.htmlThe file you are reading now
wikifier/*Wikifier source files
xhtml1-lat1.ent
xhtml1-special.ent
xhtml1-symbol.ent
XHTML character entity definitions (used in the Confluence DTD)
+

Wikifier: Convert Confluence XML to wiki markup

+
Go to the Wikifier web page
+

Wikifier is a web-based test harness for the XSLT stylesheet confluence2wiki.xsl +(supplied in the wikifier directory) +that transforms Confluence XML into wiki markup.

+

To convert Confluence XML to wiki markup:

+
    +
  1. Copy Confluence XML from the Confluence Source Editor plugin to your +clipboard. (Or, equivalently, copy the Confluence XML contents of a .txt + file served by the Confluence WebDAV plugin.)
  2. +
  3. Go to the Wikifier web page. +(Or host Wikifier on your own server, using the files supplied in the wikifier directory.) +
  4. +
  5. Paste (press Ctrl+V) the Confluence XML into the text area under the "Confluence XML" heading.
  6. +
+

To copy the wiki markup from Wikifier to your clipboard:

+
    +
  1. Select the text under the "Wiki markup" heading (tip: press Ctrl+A).
  2. +
  3. Copy (press Ctrl+C) the selected text to your clipboard.
  4. +
+

Wikifier does not send your Confluence XML to a +server; all processing of your Confluence XML is done client-side.

+

I have tested Wikifier in the following web browsers: IE9, and current +"production" versions of Chrome, Firefox, and Safari (all on Windows).

+

Tip: Instead of using Wikifier, you can paste your XML into the supplied file +confluence-page-example-with-xslt-wiki.xml, and then open the file in Firefox to see the converted wiki markup.

+

What Wikifier is, and is not

+

Wikifier is a minimal test harness for the XSLT stylesheet I have developed +to convert Confluence XML to wiki markup.

+

The XSLT stylesheet is by no means complete. I welcome your feedback. If +Wikifier does not correctly convert some Confluence XML, please let me +know, and I will do what I can (no promises, though).

+

Wikifier is not a replacement for the Confluence 3 wiki markup editor view.

+

Wikifier is only a test harness; it is not intended to be a fully fledged +application. The XSLT stylesheet took me about a day and a half to +develop; same again for Wikifier (my cross-browser JavaScript coding +skills are both rudimentary and extremely rusty!).

+

Why I developed the XSLT stylesheet

+

I developed the XSLT stylesheet for the following use case: to copy +relatively simple content from the current version of Confluence (4) to +the current version of JIRA (4).

+

I did not develop the XSLT stylesheet to bring wiki markup back to Confluence. +However, if you want to, you can paste the wiki markup from Wikifier into:

+ +

The XSLT stylesheet could be used as the "heart" of a plugin, although I have no immediate plan to do that.

+

Round-tripping?

+

Bear in mind the following comment from Paul Curren (Atlassian):

+
+

Wiki markup can only represent a subset of what can be represented in XHTML.

+
+

What Paul says is true. For example, if you paste Confluence XML table +markup (which is, in this specific case, XHTML markup) with merged cells + into Wikifier, the resulting wiki markup will retain the table cell +contents, but will not retain the merged cell formatting.

+

Also from Paul, also true:

+
+

just about anything is possible with appropriate development effort

+
+

I can imagine that it might, perhaps, be possible to develop new +Confluence 3 macros to match new capabilities in Confluence 4, and have +an XSLT stylesheet transform such Confluence 4 syntax into these new +macros (or even, say, as the contents of the existing Confluence 3 HTML +macro). For me, though, this is a purely academic issue. I can now copy +content from Confluence to JIRA, which is what I was after.

+

Tips

+

DTD, or XSD and DTD, but not just XSD

+

To validate Confluence page source, you need either:

+ +

You cannot validate Confluence page source with only the XSD, because Confluence page source +can contain references to character entities (for example, &mdash;) that can only be +defined in a DTD. If you attempt to validate Confluence page source that contains character +entity references, but you do not refer to the DTD, you will get an XML parsing error.

+

Development notes

+

Testing

+

The DTD/XSDs have been tested using the following Confluence page source:

+ +

Tip: The <property name="body"> elements in entities.xml wrap the page contents in a CDATA section. +The page contents can also contain CDATA sections. However, nested CDATA sections are not allowed in XML, so, to avoid this issue, +the ]]> terminators of the CDATA sections in the page contents contain a space (]] >). When extracting the page contents +into individual XML files, you need to remove these spaces.

+

Coined names and identifiers (not approved by Atlassian)

+

Highlighted items in the following listing are my own coinage, not approved by Atlassian:

+
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE ac:confluence PUBLIC "-//Atlassian//Confluence 4 Page//EN" "http://www.atlassian.com/schema/confluence/4/confluence.dtd">
+<ac:confluence
+  xmlns:ac="http://www.atlassian.com/schema/confluence/4/ac/"
+  xmlns:ri="http://www.atlassian.com/schema/confluence/4/ri/"
+  xmlns="http://www.atlassian.com/schema/confluence/4/">
+<p>Contents of page body</p>
+</ac:confluence>
+
+

Document root element name

+

Value: ac:confluence

+

Notes:

+ +

Namespace names (URIs)

+

Values:

+
+http://www.atlassian.com/schema/confluence/4/ac/
+http://www.atlassian.com/schema/confluence/4/ri/
+http://www.atlassian.com/schema/confluence/4/
+
+

Notes:

+ +

Known issues

+

General

+ +

Wikifier

+ + +

Acknowledgements

+

I wish to thank the following people for their assistance and/or encouragement in developing this package:

+
+
Shannon Greywalker (Confluence user)
+
I only know Shannon through comments on the Confluence website. What Shannon writes is worth reading.
+
Sarah Maddox (Atlassian)
+
Sarah pointed me to the exported Confluence Documentation that Atlassian makes available for download, and +gave me tips on finding the page source inside. That source was a valuable bucket of test cases for developing the DTD/XSDs.
+
Other Atlassians (in particular, Paul Curren)
+
Thank you for taking the time to respond to my comments openly, positively, and constructively. It's sincerely appreciated.
+
+

Change log

+

Most recent changes first:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date
yyyy-mm-dd
Description
2024-09-26Stored these files in GitHub, published as a GitHub Pages site.
2012-06-06Prettified this readme.
2012-05-01 +
    +
  • Added a license statement
  • +
  • Added source files for Wikifier (in the wikifier subdirectory), which converts Confluence XML to wiki markup
  • +
  • Added confluence-page-example-with-xslt-wiki.xml (open this in Firefox to see its Confluence XML converted to wiki markup)
  • +
+
2012-04-23 +
    +
  • Corrected catalog-related tips in this readme
  • +
  • Refined DTD comments after testing with the Eclipse XML editor
  • +
  • Refined confluence2xhtml.xsl (improved table formatting)
  • +
+
2012-04-18 +
    +
  • Added this readme
  • +
  • Refined DTD after testing against Atlassian's own Confluence Documentation source
  • +
  • Added XSD (constraints match DTD, as far as possible)
  • +
  • Added catalog and related sample files
  • +
+
2012-04-13 +
    +
  • Refined DTD after further experimentation to see what markup the rich text editor can create
  • +
  • Added example Confluence page source file (containing a variety of markup; open this in your favorite validating XML editor), with a variant that refers to an XSLT stylesheet (below)
  • +
  • Added "Confluence to XHTML" XSLT stylesheet (confluence2xhtml.xsl)
  • +
+
2012-04-12First draft of DTD.
+

License

+

This package and its contents are distributed under the BSD 2-Clause license (also known as the Simplified BSD license):

+
+

Copyright © 2012, Fundi Software

+

All rights reserved.

+

Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met:

+ +

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+
+ + \ No newline at end of file diff --git a/promote-headings.xsl b/promote-headings.xsl new file mode 100644 index 0000000..9ab78b1 --- /dev/null +++ b/promote-headings.xsl @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wikifier/confluence-all.dtd b/wikifier/confluence-all.dtd new file mode 100644 index 0000000..954c2c4 --- /dev/null +++ b/wikifier/confluence-all.dtd @@ -0,0 +1,888 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wikifier/confluence2wiki.xsl b/wikifier/confluence2wiki.xsl new file mode 100644 index 0000000..3026249 --- /dev/null +++ b/wikifier/confluence2wiki.xsl @@ -0,0 +1,517 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + * + + * + + + + + _ + + _ + + + + + ?? + + ?? + + + + + - + + - + + + + + + + + + + + + + + ^ + + ^ + + + + + ~ + + ~ + + + + + {{ + + }} + + + + + + + + {noformat} + + {noformat} + + + + + + + + {quote} + + {quote} + + + + + {color:# + + + + + + + + + + + + + } + + {color} + + + + + + + + + + + + \\ + + + + + + + + + + + + + + \\ \\ + + + + + + + + + + \\ \\ + + + + + + ---- + + + + + + + + + + + + + + # + * + + + + + + + + + + + + + + + + + [ + + + | + + + + : + + + ] + + + + + [ + + + | + + ~ + + ] + + + + + [ + + ] + + + + + [ + + + | + + + ] + + + + + + + + | + + + | + + + + + + || + + + || + + + + + + + + + + + ! + + + + + + + + + + + + | + + + + , + + + border=1 + + + + = + + + + + + ! + + + + + + + + + + + + + { + + + : + + + + | + + + + | + + = + + + + } + + + + + + + + + + + + { + + } + + + + + + + + + + + + + + + + + + + + + + + + + + + :) + :( + :P + :D + ;) + (y) + (n) + (i) + (/) + (x) + (!) + (Emoticon: ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ---- + + + + + + + + + + + + + 00 + + + + + + + + + + + + + + + + A + B + C + D + E + F + A + + + + + + + \ No newline at end of file diff --git a/wikifier/images/favicon.ico b/wikifier/images/favicon.ico new file mode 100644 index 0000000..2678f41 Binary files /dev/null and b/wikifier/images/favicon.ico differ diff --git a/wikifier/index.html b/wikifier/index.html new file mode 100644 index 0000000..1adb14f --- /dev/null +++ b/wikifier/index.html @@ -0,0 +1,226 @@ + + + + + +Wikifier - Convert Confluence XML to wiki markup + + + + + + + + +
+
WikifyConfluence XML
+ + +
+
HelpWiki markup
+ + + \ No newline at end of file diff --git a/xhtml-lat1.ent b/xhtml-lat1.ent new file mode 100644 index 0000000..ffee223 --- /dev/null +++ b/xhtml-lat1.ent @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xhtml-special.ent b/xhtml-special.ent new file mode 100644 index 0000000..ca358b2 --- /dev/null +++ b/xhtml-special.ent @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xhtml-symbol.ent b/xhtml-symbol.ent new file mode 100644 index 0000000..63c2abf --- /dev/null +++ b/xhtml-symbol.ent @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml.xsd b/xml.xsd new file mode 100644 index 0000000..aea7d0d --- /dev/null +++ b/xml.xsd @@ -0,0 +1,287 @@ + + + + + + +
+

About the XML namespace

+ +
+

+ This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+
+
+ + + + +
+ +

lang (as an attribute name)

+

+ denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+ +
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ The union allows for the 'un-declaration' of xml:lang with + the empty string. +

+
+
+
+ + + + + + + + + +
+ + + + +
+ +

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

+ +
+
+
+ + + + + + +
+ + + +
+ +

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+ +

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+
+
+
+
+ + + + +
+ +

id (as an attribute name)

+

+ denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+ +

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

+
+
+
+
+ + + + + + + + + + +
+ +

Father (in any context at all)

+ +
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + + +
+

About this schema document

+ +
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+
+
+
+
+ + + +
+

Versioning policy for this schema document

+
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+ +
+