Discussion:
[saxon] Missing Child Elements
KAMOHELO MOFOKENG
2011-08-25 09:34:41 UTC
Permalink
Hi All,
 
I'm getting the exception:
 
-----------------------------------------------------------------------------------------------------------------------------------
(Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:block-container is missing child elements.
 
Required Content Model: marker* (%block;)+
___________________________________________________________________________
 
Although the exception is explanatory, I'm not sure which child element is missing & how to look for it. As far as I can see all seems fine in the .xsl file (attached) I'm using.
 
After googling, I found this link: http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_25570227.html
 but I still can't figure out what's wrong with my style sheet file.
 
Can anyone tell me what's wrong with the stylesheet file attached?
Also, what tools do you use for troubleshooting stylesheets?
 
Thanks in advance.
 
Regards,
Kamo
Andrew Welch
2011-08-26 10:11:23 UTC
Permalink
Post by KAMOHELO MOFOKENG
-----------------------------------------------------------------------------------------------------------------------------------
(Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:block-container is missing child elements.
Required Content Model: marker* (%block;)+
___________________________________________________________________________
Although the exception is explanatory, I'm not sure which child element is missing & how to look for it. As far as I can see all seems fine in the .xsl file (attached) I'm using.
This is the Saxon mailing list, for xsl:fo questions you should ask
them on the xsl-list (or maybe that yahoo groups one...).

Without the source xml, it's not possible to give anything other than
a guess, but looking at the xslt, you have this:

<fo:block-container>
<xsl:variable .....
<xsl:for-each select="MEM-STMT/ACC/PROV">
<fo:block>

If that xsl:for-each selects nothing, you will end up with an empty
fo:block-container, which isn't allowed.



--
Andrew Welch
http://andrewjwelch.com
Michael Kay
2011-08-26 10:12:34 UTC
Permalink
I'm sorry, but I can't debug your stylesheet code for you. That's not
the purpose of this list.

Some people like to use the debuggers available in oXygen or Stylus
Studio. However, my own experience is that these often don't help very
much with the most common kind of error, which is an incorrect path
expression.

You might find (I don't guarantee it) that if you save the generated
XSL-FO as a file, and then run it through FOP as a separate processing
phase, that it tells you where the fo:block-container with the missing
child is to be found. Or there might be a way of validating it
independently of FOP. Anyway, my first step in debugging this would be
to study the XSL-FO file and determine what's wrong with it. The next
step would be to determine where the XSLT code is that is generating the
incorrect XSL-FO. Once that is known, the error might stare you in the
face (as likely as not, it's something like an xsl:for-each with a
select expression that selects nothing from the input). If it does turn
out to be a select expression that is selecting nothing, and you can't
work out why by staring at it, the best approach is usually to break it
down into simpler XPath expressions (for example, by removing predicates
one at a time) to work out what change makes a difference.

Michael Kay
Saxonica
Post by KAMOHELO MOFOKENG
Hi All,
-----------------------------------------------------------------------------------------------------------------------------------
Error(Unknown location): fo:block-container is missing child elements.
Required Content Model: marker* (%block;)+
___________________________________________________________________________
Although the exception is explanatory, I'm not sure which child
element is missing & how to look for it. As far as I can see all seems
fine in the .xsl file (attached) I'm using.
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_25570227.html
but I still can't figure out what's wrong with my style sheet file.
Can anyone tell me what's wrong with the stylesheet file attached?
Also, what tools do you use for troubleshooting stylesheets?
Thanks in advance.
Regards,
Kamo
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
https://lists.sourceforge.net/lists/listinfo/saxon-help
Andrew Welch
2011-08-26 10:25:32 UTC
Permalink
Some people like to use the debuggers available in oXygen or Stylus Studio. However, my own experience is that these often don't help very much with the most common kind of error, which is an incorrect path expression.
One tip for anyone debugging missing output in large complex multiple
file tranforms:

1. run the entire transform through the debugger

2. click on the output at the point just before where the missing
output should be

3. put a break point in the xslt at the location the debugger jumps to
after step 2

4. re-run the transform so it stops at the break point

5. use the call-stack to work back up through the hierarchy to
determine why the the program flow hasn't hit the template you
expected...



--
Andrew Welch
http://andrewjwelch.com
KAMOHELO MOFOKENG
2011-08-26 10:31:48 UTC
Permalink
Hi Andrew,
 
Thanks for the response.
 
This is the Saxon mailing list, for xsl:fo questions you should ask them on the xsl-list (or > maybe that yahoo groups one...).
Will do, I get confused about the forums that I should post into sometimes.
 
If that xsl:for-each selects nothing, you will end up with an empty
fo:block-container, which isn't allowed.
I'll look into it & see if we can't use xsl:for-each differently within fo:block-container.
 
Regards,
Kamo

--- On Fri, 8/26/11, Andrew Welch <***@gmail.com> wrote:


From: Andrew Welch <***@gmail.com>
Subject: Re: [saxon] Missing Child Elements
To: "Mailing list for the SAXON XSLT and XQuery processor" <saxon-***@lists.sourceforge.net>
Date: Friday, August 26, 2011, 1:11 PM
-----------------------------------------------------------------------------------------------------------------------------------
(Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:block-container is missing child elements.
Required Content Model: marker* (%block;)+
___________________________________________________________________________
Although the exception is explanatory, I'm not sure which child element is missing & how to look for it. As far as I can see all seems fine in the .xsl file (attached) I'm using.
This is the Saxon mailing list, for xsl:fo questions you should ask
them on the xsl-list (or maybe that yahoo groups one...).

Without the source xml, it's not possible to give anything other than
a guess, but looking at the xslt, you have this:

<fo:block-container>
    <xsl:variable .....
    <xsl:for-each select="MEM-STMT/ACC/PROV">
        <fo:block>

If that xsl:for-each selects nothing, you will end up with an empty
fo:block-container, which isn't allowed.



--
Andrew Welch
http://andrewjwelch.com
KAMOHELO MOFOKENG
2011-08-26 10:36:53 UTC
Permalink
Hi Michael,
 
Much appreciated for the suggestions you give.
 
Being new to xsl-fo & xsl, I'm still trying to find a way to debug & troubleshoot problems that I encounter so your post points me in the right direction. 

Regards,
Kamo

--- On Fri, 8/26/11, Michael Kay <***@saxonica.com> wrote:


From: Michael Kay <***@saxonica.com>
Subject: Re: [saxon] Missing Child Elements
To: "Mailing list for the SAXON XSLT and XQuery processor" <saxon-***@lists.sourceforge.net>, ***@yahoo.com
Date: Friday, August 26, 2011, 1:12 PM


I'm sorry, but I can't debug your stylesheet code for you. That's not the purpose of this list.

Some people like to use the debuggers available in oXygen or Stylus Studio. However, my own experience is that these often don't help very much with the most common kind of error, which is an incorrect path expression.

You might find (I don't guarantee it) that if you save the generated XSL-FO as a file, and then run it through FOP as a separate processing phase, that it tells you where the fo:block-container with the missing child is to be found. Or there might be a way of validating it independently of FOP. Anyway, my first step in debugging this would be to study the XSL-FO file and determine what's wrong with it. The next step would be to determine where the XSLT code is that is generating the incorrect XSL-FO. Once that is known, the error might stare you in the face (as likely as not, it's something like an xsl:for-each with a select expression that selects nothing from the input). If it does turn out to be a select expression that is selecting nothing, and you can't work out why by staring at it, the best approach is usually to break it down into simpler XPath expressions (for example, by removing predicates one at a time) to work out what change makes a
difference.

Michael Kay
Saxonica

On 25/08/2011 10:34, KAMOHELO MOFOKENG wrote:





Hi All,
 
I'm getting the exception:
 
-----------------------------------------------------------------------------------------------------------------------------------
(Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:block-container is missing child elements.
 
Required Content Model: marker* (%block;)+
___________________________________________________________________________
 
Although the exception is explanatory, I'm not sure which child element is missing & how to look for it. As far as I can see all seems fine in the .xsl file (attached) I'm using.
 
After googling, I found this link: http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/Lotus_SmartSuite/Lotus_Notes/Q_25570227.html
 but I still can't figure out what's wrong with my style sheet file.
 
Can anyone tell me what's wrong with the stylesheet file attached?
Also, what tools do you use for troubleshooting stylesheets?
 
Thanks in advance.
 
Regards,
Kamo
KAMOHELO MOFOKENG
2011-08-26 10:40:16 UTC
Permalink
Hi Andrew,
 
The steps you have provided helps alot.
 
Regards,
Kamo

--- On Fri, 8/26/11, Andrew Welch <***@gmail.com> wrote:


From: Andrew Welch <***@gmail.com>
Subject: Re: [saxon] Missing Child Elements
To: "Mailing list for the SAXON XSLT and XQuery processor" <saxon-***@lists.sourceforge.net>
Cc: ***@yahoo.com
Date: Friday, August 26, 2011, 1:25 PM
Some people like to use the debuggers available in oXygen or Stylus Studio. However, my own experience is that these often don't help very much with the most common kind of error, which is an incorrect path expression.
One tip for anyone debugging missing output in large complex multiple
file tranforms:

1. run the entire transform through the debugger

2. click on the output at the point just before where the missing
output should be

3. put a break point in the xslt at the location the debugger jumps to
after step 2

4. re-run the transform so it stops at the break point

5. use the call-stack to work back up through the hierarchy to
determine why the the program flow hasn't hit the template you
expected...



--
Andrew Welch
http://andrewjwelch.com

Continue reading on narkive:
Loading...