You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by kralik <kr...@ijablonec.cz> on 2006/04/30 14:06:45 UTC

Problems with XSL:NUMBER

Hello all!

I have a strange problems with numbering of pictures in my document. 
I am trying to make FO file from my XML document and XSL-FO file using
XALAN-J 2.7.0. Then I want to produce PDF. Problems appear in FO file.

I have pictures with description and without description (shorted tag). I
want to have numbered ONLY pictures with description.

1. Numbering begins from zero (0) :-((( It's probably my mistake, but I
can't find resolution.

2. Some numbers appear twice (Picture 5 in my FO file). When I try to
produce PDF file using XEP, numbering is OK in this point (but begins from
zero too :-( ). 

My input file "Obrazky.xml" 
My XSL file "Obrazky.xsl" 

Any idea?

Thanks, Pavel Tyl

--
View this message in context: http://www.nabble.com/Problems-with-XSL%3ANUMBER-t1532656.html#a4163596
Sent from the Xalan - J - Users forum at Nabble.com.

Re: Problems with XSL:NUMBER

Posted by kralik <kr...@ijablonec.cz>.
Last post is already corrected, sorry.

Pavel Tyl
--
View this message in context: http://www.nabble.com/Problems-with-XSL%3ANUMBER-t1532656.html#a4180738
Sent from the Xalan - J - Users forum at Nabble.com.


Re: Problems with XSL:NUMBER

Posted by kralik <kr...@ijablonec.cz>.
Last post is already corrected, sorry.

Pavel Tyl
--
View this message in context: http://www.nabble.com/Problems-with-XSL%3ANUMBER-t1532656.html#a4180737
Sent from the Xalan - J - Users forum at Nabble.com.


Re: Problems with XSL:NUMBER

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Pavel.

kralik <kr...@ijablonec.cz> wrote on 2006-04-30 08:06:45 AM:
> My input file "Obrazky.xml" 
> My XSL file "Obrazky.xsl" 

     The links to both Obrazky.xml and Obrazky.xsl pointed to 
<http://laduska.ic.cz/diplomka/Obrazky.xml>.  Could I ask you to send a 
link to the XSL file?

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com


Re: Problems with XSL:NUMBER

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Pavel.

kralik <kr...@ijablonec.cz> wrote on 2006-04-30 08:06:45 AM:
> 1. Numbering begins from zero (0) :-((( It's probably my mistake, 
> but I can't find resolution.

Your xsl:number instruction looks like this:

<xsl:number count="//Picture//text()" from="DiplomovA¡_prA¡ce"
            level="any" format="1.: "/>

According to section 7.7 of XSLT 1.0,

When level="any", it constructs a list of length one containing the number 
of nodes that match the count pattern and belong to the set containing the 
current node and all nodes at any level of the document that are before 
the current node in document order, excluding any namespace and attribute 
nodes 

The current node in this case, is the first Picture element in the 
document.  The first node that matches the count pattern is the child text 
node of that Picture element, so it doesn't belong to the set containing 
the current node and all nodes preceding the current node it in document 
order.  I think what you really want to write is this:

<xsl:number count="//Picture[.//text()]" from="DiplomovA¡_prA¡ce"
            level="any" format="1.: "/>

> 2. Some numbers appear twice (Picture 5 in my FO file). When I try 
> to produce PDF file using XEP, numbering is OK in this point (but 
> begins from zero too :-( ). 

That looks like a bug in Xalan-Java.  Could I ask you to open a bug report 
for that problem?  (By the way, the bug is hidden if you make the 
correction to xsl:number I described above.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com