Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can you nest user macros in Confluence?

David Stephensen
Contributor
June 16, 2013

I just tried to nest two user macros and got this error message:

Error rendering macro 'ref-standards' : Failed to transform the HTML macro template for display. 
Nested message: The XML content could not be parsed. There is a problem at line 1, column 978. 
Parser message: Duplicate attribute 'id'. at [row,col {unknown-source}]: [1,978]

The outer macro was

## Macro title: Reference to standards
## Macro has a body: Y
## Body processing: Rendered
## Developed by: David Stephensen
## Date created: 17-Jun-2013
## Installed by: David Stephensen
## Encloses standards reference block in a DIV with an ID 
## @noparams
<div id="ref-standards">$body</div>

and the inner one (actually there were 3 similar ones one after the other, but just putting one in did not work either) was

## Macro title: Reference to ISO 9001
## Macro has a body: Y
## Body processing: Rendered
## Developed by: David Stephensen
## Date created: 17-Jun-2013
## Installed by: David Stephensen
## Encloses ISO 9001 reference in a DIV with an ID 
## @noparams
<div id="ref-iso-9001">$body</div>

All of the macros work fine individually. Am I meant to be able to do this? Is there a trick?

2 answers

1 accepted

1 vote
Answer accepted
Denise Unterwurzacher [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2013

Hi there David, I believe that you are running into this issue: https://jira.atlassian.com/browse/CONF-23412

Long story short, you can nest macros inside each other, but you may run into issues if you use headings within them.

At Atlassian we allow our customers to input into our bug fix and feature request prioritisation. We do this with the voting system - the more votes and detailed comments a ticket has, the more likely it is to be implemented. We use this as a way of gauging the needs of our customer base as a whole. I'd recommend voting on that ticket, and adding a comment detailing how it affects your system and what you would like to see. If you also add yourself as a watcher to the ticket, you'll be notified whenever it's updated.

David Stephensen
Contributor
June 18, 2013

Thanks, Denise! You are a champion as always! Now I know what is happening I have been able to do a workaround that fixes the problem for me.

I just converted the headings in the inner (nested) text into bold paragraphs. Instantly out of trouble now I know what was going on!

I hope someone adopts this bug and fixes it soon. It is a bit of a worry for the deer-in-the-headlights club, of which I am a fully paid up member.

0 votes
David Stephensen
Contributor
June 16, 2013

The error was

Failed to transform the HTML macro template for display. Nested message:
The XML content could not be parsed. There is a problem at line 1, column 978.
Parser message: Duplicate attribute 'id'. at [row,col {unknown-source}]: [1,978]

The outer one was

## Macro title: Reference to standards
## Macro has a body: Y
## Body processing: Rendered
## Developed by: David Stephensen
## Date created: 17-Jun-2013
## Installed by: David Stephensen
## Encloses standards reference block in a DIV with an ID 
## @noparams
<div id="ref-standards">$body</div>

the inner one was

## Macro title: Reference to ISO 9001
## Macro has a body: Y
## Body processing: Rendered
## Developed by: David Stephensen
## Date created: 17-Jun-2013
## Installed by: David Stephensen
## Encloses ISO 9001 reference in a DIV with an ID 
## @noparams
<div id="ref-iso-9001">$body</div>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events