Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    May 2006
    Location
    Ann Arbor, MI
    Posts
    5
    Member #
    13209
    Howdy guys,
    I have several XML sheets with approximetely two or three hundred names, e-mail adresses, etc in each one like so:
    Code:
    <peopleset>
        <department>DEPT NAME</department>
        <person>
            <id>0123456789</id>
            <lastname>SMITH</lastname>
            <firstname>JOHN</firstname>
            <sortname>SMITH, JOHN</sortname>
            <officenumber>123</officenumber>
            <phone>(123)456-7890</phone>
            <email>SMITHJ@abc.com</email>
        </person>
        <person>
            .
            .
            .
    </peopleset>
    My boss has given me a test assignment of making name tags or business cards from this data. I am using XSL:FO to transform the data into a pdfs so users can do it as the faculty list is updated. There are 6 cards on 1 sheet, top/bottom margin 1", left/right margins of 1/4". There are 2 columns and 3 rows of cards on a sheet that is 8.5"x11". Hence, each card is 4"x3". I'm trying to do this using tables, but can't get it so it works as follows (dashes are spaces):
    _____________________________
    |--------PERSON A|------PERSON B |
    |______________|______________|
    |-------PERSON C |------PERSON D |
    |______________|______________|
    etc

    All I can do is either:
    _____________________________
    |-------PERSON A |------PERSON A |
    |______________|______________|
    |-------PERSON B |------PERSON B |
    |______________|______________|
    using the same data for both cells

    or
    _____________________________
    |-------------------|PERSON A------|
    |______________|______________|
    |PERSON B------ |------------------|
    |______________|______________|
    using if statements and modulus 2 on the id (useless)

    Here is my current XSL:FO:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="/">
            <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
                <fo:layout-master-set>
                    <fo:simple-page-master margin-bottom="1in" margin-left="0.25in"
                        margin-right="0.25in" margin-top="1in" master-name="Avery 5384"
                        page-height="11in" page-width="8.5in">
                        <fo:region-body margin-bottom="0" margin-left="0" margin-right="0"
                            margin-top="0"/>
                    </fo:simple-page-master>
                </fo:layout-master-set>
                <fo:page-sequence initial-page-number="1" master-reference="Avery 5384">
                    <fo:flow flow-name="xsl-region-body">
                        <xsl:apply-templates select="peopleset"/>
                    </fo:flow>
                </fo:page-sequence>
            </fo:root>
        </xsl:template>
        <xsl:template match="peopleset">
            <fo:table border="0.5pt solid black" text-align="center">
                <fo:table-column column-width="4in"/>
                <fo:table-column column-width="4in"/>
                <fo:table-body>
                    <xsl:apply-templates select="person"/>
                </fo:table-body>
            </fo:table>
        </xsl:template>
        <xsl:template match="//person">
            <fo:table-row height="3in">
                <fo:table-cell border="0.5pt solid black" vertical-align="middle">
                    <fo:block display-align="center" font-family="sans-serif" font-size="12pt"
                        padding="10px" text-align="center" vertical-align="middle">
                        <xsl:value-of select="sortname"/>
                        <fo:block/>
                        <xsl:value-of select="email"/>
                    </fo:block>
                </fo:table-cell>
                <fo:table-cell border="0.5pt solid black" vertical-align="middle">
                    <fo:block display-align="center" font-family="sans-serif" font-size="12pt"
                        padding="10px" text-align="center" vertical-align="middle">
                        <xsl:value-of select="sortname"/>
                        <fo:block/>
                        <xsl:value-of select="email"/>
                    </fo:block>
                </fo:table-cell>
            </fo:table-row>
        </xsl:template>
    </xsl:stylesheet>
    Sorry for the long post...
    Please help!

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

create your business cards using xsl-fo

,

xslfo cards

Click on a term to search for related topics.
All times are GMT -6. The time now is 09:25 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com