xsl-list
[Top] [All Lists]

Re: [xsl] Using for-each w/ page-sequence results in "NC105 ID already exists in this document" error

2007-09-20 06:49:02
Thank you so much for replying.

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.

I have all the page sequences contained within a template. I have 5 page
sequences within that template that apply to 5 different elements (cover,
disclaimer, toc, introduction, lessons). There are multiple instances of
the Lesson element but the Lesson page sequence does not start over for
each instance.

I have the page sequences contained within the following template.

<xsl:template match="/">
      <fo:root>
                  cover page sequence 1
                  disclaimer page sequence 2
                  toc page sequence 3
                  introduction page sequence 4
                  lessons page sequence 5 (contains <apply-templates
select="//Lesson" mode="Activity"/ in the Body flow>
      </fo:root>
</xsl:template>

Regarding analyzing the output, I do not get any including no output of a
fo document.

Thanks for your help!
_______________________________
Sharon Goldner Harris
Knowledge Management Evangelist
Ultimate Software Group
704-660-6482


                                                                           
             Wendell Piez                                                  
             <wapiez(_at_)mulberryt                                             
             ech.com>                                                   To 
                                       
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com     
             09/19/2007 05:12                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: [xsl] Using for-each w/         
             Please respond to         page-sequence results in "NC105 ID  
             xsl-list(_at_)lists(_dot_)mu         already exists in this 
document"    
              lberrytech.com           error                               
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




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(_at_)mulberrytech(_dot_)com
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
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>