Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Div
idProductTOC

On this page

Table of Contents
maxLevel1
excludeOn this page
typeflat
separatorpipe

...

Features

...

  • Uses XSLT to transform XML to HTML, XHTML, or wiki markup. Supports XSLT 1.0.
  • Supports capabilities for including data similar to other scripting macros.
  • Supports find and replace for adjusting resulting output.
  • Allows the user to restrict the usage of Javascript in the XSLT macro (based on the configuration ofAllow Javascript in the Configuration page). The Confluence page throws a rendering error if this parameter is not enabled, and Javascript is inserted while using the macro.

Parameters

Table plus


Parameter
Macro Editor LabelDefault
Macro Browser Label
Description
output
Macro Parameter
html
Transformed output format
Determines

html

Specify how the

transformed

output is

to be

treated. The options are as follows:

  • html - transformed output is standard HTML.
  • xhtml - transformed output is treated as
XHTML
  • XHTML and rendered with the Confluence
XHTML macro body
  • XHTML renderer.
  • wiki - transformed output is treated as wiki markup and rendered with the Confluence wiki renderer.
source

output

Location of XML code
Required if global page template name -

macro body

Enter the location of data. Required, if style (XSLT code) is in the macro body.

  • #filename - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.
    • #http://... - Data is read from
    a global page template. Special note: How to deal with templates on Confluence 4.3 and later.space:page template name - Data is read from a space template
    • URL. May require the user and password parameters as well.
    • ^attachment - Data is read from an attachment to the current page.
    • page^attachment - Data is read from an attachment to the page name provided.
    • space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.
    style

    source

    Location of XSL code

    required

    or

    or macro body if source is specified

    Location

    Enter the location of

    XSLT

    XSL code

    . Required if source XML is in the macro body,

    otherwise

    else, it defaults to the content in macro body

  • #filename - Data is read from the file located in Confluence home directory/script/filename. Subdirectories can be specified.
  • global page template name -

    .

    • #http://... - Data is read from
    a global page template. Special note: How to deal with templates on Confluence 4.3 and later.space:page template name - Data is read from a space template
    • URL. May require the user and password parameters as well.
    • ^attachment - Data is read from an attachment to the current page.
    • page^attachment - Data is read from an attachment to the page name provided.
    • space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.
    find
    style
    Find regex patterns
    Comma

    Enter a comma separated list of regex patterns to

    use for repairing

    repair and

    modifying

    modify XML prior to processing by the XSLT processor with find and replace logic.

    HTML-68 has a bit more on this.

     Example: (google\.dtd)

    replace
    find
    Replacement strings
    Comma

    Enter a comma separated list corresponding to find patterns via index position in list.

    Single quote entries containing

    If a comma

    .

    is a part of an entry, use single quotes around itExample: http://www.google.com/$1

    headfalseInclude head section HTMLOnly in affect if clean=true. The head tag is always removed. However, set as true to retain all the other tags from the head section and treat them as regular body content. This is useful for retaining style information in particular.showErrorsfalseShow error message panelXSLT transformer generated warning and errors appear in a panel even if the transformer is not terminated with an error. Terminating errors automatically generate an error panel.Encoding
    replace
    File encoding

    system default

    File encoding
    Specify the encoding for an external file, if different from the system default handling. Example: UTF-8.
    user
    encoding
    URL user 
    User


    Enter the user name for URL access via basic authentication.
    password
    user
    URL user password 
    User

    Enter the password for URL access via basic authentication. 
    timeout
    password
    Timeout in milliseconds
    Enter time in milliseconds such that URL connections
    may
    do not timeout before getting data. Use this to increase time needed for slow connections.
    Be careful using 0 as the connection can then enter an infinite wait.disableSecureProcessingfalseDisable secure processing featureIf authorized by your Confluence administrator to change this setting, then more powerful capabilities are available. See Jira LegacyHTML-89HTML-89 for details. Administrators can use CMSP to enable these more powerful capabilities.xsltVersion1.0XSLT VersionThis parameter is available with 5.4.0 version. This lists the XSLT versions the macro is compatible with.
    Note that if a zero is given the connection may wait infinitely.timeout
    XSLT Version1.0Select the version based on your style (XSLT) input documentThis list box contains the XSLT versions that the macro is compatible with. 
    <transformer parameters>
    xsltVersion


    Only available when
    specifying XSLT
    specifying XSLT macro via wiki markup. See Passing parameters to the XSLT engine below.<transformer parameters>



    Usage

    Download a copy of the cdcatalog.xsl from https://www.w3schools.com/xml/cdcatalog.xsl and attach it to your page.

    ...

    No Format
    {xslt:source=xslt - basic^cdcatalog.xml|style=#http://www.w3schools.com/xsl/cdcatalog.xsl}
    {xslt}
    

    Anchor
    transformerParameters
    transformerParameters
    Passing parameters to the XSLT engine

    Parameters that are not interpreted by the XSLT macro are passed through to XSLT. You must use wiki macro syntax to take advantage of this.

    ...

    The output is: The value of winnersOnly is "lala".

    If you omit the parameter, then the output is: The value of winnersOnly is "no"

    Gallery

    Image Removed.