How to use nested macros with XSLT macro

This article explains how you can nest Expand macros within the XSLT macro.

XML code to add nested macros

To add nested macros in the XSLT macro, add the XML code in the following format to the XML file to be displayed:

<ac:macro> <xsl:attribute name="ac:name">expand</xsl:attribute> <ac:parameter> <xsl:attribute name="ac:name">title</xsl:attribute> <xsl:value-of select="@name"/> </ac:parameter> <ac:rich-text-body> ...... </ac:rich-text-body> </ac:macro>

The codes mentioned in this article are not meant for general use other than the format mentioned above. The code samples simply illustrate the format and usage of the given format to display the required XML file contents.

Example - Display CD catalog from an XML file

In this example, the requirement is to display a CD catalog with each CD’s title, artist, and country from where the artist originates.

Points to note for this example:

  • The catalog information is in the form of an XML file and is available at a remote location. Here, a profile is used to access the required file.
    See an article about profiles to learn more. Note, the article focuses on data center/server and depicts HTML macro examples. Use the same process to create profiles in cloud and use the Profile parameter in the XSLT macro to access the required file.

  • The XSL definitions are entered directly in the macro editor.

The details entered in the XSLT macro editor are as follows:

xslt_cld_tut_nestedMacros_ex1.png
Sample XSL definitions are entered in the XSLT macro editor

The code in the macro editor contains the nested Expand macro used to list out the details such as the title, the artist, and the country where the CD was made.

The content displayed after publishing the page appears as:

xslt_cld_tut_nestedMacros_ex1_res.png
Catalog displayed after publishing the page

If you face any difficulties in using this feature, contact our Support team for help.


Find answers from the community.

Ask a question to the community.

Log a request with our support team.

Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2024 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.

Unable to render {include} The included page could not be found.