XWiki Syntax 2.0

XWiki Syntax 2.0: All



2.0 Introduction

Starting with XWiki Enterprise version 1.7 we've introduced a new wiki syntax. We've named the old syntax the XWiki Syntax 1.0 and the new syntax was logically called the XWiki Syntax 2.0. The main reasons for introducing the new syntax were:

  • Fix the limitations and ambiguities of the XWiki 1.0 syntax (which was inspired by both Radeox - the underlying rendering engine - and TWiki).
    • Not optimal symbols. For example the symbol for bold was single stars. This was causing trouble when users were entering text containing stars since that text was mistakenly considered to be bold when it wasn't. Hence we've rationalized the syntax by using at least double characters everywhere. 
    • Ambiguities. For example there was an ambiguity between a bold item starting a line and a bullet list. Resolving the ambiguities was required in order to rewrite the WYSIWYG editor so that it could be deterministic.
  • Be closer to the Creole 1.0 syntax which is becoming a standard for wiki syntax. In addition the Creole community has taken the time to analyze all the existing wiki syntaxes before deciding on symbols. The choices made are thus very good.

In addition to these XWiki-specific syntaxes we've also changed our underlying rendering engine (was Radeox previously) in favor of our own engine which is superset wrapper around Wikimodel and Doxia (and possibly others in the future). This has allowed us to provide other syntaxes in the wiki: MediaWiki, Confluence, JSPWiki, Creole, TWiki and more.

General Remarks

2.0 General Remarks

XWiki Syntax 2.0 corrects some errors or ambiguous syntax entered by the user as shown in the examples in the table below.

DescriptionExample of invalid or ambiguous syntaxFixed XWiki Syntax 2.0
Unclosed text styles**bold**bold**
Two standalone elements not separated by 2 new lines| table cell
* list item
| table cell

* list item
Two standalone elements not separated by 2 new linesparagraph


Ignored new line at beginning of document<new line at beginning of document>
Not closed heading syntax=== heading=== heading ===

Other Syntaxes

1.0 Other Syntaxes

Other syntaxes are also available (bundled or through extensions):



2.0 Paragraphs

Paragraphs are text elements separated by 2 or more new lines.

In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole Syntax.

FeatureXWiki Syntax 2.0Result
Simple paragraphThis is a paragraphThis is a paragraph
Paragraph on multiple linesParagraph on
multiple lines
Paragraph on
multiple lines
Two paragraphsParagraph one

Paragraph two
Paragraph one

Paragraph two
Parametrized paragraph(% style="text-align:center;color:blue" %)
Centered and blue paragraph

Centered and blue paragraph
Different style on some portion of the paragraph contentparagraph with (% style="color:red" %)red(%%) different style insideparagraph with red texte inside


2.0 Headings

FeatureXWiki Syntax 2.0Result
Standard headings
= level 1 = 
== level 2 ==
=== level 3 ===
==== level 4 ====
===== level 5 =====
====== level 6 ======

level 1


level 2

level 3

level 4

level 5
level 6
Parameterized headings(% style="color:blue" %)
= heading =


Headings with XWiki Syntax=== Heading with **bold** ===

Heading with bold

Text Formatting

2.0 Text Formatting

