Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

TOC macro throws up exception on some pages but not others

I use the TOC macro all over my pages but on some pages (seemingly inexplicably) it throws up an exception on some pages but not others. I get the following error:

Error rendering macro 'toc' : [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxParsingException: Duplicate attribute 'id'. at [row,col {unknown-source}]: [7,688]

I can't figure out why. Anybody know?

4 answers

Looks like you are hitting a known bug as raised here:

Unfortunately, there's no workaround at the moment. You may want to vote for it to be fixed and watch the page for any future updates.

You're right, I found this out a few days after I posted the question here. I can report that the way to work around this is not to avoid putting headers within other macros. It doesn't happen all the time but the instance where it was breaking for me, I could get around it by doing this.

Like scoffin likes this


I've got the same problem.

Can you explain what you mean by "the way to work around this is not to avoid putting headers within other macros" please?

IE, what does "not to avoid " and "headers" mean? Should headers be headings?

This is what our code looks like in HTML:

<ac:macro ac:name="toc">
<ac:parameter ac:name="maxLevel">3</ac:parameter>

I've tried moving the macro around within the page structure, deleting it altogether and adding a new one, and nothing works.


Grammar fail. Take what I said and remove the word "not" and change the word "headers": I can report that the way to work around this is to avoid putting headings within other macros

In other words, it's nothing to do with your macro that is generating the TOC but rather where you are putting your h1s, h2s, etc. Ensure your headings are only in the page body.

Like scoffin likes this

I can't believe I'm reading and liking this workaround from over 6 years ago because the same issue still persists! Either bring back my beloved Anchor macros or fix the table of contents!

Like # people like this


OK, I tried what you said but it didn't work. However, given what you said, I went through a copy of the entire page and started changing/removing elements (headings, macros etc), one at a time.

So all the headings were changed to paragraph, various macros were removed and re-instated. Finally I removed a macro called HTML Comment, and bingo Johnny! the TOC started rendering. :)

I then tested that all was ok by changing everything back to normal and it still works.

This means that the solution in your case isn't the solution in mine. Were/are you using the HTML Comment macro on any of your problem pages?

I think I have another page that is having the same problem, when I find that I'll run the same experiment again and report my findings here.


I wasn't actually using that macro so it's interesting that you had the same problem but with a different cause. Have you updated the JIRA ticket with this additional information? It could be useful for Atlassian.

Steve, good point, I've just added it. Cheers.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

383 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you