RE: Re: Help with table-of-contents:don't understand ref-id attribute
Here is a trimmed-down model of the XML. test-case-documents directory @name=dir-1 directory @name=dir-1-1 file nameTC_01/name .. More elements here .. /file /directory /directory test-case-documents This is the template in question: xsl:template match=file mode=toc fo:block text-align-last=justify fo:in-line value-of select=name / fo:leader leader-pattern=dots / fo:page-number-citation ref-id={name} / /fo:in-line /fo:block /xsl:template Here is where I invoke the template: xsl:template match=/ . XSLT goes here fo:page-sequence master-reference=matrix xsl:apply-templates select=test-case-documents/directory//file mode=toc / /fo:page-sequence . even more XSLT goes here /xsl:template When I apply-templates, the context node is a file, no? As you can see, name is a child of file and I assert the value of each name is unique throughout the document. Thanks for your interest. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Jay Bryant [EMAIL PROTECTED] Sent: Fri, 3 Mar 2006 10:58:21 -0600 To: fop-users@xmlgraphics.apache.org Subject: Re: Help with table-of-contents:don't understand ref-id attribute Hi, Charles, It is certainly true that the value of ref-id can be an element rather than an attribute. It doesn't even necessarily have to be a child of the element whose page number you want. I've bumped into XML that had ref values as top-level elements next to the heading elements. Of course, either an attribute or a child element makes for much nicer XSL. My first thought is that you have a context issue: The name node must be a child of the current context node. Unless you've used a for-each or some other structure to force the context to be the heading (or whatever) for which you are trying to get a page number, the processor can never find that node. I know you are a regular on the Mulberry XSLT list, though, so I bet you have already accounted for that possibility. Can you post some of your XML source and the relevent parts of your stylesheet or make a trimmed-down demonstration of the problem? If so, I'll be happy to try to help figure out the problem. Jay Bryant Bryant Communication Services - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with table-of-contents:don't understand ref-id attribute
This might be useful. It is a block of markup from the from the XSL-FO document produced by the template. fo:block text-align-last=justify fo:in-lineTC_01fo:leader leader-pattern=dots/ fo:page-number-citation ref-id=TC_01/ /fo:in-line /fo:block -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 12:15:41 -0500 To: fop-users@xmlgraphics.apache.org Subject: RE: Re: Help with table-of-contents:don't understand ref-id attribute Here is a trimmed-down model of the XML. test-case-documents directory @name=dir-1 directory @name=dir-1-1 file nameTC_01/name .. More elements here .. /file /directory /directory test-case-documents This is the template in question: xsl:template match=file mode=toc fo:block text-align-last=justify fo:in-line value-of select=name / fo:leader leader-pattern=dots / fo:page-number-citation ref-id={name} / /fo:in-line /fo:block /xsl:template Here is where I invoke the template: xsl:template match=/ . XSLT goes here fo:page-sequence master-reference=matrix xsl:apply-templates select=test-case-documents/directory//file mode=toc / /fo:page-sequence . even more XSLT goes here /xsl:template When I apply-templates, the context node is a file, no? As you can see, name is a child of file and I assert the value of each name is unique throughout the document. Thanks for your interest. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Jay Bryant [EMAIL PROTECTED] Sent: Fri, 3 Mar 2006 10:58:21 -0600 To: fop-users@xmlgraphics.apache.org Subject: Re: Help with table-of-contents:don't understand ref-id attribute Hi, Charles, It is certainly true that the value of ref-id can be an element rather than an attribute. It doesn't even necessarily have to be a child of the element whose page number you want. I've bumped into XML that had ref values as top-level elements next to the heading elements. Of course, either an attribute or a child element makes for much nicer XSL. My first thought is that you have a context issue: The name node must be a child of the current context node. Unless you've used a for-each or some other structure to force the context to be the heading (or whatever) for which you are trying to get a page number, the processor can never find that node. I know you are a regular on the Mulberry XSLT list, though, so I bet you have already accounted for that possibility. Can you post some of your XML source and the relevent parts of your stylesheet or make a trimmed-down demonstration of the problem? If so, I'll be happy to try to help figure out the problem. Jay Bryant Bryant Communication Services - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with table-of-contents:don't understand ref-id attribute
On Mar 3, 2006, at 18:15, [EMAIL PROTECTED] wrote: Hi Charles / Jay, The quote below is from the fo:page-number-citation section of the recommendation. I find the construction id trait puzzling. It seems that the authors have gone out of their way to avoid the term attribute, Hmm... right, but that's mostly because areas do not have attributes, only the FOs that generate areas or their descendant nodes in the FO tree have attributes. Areas have traits that correspond to (or are the result of interpreting) these attributes. ... so I infer that the value of the ref-id attribute does not, itself, have to point to an attribute, but instead could point to a child element of the object of interest, so long as it is unique. The cited page-number is the number of the page containing, as a descendant, the first normal area returned by the formatting object with an id trait matching the ref-id trait of the fo:page-number- citation (the referenced formatting object). See the definition of the 'ref-id' property itself (7.28.5): Values have the following meanings: idref The id of an object in the formatting object tree. Another one of those notorious ambiguities? I'd assume the Rec is referring to the id attribute here, but as a FO property (see 7.28.2 id). Nearly every FO has an id, either explicitly specified or generated as an initial value for the id property. As such, every area in the resulting area tree is guaranteed to have an id trait. This is the template in question: xsl:template match=file mode=toc fo:block text-align-last=justify fo:in-line value-of select=name / fo:leader leader-pattern=dots / fo:page-number-citation ref-id={name} / /fo:in-line /fo:block /xsl:template Not sure if I get this right, but to get the whole picture, I think we also need to see where exactly you are creating the nodes that are identified by that 'name', no? It seems more like an issue of that node not being found. If the property is interpreted along the lines of the definition in 7.28.5, then the error is most likely caused by there not being a node with id={name} elsewhere in the document... Cheers, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with table-of-contents:don't understand ref-id attribute
I'm back. Just when I thought it was safe to go back into the water (cue bass violin and muted trumpets); fop 0.20.5 is processing the XSL-FO document without complaint. I've still got some minor formatting issues to deal with, but I have one huge problem, no page numbers appear in the PDF file. Here is one of the relevant elements from the XSL-FO document's table of contents section: fo:block text-align-last=justify text-indent=-1em start-indent=1em fo:inline padding-start=1emTC_01fo:leader leader-pattern=dots/ fo:page-number-citation ref-id=TC_01/ /fo:inline /fo:block This is what the PDF looks like: Table of Contents TC_01.. TC_02.. etc. Can anyone tell me where my page numbers went? -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 13:36:07 -0500 To: fop-users@xmlgraphics.apache.org Subject: RE: RE: Re: Help with table-of-contents:don't understand ref-id attribute I found my errors. Naturally they weren't where I was looking, but I was distracted by my unfamiliarity with the table of contents piece. I had a missing element, a mis-spelled element name, and I omitted a namespace part of another element. Now the only problem I seem to have is that fop.bat won't terminate when it tells me it's ..., stopping renderer. Thanks. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 12:15:41 -0500 To: fop-users@xmlgraphics.apache.org Subject: RE: Re: Help with table-of-contents:don't understand ref-id attribute Here is a trimmed-down model of the XML. test-case-documents directory @name=dir-1 directory @name=dir-1-1 file nameTC_01/name .. More elements here .. /file /directory /directory test-case-documents This is the template in question: xsl:template match=file mode=toc fo:block text-align-last=justify fo:in-line value-of select=name / fo:leader leader-pattern=dots / fo:page-number-citation ref-id={name} / /fo:in-line /fo:block /xsl:template Here is where I invoke the template: xsl:template match=/ . XSLT goes here fo:page-sequence master-reference=matrix xsl:apply-templates select=test-case-documents/directory//file mode=toc / /fo:page-sequence . even more XSLT goes here /xsl:template When I apply-templates, the context node is a file, no? As you can see, name is a child of file and I assert the value of each name is unique throughout the document. Thanks for your interest. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Jay Bryant [EMAIL PROTECTED] Sent: Fri, 3 Mar 2006 10:58:21 -0600 To: fop-users@xmlgraphics.apache.org Subject: Re: Help with table-of-contents:don't understand ref-id attribute Hi, Charles, It is certainly true that the value of ref-id can be an element rather than an attribute. It doesn't even necessarily have to be a child of the element whose page number you want. I've bumped into XML that had ref values as top-level elements next to the heading elements. Of course, either an attribute or a child element makes for much nicer XSL. My first thought is that you have a context issue: The name node must be a child of the current context node. Unless you've used a for-each or some other structure to force the context to be the heading (or whatever) for which you are trying to get a page number, the processor can never find that node. I know you are a regular on the Mulberry XSLT list, though, so I bet you have already accounted for that possibility. Can you post some of your XML source and the relevent parts of your stylesheet or make a trimmed-down demonstration of the problem? If so, I'll be happy to try to help figure out the problem. Jay Bryant Bryant Communication Services - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Help with table-of-contents:don't understand ref-id attribute
As you can see from my trimmed-down data model. I have no id attribute. That issue is what I thought I was asking about when you replied: It is certainly true that the value of ref-id can be an element rather than an attribute. So it appears that I misunderstand the question of what has to be pointed to by the ref-id attribute. I'm thinking that I should add an id attribute using generate-id() during the XSLT transform, but I can't figure out which element it should be added to. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Jay Bryant [EMAIL PROTECTED] Sent: Fri, 3 Mar 2006 13:36:16 -0600 To: fop-users@xmlgraphics.apache.org Subject: Re: Help with table-of-contents:don't understand ref-id attribute Hi, Charles, For ref-id to work, there has to be a corresponding id attribute somewhere. So, some other template should be creating something like fo:block id=TC_01Content here/fo:block Of course, you're probably doing that (no way to know from what I've seen so far). I'd check to make sure that whatever template is supposed to do that is doing the right thing. To do that, examine the FO file and see what shows up. HTH Jay Bryant Bryant Communication Services - Original Message - From: [EMAIL PROTECTED] To: fop-users@xmlgraphics.apache.org Sent: Friday, March 03, 2006 1:06 PM Subject: Re: Help with table-of-contents:don't understand ref-id attribute I'm back. Just when I thought it was safe to go back into the water (cue bass violin and muted trumpets); fop 0.20.5 is processing the XSL-FO document without complaint. I've still got some minor formatting issues to deal with, but I have one huge problem, no page numbers appear in the PDF file. Here is one of the relevant elements from the XSL-FO document's table of contents section: fo:block text-align-last=justify text-indent=-1em start-indent=1em fo:inline padding-start=1emTC_01fo:leader leader-pattern=dots/ fo:page-number-citation ref-id=TC_01/ /fo:inline /fo:block This is what the PDF looks like: Table of Contents TC_01... .. TC_02... .. etc. Can anyone tell me where my page numbers went? -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 13:36:07 -0500 To: fop-users@xmlgraphics.apache.org Subject: RE: RE: Re: Help with table-of-contents:don't understand ref-id attribute I found my errors. Naturally they weren't where I was looking, but I was distracted by my unfamiliarity with the table of contents piece. I had a missing element, a mis-spelled element name, and I omitted a namespace part of another element. Now the only problem I seem to have is that fop.bat won't terminate when it tells me it's ..., stopping renderer. Thanks. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 12:15:41 -0500 To: fop-users@xmlgraphics.apache.org Subject: RE: Re: Help with table-of-contents:don't understand ref-id attribute Here is a trimmed-down model of the XML. test-case-documents directory @name=dir-1 directory @name=dir-1-1 file nameTC_01/name .. More elements here .. /file /directory /directory test-case-documents This is the template in question: xsl:template match=file mode=toc fo:block text-align-last=justify fo:in-line value-of select=name / fo:leader leader-pattern=dots / fo:page-number-citation ref-id={name} / /fo:in-line /fo:block /xsl:template Here is where I invoke the template: xsl:template match=/ . XSLT goes here fo:page-sequence master-reference=matrix xsl:apply-templates select=test-case-documents/directory//file mode=toc / /fo:page-sequence . even more XSLT goes here /xsl:template When I apply-templates, the context node is a file, no? As you can see, name is a child of file and I assert the value of each name is unique throughout the document. Thanks for your interest. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Jay Bryant [EMAIL PROTECTED] Sent: Fri, 3 Mar 2006 10:58:21 -0600 To: fop-users@xmlgraphics.apache.org Subject: Re: Help with table-of-contents:don't understand ref-id attribute Hi, Charles, It is certainly true that the value of ref-id can be an element rather than an attribute. It doesn't even necessarily have to be a child of the element whose page number you want. I've bumped into XML that had ref values as top-level elements next to the heading
Re: Help with table-of-contents:don't understand ref-id attribute
My bad, Charles. I was thinking of the input file rather than the FO when I responded to your initial question. Sorry about the confusion. I would add the id attribute to the block (or table or whatever) that contains the content of the source-document node you want to reference. So, if I had a source document like this: doc heading value=Some Heading paraP1/para paraP2/para /heading /doc I'd use a template like this: xsl:template match=heading fo:block id={generate-id()}xsl:value-of select=@value//fo:block /xsl:template Then the ToC template would be something like: xsl:template match=heading mode=toc fo:block text-align-last=justify xsl:value-of select=@value/fo:leader leader-pattern=dots/fo:page-number-citation ref-id={generate-id()}/ /fo:block /xsl:template (Of course, both blocks would have many more attributes to specify formatting, which is why I love attribute-sets.) HTH Jay Bryant Bryant Communication Services - Original Message - From: [EMAIL PROTECTED] To: fop-users@xmlgraphics.apache.org Sent: Friday, March 03, 2006 1:49 PM Subject: RE: Re: Help with table-of-contents:don't understand ref-id attribute As you can see from my trimmed-down data model. I have no id attribute. That issue is what I thought I was asking about when you replied: It is certainly true that the value of ref-id can be an element rather than an attribute. So it appears that I misunderstand the question of what has to be pointed to by the ref-id attribute. I'm thinking that I should add an id attribute using generate-id() during the XSLT transform, but I can't figure out which element it should be added to. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Jay Bryant [EMAIL PROTECTED] Sent: Fri, 3 Mar 2006 13:36:16 -0600 To: fop-users@xmlgraphics.apache.org Subject: Re: Help with table-of-contents:don't understand ref-id attribute Hi, Charles, For ref-id to work, there has to be a corresponding id attribute somewhere. So, some other template should be creating something like fo:block id=TC_01Content here/fo:block Of course, you're probably doing that (no way to know from what I've seen so far). I'd check to make sure that whatever template is supposed to do that is doing the right thing. To do that, examine the FO file and see what shows up. HTH Jay Bryant Bryant Communication Services - Original Message - From: [EMAIL PROTECTED] To: fop-users@xmlgraphics.apache.org Sent: Friday, March 03, 2006 1:06 PM Subject: Re: Help with table-of-contents:don't understand ref-id attribute I'm back. Just when I thought it was safe to go back into the water (cue bass violin and muted trumpets); fop 0.20.5 is processing the XSL-FO document without complaint. I've still got some minor formatting issues to deal with, but I have one huge problem, no page numbers appear in the PDF file. Here is one of the relevant elements from the XSL-FO document's table of contents section: fo:block text-align-last=justify text-indent=-1em start-indent=1em fo:inline padding-start=1emTC_01fo:leader leader-pattern=dots/ fo:page-number-citation ref-id=TC_01/ /fo:inline /fo:block This is what the PDF looks like: Table of Contents TC_01... .. TC_02... .. etc. Can anyone tell me where my page numbers went? -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 13:36:07 -0500 To: fop-users@xmlgraphics.apache.org Subject: RE: RE: Re: Help with table-of-contents:don't understand ref-id attribute I found my errors. Naturally they weren't where I was looking, but I was distracted by my unfamiliarity with the table of contents piece. I had a missing element, a mis-spelled element name, and I omitted a namespace part of another element. Now the only problem I seem to have is that fop.bat won't terminate when it tells me it's ..., stopping renderer. Thanks. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 12:15:41 -0500 To: fop-users@xmlgraphics.apache.org Subject: RE: Re: Help with table-of-contents:don't understand ref-id attribute Here is a trimmed-down model of the XML. test-case-documents directory @name=dir-1 directory @name=dir-1-1 file nameTC_01/name .. More elements here .. /file /directory /directory test-case-documents This is the template in question: xsl:template match=file mode=toc
RE: Re: Help with table-of-contents:don't understand ref-id attribute
All is forgiven! I got everything worked out. There were a lot more warts on that toad than I thought, but I've knocked out every one. Thanks again. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Jay Bryant [EMAIL PROTECTED] Sent: Fri, 3 Mar 2006 14:12:48 -0600 To: fop-users@xmlgraphics.apache.org Subject: Re: Help with table-of-contents:don't understand ref-id attribute My bad, Charles. I was thinking of the input file rather than the FO when I responded to your initial question. Sorry about the confusion. I would add the id attribute to the block (or table or whatever) that contains the content of the source-document node you want to reference. So, if I had a source document like this: doc heading value=Some Heading paraP1/para paraP2/para /heading /doc I'd use a template like this: xsl:template match=heading fo:block id={generate-id()}xsl:value-of select=@value//fo:block /xsl:template Then the ToC template would be something like: xsl:template match=heading mode=toc fo:block text-align-last=justify xsl:value-of select=@value/fo:leader leader-pattern=dots/fo:page-number-citation ref-id={generate-id()}/ /fo:block /xsl:template (Of course, both blocks would have many more attributes to specify formatting, which is why I love attribute-sets.) HTH Jay Bryant Bryant Communication Services - Original Message - From: [EMAIL PROTECTED] To: fop-users@xmlgraphics.apache.org Sent: Friday, March 03, 2006 1:49 PM Subject: RE: Re: Help with table-of-contents:don't understand ref-id attribute As you can see from my trimmed-down data model. I have no id attribute. That issue is what I thought I was asking about when you replied: It is certainly true that the value of ref-id can be an element rather than an attribute. So it appears that I misunderstand the question of what has to be pointed to by the ref-id attribute. I'm thinking that I should add an id attribute using generate-id() during the XSLT transform, but I can't figure out which element it should be added to. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Jay Bryant [EMAIL PROTECTED] Sent: Fri, 3 Mar 2006 13:36:16 -0600 To: fop-users@xmlgraphics.apache.org Subject: Re: Help with table-of-contents:don't understand ref-id attribute Hi, Charles, For ref-id to work, there has to be a corresponding id attribute somewhere. So, some other template should be creating something like fo:block id=TC_01Content here/fo:block Of course, you're probably doing that (no way to know from what I've seen so far). I'd check to make sure that whatever template is supposed to do that is doing the right thing. To do that, examine the FO file and see what shows up. HTH Jay Bryant Bryant Communication Services - Original Message - From: [EMAIL PROTECTED] To: fop-users@xmlgraphics.apache.org Sent: Friday, March 03, 2006 1:06 PM Subject: Re: Help with table-of-contents:don't understand ref-id attribute I'm back. Just when I thought it was safe to go back into the water (cue bass violin and muted trumpets); fop 0.20.5 is processing the XSL-FO document without complaint. I've still got some minor formatting issues to deal with, but I have one huge problem, no page numbers appear in the PDF file. Here is one of the relevant elements from the XSL-FO document's table of contents section: fo:block text-align-last=justify text-indent=-1em start-indent=1em fo:inline padding-start=1emTC_01fo:leader leader-pattern=dots/ fo:page-number-citation ref-id=TC_01/ /fo:inline /fo:block This is what the PDF looks like: Table of Contents TC_01... .. TC_02... .. etc. Can anyone tell me where my page numbers went? -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 13:36:07 -0500 To: fop-users@xmlgraphics.apache.org Subject: RE: RE: Re: Help with table-of-contents:don't understand ref-id attribute I found my errors. Naturally they weren't where I was looking, but I was distracted by my unfamiliarity with the table of contents piece. I had a missing element, a mis-spelled element name, and I omitted a namespace part of another element. Now the only problem I seem to have is that fop.bat won't terminate when it tells me it's ..., stopping renderer. Thanks. -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: [EMAIL PROTECTED] Sent: Fri, 03 Mar 2006 12:15:41 -0500 To: fop-users@xmlgraphics.apache.org