New in XWiki Syntax 2.0 over XWiki Syntax 1.0:

  • Spaces are allowed just after the syntax symbols (for example in XWiki Syntax 1.0, this was not possible: * bold *).
  • Use double symbols when there was only a single symbol in XWiki Syntax 1.0 so that it's less likely that the user will mistakenly use them in text.
  • Ability to span several lines (wasn't possible in XWiki Syntax 1.0).
FeatureXWiki Syntax 2.0Result
Striked out--strike--strike
Superscriptsome ^^superscript^^some superscript
Subscriptsome ,,subscript,,some subscript

Horizontal Line

2.0 Horizontal Line

There must be 4 or more dashes.

Note that this is different from Creole where exactly 4 dashes are required.

FeatureXWiki Syntax 2.0Result
Simple horizontal line----

Parametrized horizontal line
(% style="color:blue" %)


2.0 Lists

Some of the mentioned styles do not work on all browsers. For a comprehensive list follow this link.

FeatureXWiki Syntax 2.0Result
Bulleted list
* item 1
** item 2
*** item 3
* item 4
  • item 1
    • item 2
      • item 3
  • item 4
Numbered list
1. item 1
11. item 2
111. item 3
1. item 4
  1. item 1
    1. item 2
      1. item 3
  2. item 4
Mixed list
1. item 1
1*. item 2
1*. item 3
1. item 4
  1. item 1
    • item 2
    • item 3
  2. item 4
Square list
(% style="list-style-type: square" %)
* item 1
* item 2
  • item 1
  • item 2
Disc list
(% style="list-style-type: disc" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Alphabetical list
(% style="list-style-type: lower-alpha" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Alphabetical list
(% style="list-style-type: upper-alpha" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Roman list
(% style="list-style-type: lower-roman" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Roman list
(% style="list-style-type: upper-roman" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Greek list
(% style="list-style-type: lower-greek" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Greek list
(% style="list-style-type: upper-greek" %)
* item 1
* item 2
  • item 1
  • item 2
Hiragana list
(% style="list-style-type: hiragana" %)
* item 1
* item 2
  • item 1
  • item 2
Hiragana Iroah list
(% style="list-style-type: hiragana-iroha" %)
* item 1
* item 2
  • item 1
  • item 2
Katakana list
(% style="list-style-type: katakana" %)
* item 1
* item 2
  • item 1
  • item 2
Katakana Iroha list
(% style="list-style-type: katakana-iroha" %)
* item 1
* item 2
  • item 1
  • item 2
Armenian list
(% style="list-style-type: armenian" %)
* item 1
* item 2
  • item 1
  • item 2
Hebrew list
(% style="list-style-type: hebrew" %)
* item 1
* item 2
  • item 1
  • item 2
Georgian list
(% style="list-style-type: georgian" %)
* item 1
* item 2
  • item 1
  • item 2
CJK ideographic list
(% style="list-style-type: cjk-ideographic" %)
* item 1
* item 2
  • item 1
  • item 2

Definition Lists

2.0 Definition Lists

FeatureXWiki Syntax 2.0Result
Standard definition
; term
: definition
Nested definitions
; term 1
: definition 1
:; term 2
:: definition 2
term 1
definition 1
term 2
definition 2
Parametrized definition
(% style="color:blue" %)
; term
: definition

New Line/Line Breaks

2.0 New Line Line Breaks

A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text.

In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole Syntax.

FeatureXWiki Syntax 2.0Result
Line breakLine\\New lineLine
New line
New lineLine
New line
New line
FeatureXWiki Syntax 2.0Result
Link to a page in the current Space[[WebHome]]XWiki
Link with a label

XWiki Syntax is supported inside link labels.

Link with XWiki Syntax in the label[[**bold label**>>WebHome]]bold label
Link to a page with the space specified[[Main.WebHome]]Main
Link to a subwiki[[subwiki:Main.WebHome]]Main
Link that opens in a new window[[label>>WebHome||target="_blank"]]label
Link to a URL directly in the textThis is a URL: http://xwiki.orgThis is a URL: http://xwiki.org
Link to a URL[[http://xwiki.org]]http://xwiki.org
Link to a URL with a label[[XWiki>>http://xwiki.org]]XWiki
Link to an email address[[[email protected]>>mailto:[email protected]]][email protected]
Image Link[[image:[email protected]>>Space1.Page1]]img.png
Image Link with image parameters[[[[image:[email protected]||width="26" height="26"]]>>Space1.Page1]]img.png
Link to an attachment on the current page[[text>>attach:img.png]]text
Link to an attachment in a different page[[text>>attach:[email protected]]]text
Link to an Anchor in a page[[label>>Space.Page#anchor]]label
Link to a Heading in a page[[label>>Space.Page#HMyheading]]label
Link to an Anchor in the current page[[label>>#anchor]]label

When you add a Heading, an anchor named "H" followed by the heading title with only alpha characters is created. For example, for a Heading named "My heading", the generated anchor will be "HMyheading".

XWiki Syntax 2.0 Link Specification

The part in ( ) is required, while the parts in [ ] are optional.

The full format of a link is [label>>] (resource) [@interWikiAlias] [||parameters]

  • label: An optional string which will be displayed to the user as the link name when rendered. The label may contain XWiki Syntax. If no label is specified a default label will be generated. The generation pattern can be changed, see the Admin Guide. Example: My Page
  • resource: The full link reference using the following syntax: (reference) [?queryString] [#anchor]
    • reference: The link reference in one of the following forms:
      • URL: Any URL in the form of protocol://path. Examples: http://xwiki.org, https://svn.xwiki.org/
      • Wiki page reference in the form [[wikiName:] spaceNameList.] (pageName). Examples: WebHome, Main.WebHome, mywiki:Main.WebHome
        • wikiName: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: mywiki
        • spaceNameList: An optional dot-separated list of wiki Space names. If no space is specified the current space is used. Examples: Main, A.B, A.B.C
        • pageName: A required string containing the name of the linked wiki page. Example: WebHome
      • Attachment reference in the form attach: [[email protected]] (attachmentName). Examples: attach:img.png, attach:mywiki:Ma[email protected]
        • attach: A required string identifying the resource as attachment.
        • wikiPageName: An optional string referencing the page that holds the attachment, see "Wiki page" above.
        • attachmentName: Name of the attachment as it is stored in the wiki.
      • Email address in the form mailto: (emailAddress) (#anchor is not valid). Example: mailto:[email protected]
        • mailto: A required string identifying the resource as email.
        • emailAddress: Targeted email address. Example: "[email protected]"
    • queryString: An optional query string for specifying parameters that will be used in the rendered URL. Example: mydata1=5&mydata2=Hello
    • anchor: An optional anchor name pointing to an anchor defined in the referenced link. Note that in XWiki anchors are automatically created for headings. Example: HTableOfContents
  • interWikiAlias: An optional Inter Wiki alias as defined in the InterWiki Map (see the Admin Guide). This is only valid for wiki page names. Example: wikipedia
  • parameters: An optional list of parameters passed to the link. Example: target="_blank" (open in new window)


2.0 Tables

Allows to easily create content in table format. Parameters for table, row or cell are also supported in XWiki Syntax 2.0.

FeatureXWiki Syntax 2.0Result
Standard table
|=Title 1|=Title 2
|Word 1|Word 2
!=Title 1!=Title 2
!!Word 1!!Word 2
Title 1Title 2
Word 1Word 2
Parametrized table
(% style="background-color:red;text-align:center" %)
|=Title 1|=(% style="background-color:yellow" %)Title 2
|Word 1|Word 2
Title 1Title 2
Word 1Word 2
Filterable Sortable table
$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)

(% class="grid sortable filterable doOddEven" id="tableid" %)
(% class="sortHeader" %)|=Title 1|=Title 2
|Cell 11|Cell 12
|Cell 21|Cell 22

For improved features see the Livetable Macro.

Title 1Title 2
Cell 11Cell 12
Cell 21Cell 22


2.0 Images

FeatureXWiki Syntax 2.0Result
Image from attachment on current pageimage:img.pngimg.png
Image from attachment on another pageimage:[email protected]img.png
Image with parameters[[image:img.png||width="25" height="25"]]img.png
Images located at URLimage:http://some/url/img.pngimg.png

XWiki Syntax 2.0 Image Specification

The part in ( ) is required, while the parts in { } are optional.

The full format of an image is either image: (reference) or [[image: (reference) {||parameters}]]

  • image: A required string identifying the resource as image.
  • reference: The reference to the image that shall be displayed in one of the following forms:
    • URL: Any URL to an image in the form of http://path/imageName. Example: http://domain.org/path/img.png
    • Attachment reference in the form {{{wikiName:} space.} [email protected]} (imageName)
      • wikiName: An optional string containing the name of a virtual wiki. The image reference will point to an image attached to a page inside that virtual wiki. Example: mywiki
      • space: An optional wiki Space name. If no space is specified the current space is used. Example: Main
      • page: An optional string containing the name of the wiki page to which the referenced image is attached. Example: WebHome
      • imageName: A required string containing the name of the image attached to a page as it is stored in the wiki.
  • parameters: An optional list of space-separated parameters passed to the image. Example: width="800" height="600" alt="img.png" title="My nice image"
    • HTML attributes: All attributes defined by the HTML standard will be added to the rendered HTML <img> tag.
      • style: CSS style information that should be applied to the image. Examples: style="float:right;height:50" (image on right side, height 50 px), style="display:block;margin-left:auto;margin-right:auto;width:80%" (image centered, width 80% of block width), style="vertical-align:bottom" (text starts at bottom of picture)
      • height: A parameter that defines the height of the displayed image. The value should be presented either in pixel (example: height="80") or in pixel related to the height of the block containing the image (example: height="40%").
      • width: A parameter that defines the width of the displayed image. The value should be presented either in pixel (example: width="80") or in pixel related to the width of the block containing the image (example: width="40%").
      • title: A parameter that defines the title the displayed image which will be visible when hovering the mouse trigger over the image, for instance. Example: title="My nice image"
      • alt: A parameter that defines which text should be displayed if the browser is not able to display the image. Since this is a required HTML attribute XWiki will use the file name instead if the alt parameter is not defined. Example: alt="img.png"
      • More: A more in depth explanation on the HTML <img> tag including more attributes can be reviewed on w3.org.



2.0 Verbatim

Allow to enter content that will not be formatted (in other words the XWiki Syntax will not be taken into account).

FeatureXWiki Syntax 2.0Result
Verbatim inlineSome verbatim {{{**[[not rendered]]**}}} contentSome verbatim **[[not rendered]]** content
Verbatim block
multi line
multi line


2.0 Quotations

Allows to quote some text.

FeatureXWiki Syntax 2.0Result
Simple quote
> john said this
I said ok

 john said this

I said ok

Nested quotes
> john said this
>> marie answered that
I said ok

 john said this

 marie answered that

I said ok


2.0 Groups

Groups can be used to insert another document inline directly into the current document. This allows for example to insert complex elements or style inside a list item, inside a table cell or a paragraph. Groups are delimited by the following syntactic elements: (((...))). One Group can contain another Group and there is no limit of imbrication.

XWiki Syntax 2.0Result
|=Header 1|=Header 2|=Header 3
|Cell One|(((
= Embedded document =

Some embedded paragraph.

* list item one
* list item two
  ** sub-item 1
  ** sub-item 2
))) | Cell Three

Next paragraph in the top-level document
Header 1Header 2Header 3
Cell One

Embedded document

Some embedded paragraph.

  • list item one
  • list item two
    • sub-item 1
    • sub-item 2
 Cell Three

Next paragraph in the top-level document

(% class="myClass" style="color:blue" %)(((blue paragraphs

inside myClass)))

blue paragraphs

inside my group


2.0 Escapes

Allows to escape XWiki Syntax.

FeatureXWiki Syntax 2.0Result
Escape a character

This is not a ~[~[link~]~]
To enter a ~ character use a double escape: ~~

This is not a [[link]]
Escape longer text
(also see "Verbatim")
{{{ some **longer** text //without// formatting}}} some **longer** text //without// formatting


2.0 Parameters

With XWiki Syntax 2.0 it's possible to pass parameters to the different syntax elements and also to blocks of text. This is used for example to style them. You can set any parameter key/value pair you want. The XHTML renderer will pass these parameters as XHTML attributes to the underlying XHTML representation of the different syntax elements.

XWiki Syntax 2.0Generated XHTML
(% class="myClass" style="myStyle" id="myId" %)
= heading =
<h1 class="myClass" style="myStyle" id="myId">heading</h1>



2.0 Macros

There is only one kind of macro in XWiki Syntax 2.0, which is called by the syntax: {{macroname param1="value1" ... paramN="valueN"}}...{{/macroname}}. For macros without content there's a short notation: {{macroname param1="value1" ... paramN="valueN"/}}

FeatureXWiki Syntax 2.0Result
Rendering Macro with a content
{{code language="java"}}
System.out.println("Hello World!");
System.out.println("Hello World!");
Rendering Macro without content

{{include reference="Space.Page"/}}

The referenced page is included in the current page

Radeox macros cannot be used in XWiki Syntax 2.0. Thus they have been rewritten as Rendering macros.

For the full list of available macros check the Extensions wiki.

Macros in this wiki

tocTable Of ContentsNavigationGenerates a Table Of Contents.Global
scmscmDocumentationProduce scm linkGlobal
iconPickerIcon PickerDevelopmentSelect an icon within the XWiki icon set.Current Wiki
formulaFormulaContentDisplays a mathematical formula.Global
wikimacrocontentWikiMacro ContentDevelopmentDisplay editable content of a wikimacro.Global
mentionUser MentionInsert a user mention.Current Wiki
asyncAsyncContentAsynchronous and cached execution of wiki content.Global
spaceindexSpace IndexDeprecatedLists documents in a space.Current Wiki
poweredByPowered ByDisplays a random reference summaryGlobal
boxBoxFormattingDraw a box around provided content.Global
spacesSpacesDeprecatedDisplays all the spaces in this wiki.Current Wiki
errorError MessageFormattingDisplays an error message note.Global
remotecodeRemote CodeDisplays the code (using the code macro) of a remote fileGlobal
warningWarning MessageFormattingDisplays a warning message note.Global
phpPHPDevelopmentExecutes a PHP script.Global
messageSenderMessage SenderSocialA control that allows users to enter messages that are handled by the MessageStream module.Current Wiki
childrenChildrenNavigationDisplays a tree of children pages of the current pageCurrent Wiki
displayDisplayContentDisplay other pages into the current page.Global
translationTranslationContentDisplay a translation message.Global
contextContextDevelopmentExecutes content in the context of the passed documentGlobal
jiraJIRAContentFetches information from a JIRA server and displays them as a table, list or enumeration.Global
infoInfo MessageFormattingDisplays an info message note.Global
treeTreeNavigationDisplays a tree hierarchy defined by the macro content or the source parameter.Current Wiki
liveDataLive DataContentDisplay dynamic lists of data.Global
rssRSSContentOutput latest feed entries from a RSS feed.Global
successSuccess MessageFormattingDisplays a success message note.Global
documentTreeDocument TreeNavigationDisplays the tree of XWiki documents.Current Wiki
templateTemplateDevelopmentInsert a template.Global
notificationsAutoWatchPreferencesNotifications Auto Watch PreferencesNotificationsCurrent Wiki
chartChartContentDisplays a graphical chart generated from miscellaneous data sourcesGlobal
containerContainerLayoutA macro to enclose multiple groups and add decoration, such as layout.Global
notificationsEmailPreferencesNotifications Email PreferencesNotificationsDisplay the preferences of the current user about notification emails.Current Wiki
tagcloudTag CloudContentDisplays the cloud of tags in this wiki or in the specified space, if any.Current Wiki
activityActivity (legacy)NotificationsProvide a macro implemented with the Notifications Application to keep a backward compatibility with Activity Stream.Current Wiki
pythonPythonDevelopmentExecutes a python script.Global
commentCommentDevelopmentAllows putting comments in the source content. This macro doesn't output anything.Global
htmlHTMLDevelopmentInserts HTML or XHTML code into the page.Global
contentContentContentAllows writing content in any wiki markupGlobal
scriptScriptDevelopmentExecute script in provided script language.Global
languageLanguageList the flag and name for a given list of languagesGlobal
useravatarUser AvatarContentAllows displaying the avatar for a specific user.Global
officeOffice Document ViewerContentView office attachments (doc, ppt, xls, odt, odp, ods etc.) inside wiki pages without downloading or importing them.Global
galleryGalleryLayoutDisplays the images found in the provided content using a slide-show view.Global
dashboardDashboardLayoutA macro to define a dashboard.Global
putFootnotesPut FootnoteContentDisplays the footnotes defined so far. If missing, all footnotes are displayed by default at the end of the page.Global
attachmentSelectorAttachment SelectorDevelopmentA control to be used for object properties of the current document that are supposed to contain the name of an attachment from the current (or target) document. Allows uploading new attachments, and deleting attachments from the target document.  If no target document is specified, the current document will be used. Object properties are only saved to the current document.Current Wiki
notificationsApplicationsPreferencesNotifications Applications PreferencesNotificationsDisplay the preferences of the current user about notification applications.Current Wiki
imageImagecontentDisplays an image in a boxGlobal
cacheCacheDevelopmentCaches content.Global
menuMenuNavigationDisplays a menu created using simple wiki syntax (nested lists and links).Global
browserBrowserDisplays a browser entry containing the browser's icon, name and version. Meant to be used in Release Notes or Support browsers sections.Global
todoTodocontentTodo macroGlobal
productVersionsProduct VersionscontentDisplay product versions for testingGlobal
documentsDocumentsContentDisplays a list of documents in a LivetableCurrent Wiki
databaseDatabaseDisplays a database entry containing the database's icon, name and version. Meant to be used in Release Notes or Support databases sections.Global
notificationsFiltersPreferencesNotifications Filters PreferencesNotificationsDisplay the preferences of the current user about notification filters.Current Wiki
notificationsNotificationsNotificationsCurrent Wiki
velocityVelocityDevelopmentExecutes a Velocity script.Global
versionVersionContentSpecifies since which versions of XWiki the content of the macro corresponds to.Global
ctsdataCTS DataDevelopmentParses XWiki Rendering Compatibility Test Suite (CTS) JUnit ResultsGlobal
wikimacroparameterWikiMacro ParameterDevelopmentDisplay editable parameter of a wikimacro.Global
groovyGroovyDevelopmentExecute a groovy script.Global
showhideshowhidecontentShow Hide MacroGlobal
footnoteFootnoteContentGenerates a footnote to display at the end of the page.Global
latestBlogPostsLatest Blog PostsShows the latest blog posts articlesGlobal
codeCodeFormattingHighlights code snippets of various programming languagesGlobal
idIdNavigationAllows putting a reference/location in a page. In HTML for example this is called an Anchor. It allows pointing to that location, for example in links.Global
includeIncludeContentInclude other pages into the current page.Global


2.0 HTML

In XWiki Syntax 2.0 HTML or XHTML must be entered by using the HTML macro.

XWiki Syntax 2.0Result
{{html}}<b>bold</b>{{/html}} bold

In XWiki Syntax 2.0, by default the HTML macro does not understands XWiki Syntax (other macros included since it's XWiki Syntax too). To enable it, use {{html wiki="true"}} .


2.0 Scripts

In XWiki Syntax 1.0 it was possible to enter Velocity scripts anywhere directly in the page. This lead to issues for example when the user was involuntarily entering Velocity content. It was also performance hungry for pages not requiring Velocity content. There were several other technical limitations. Thus in XWiki Syntax 2.0 Velocity scripts must be entered using the velocity macro. Same goes for entering Groovy scripts.

FeatureXWiki Syntax 2.0
Velocity script
#set ($var = "whatever")
Groovy script
def var = "whatever"
  • Powered by XWiki 12.10.5-node1. Hosted and managed by XWiki SAS

Get Connected