You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Varadharajan Sethuraman <va...@yahoo.com> on 2004/07/10 11:35:01 UTC
Bulleted List
Hi,
I have one xml file like following
<document>
<object type="nbullet">List1</object>
<object type="nbullet">List2</object>
<object type="nbullet">List3</object>
<object type="sbullet">List4</object>
<object type="sbullet">List5</object>
<object type="sbullet">List6</object>
<object type="nbullet">List7</object>
<object type="nbullet">List8</object>
</document>
what i want is, the output(pdf) should be
List1
List2
List3
List4
List5
List6
List7
List8
means .... if the type consecutive attributes of object is same then preparing one list(nbullet the number bullet other symbols)
if you have any logic to implement this ....pls let me know ...
Regards
Varadharajan S
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
Re: Bulleted List
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Varadharajan Sethuraman wrote:
> Hi,
>
> I have one xml file like following
> <document>
> <object type="nbullet">List1</object>
> <object type="nbullet">List2</object>
> <object type="nbullet">List3</object>
> <object type="sbullet">List4</object>
> <object type="sbullet">List5</object>
> <object type="sbullet">List6</object>
> <object type="nbullet">List7</object>
> <object type="nbullet">List8</object>
> </document>
>
> what i want is, the output(pdf) should be
>
>
> 1. List1
> 2. List2
> 3. List3
>
> * List4
> * List5
> * List6
>
> 1. List7
> 2. List8
>
> means .... if the type consecutive attributes of object is same then
> preparing one list(nbullet the number bullet other symbols)
>
> if you have any logic to implement this ....pls let me know ...
I suppose you are looking for hints on implementing this in
XSLT. You can try certain grouping techniques as described in
the XSL FAQ and on http://jenitennison.com, roughly
<xsl:template match="document">
<fo:list-block ...>
<xsl:apply-templates
select="(nbullet|sbullet)[not(preceding-sibling::*)
or not(name(preceding-sibling::*[1])=name())]"/>
</fo:list-block>
</xsl:template>
<xsl:template match="nbullet">
<xsl:variable name="this" value="generate-id()"/>
<xsl:for-each select="following-sibling::nbullet[
not(preceding-sibling(sbullet) or
generate-id(preceding-sibling::sbullet/
following-sibling::nbullet[1])=$this)]">
<fo:list-item>
<fo:list-item-label ... ><xsl:value-of select="position()"
/></fo:list-item-label>
<fo:list-item-body ...>...</fo:list-item-body>
</fo:list-item>
</xsl:for-each>
</xsl:template>
Add a similar template for sbullets. If you need display space between
the lists, add them conditionally in the appropriate templates.
Of course it would be much simpler if your XML was already properly
marked up, like
<document>
<list>
<object type="nbullet">List1</object>
<object type="nbullet">List2</object>
<object type="nbullet">List3</object>
</list>
<list>
<object type="sbullet">List4</object>
<object type="sbullet">List5</object>
...
If you can change the XML, go this way first.
Please also note that XSLT questions are best asked on the XSL list
http://www.mulberrytech.com/xsl/xsl-list/
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Bulleted List
Posted by Clay Leeds <cl...@medata.com>.
Here's a good start (watch word wrap!):
http://www.w3.org/TR/xsl/slice6.html#section-N17076-Formatting-Objects-
for-Lists
I might also recommend checking out this page:
http://xml.apache.org/fop/resources.html
It has a bunch of online resources that will be useful to you. In
particular, the books on XSL-FO are especially helpful!
Web Maestro Clay
On Jul 10, 2004, at 2:35 AM, Varadharajan Sethuraman wrote:
> Hi,
>
> I have one xml file like following
> <document>
> <object type="nbullet">List1</object>
> <object type="nbullet">List2</object>
> <object type="nbullet">List3</object>
> <object type="sbullet">List4</object>
> <object type="sbullet">List5</object>
> <object type="sbullet">List6</object>
> <object type="nbullet">List7</object>
> <object type="nbullet">List8</object>
> </document>
>
> what i want is, the output(pdf) should be
>
> 1. List1
> 2. List2
> 3. List3
> • List4
> • List5
> • List6
> 1. List7
> 2. List8
>
> means .... if the type consecutive attributes of object is same then
> preparing one list(nbullet the number bullet other symbols)
>
> if you have any logic to implement this ....pls let me know ...
>
> Regards
>
> Varadharajan S
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org