[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Using for-each w/ page-sequence results in "NC105

Subject: Re: Using for-each w/ page-sequence results in "NC105 ID already exists in this document" error
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 19 Sep 2007 17:11:35 -0400
Re:  Using for-each w/ page-sequence results in "NC105
Sharon,

At 04:53 PM 9/19/2007, you wrote:
Am I correct in thinking that in order to get the page sequence to start
over for each instance of the Lesson element, that I need to have a
for-each statement before the page sequence?

Not necessarily, if I understand you correctly. Basically the reason for this is that anything you can do with a for-each, you can do equally well (and often better) with a template and apply-templates. So whether the page-sequence element is inside a template or inside a for-each instruction isn't actually any indication, in itself, of where there's a problem.


If so, how do I ensure the IDs are unique for every instance of the Lesson element?

You may or may not have a problem with generating a single page sequence with a unique identifier for every Lesson in the input. It sounds like you do, but we can't know this for sure, to say nothing of why this might be, without more information. (Best would be to see a reduced version of your code that duplicates the error, but that boils it down to a minimal case for legibility.)


However, I wouldn't take this tack just yet. Instead, I'd analyze the output to find which elements are getting duplicate identifiers. The best way to do this is to examine the FO result of your stylesheet before it is picked up by the XSL formatter, to be rendered as PDF. Do this by running your XSLT stylesheet on it without the formatter, using just an XSLT engine, and saving the FO results as an XML file. You can then examine this file directly and look at the IDs. Seeing where they duplicate will direct you to where in your stylesheet things are not coming out right. You could, for example, be assigning the IDs to elements inside the ToC as well as to the page sequences it points to.

As it is, the FO engine is telling you there's a problem, but not where it is. You need to locate it before you can trace it back to what's causing it.

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.