Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Modified as per review HTML-940

...

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 XSL definition entered directly in the macro editor is as follows:

...

...

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:ac="http://www.atlassian.com/schema/confluence/4/ac/" version="1.0">

<xsl:template match="/">
  <html>
  <body>
  <h2>My CD Collection</h2>
      <xsl:for-each select="catalog/cd">
        <ac:macro>
          <xsl:attribute name="ac:name">expand</xsl:attribute>
          <ac:parameter>
			<xsl:attribute name="ac:name">title</xsl:attribute>
			<xsl:value-of select="title"/>
		  </ac:parameter>
		  <ac:rich-text-body>
			  <div>
                <h3>Title:</h3><xsl:value-of select="title"/>
              </div>
              <div>
                <h3>Artist:</h3><xsl:value-of select="artist"/>
              </div>
              <div>
                <h3>Country:</h3><xsl:value-of select="country"/>
              </div>
		  </ac:rich-text-body>
        </ac:macro>
      </xsl:for-each>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

The content displayed after publishing the page appears as:

...

Example - API functions list

In this example, a list of API functions are to be displayed on a page.

Points to note for this example:

  • The details of the services are available in an XML file and the location is specified in the Location of XML Code macro parameter.

  • The XSL file location is entered in the Location of XSL Code macro parameter. Thus, the macro editor is left blank.

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

...

The content displayed on the page after publishing is as follows:

...

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