Re: Use only a limited number of items in an xsl:for-each

2008-08-18 Thread J.Pietschmann

Brian Trezise wrote:

I'm using the following to select a subset of items from my xml document to
be rendered to the pdf; however when I run fop on the xslt/xml, nothing is
rendered at all:

xsl:for-each
select=//*[local-name()='intellispec/aliases/alias'][position()lt; 3]
xsl:value-of select=./
/xsl:for-each


From what I can tell this is valid xslt code,


Well, 'intellispec/aliases/alias' is not a valid element name, which
means nothing will be selected.


is there another way I need to
write this to be compatible with FOP 0.95?


You have an XSLT question. This is best asked on the XSL list:
 http://www.mulberrytech.com/xsl/xsl-list/
In order to get help, you also need to describe what you want to
do.


If I
just do select=intellispec/aliases/alias in the above for-each all three
aliases print out as expected.


That's the way it should be done. Why do you think you need the much
more complicated (and brittle) form further above?

J.Pietschmann

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Use only a limited number of items in an xsl:for-each

2008-08-18 Thread Griffin,Sean
Brian,

select=intellispec/aliases/alias is different than 
select=//*[local-name()='intellispec/aliases/alias'], if not functionally, at 
least in the area of performance.  Just try 
select=intellispec/aliases/alias[position() lt; 3] and see if that works any 
better.

BTW, this has nothing to do with FOP and is completely up to the XSLT processor 
you're using.

-Sean

-Original Message-
From: Brian Trezise [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2008 3:41 PM
To: fop-users@xmlgraphics.apache.org
Subject: Use only a limited number of items in an xsl:for-each

I'm using the following to select a subset of items from my xml document to be 
rendered to the pdf; however when I run fop on the xslt/xml, nothing is 
rendered at all:

xsl:for-each
select=//*[local-name()='intellispec/aliases/alias'][position() lt; 3]
xsl:value-of select=./
/xsl:for-each

From what I can tell this is valid xslt code, is there another way I need to 
write this to be compatible with FOP 0.95?  Or does FOP not support this 
functionality and I need to limit the number of aliases elsewhere in my 
software?

sample xml code:

intellispec
aliases
aliasC0805C101J8GAC7800/alias
aliasIPUHPIOUSOPIHJPOIA/alias
aliasASIJPCNEPOIWJPOIYO/alias
/aliases
/intellispec

I've attached a sample pdf that is generated by my xslt; up top where it says 
aka two of the three aliases should follow on the same line.  If I just do 
select=intellispec/aliases/alias in the above for-each all three aliases 
print out as expected.


Thanks,
___
Brian Trezise
Staff Software Engineer
IntelliData, Inc
22288 E Princeton Dr
aurora, colorado 80018
T: 720.524.4864
[EMAIL PROTECTED]

--
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]