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 cf...@kcp.com on 2004/12/17 20:22:28 UTC

Xalan preceding-sibling problem

I am attempting to compare the values in one node with the preceding node.
When using the preceding-sibling on the first node, it retuns a null (which
is good), but thereafter returns the value of the first node (only) as the
tree is processed.  If I use the axisName following:: or
following-sibling:: then it works fine.  I should be able to reverse my
logic a bit and get it to work, but there has been a whole lot of testing
trying to figure this out.  The object of the test is to place a title row
for each group of nodes in a table.  Once I am returning the values I need
from the preceding-sibling:: then I can build the xsl:if statement.  Right
now it's set to 1=1 to iterate through the nodes.  I have reported this as
a bug to the Apache XML buglist, but not having the expertise of many of
the members, I'm unsure if it is a bug or maybe I'm expecting behavior that
I won't get, given the way in which I'm doing things here.  I would
apreciate it very much if someone could confirm this works with another
engine or explain why it won't work at all.  I have been through MK's XSLT
book working on a solution and by all rights this should work.  It's not
elegant, but hey, how do you eat an elephant?  One bite at a time :=)

XSLT Template
---------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xml.apache.org/fop/extensions"
xmlns:xalan="http://xml.apache.org/xslt">

<xsl:output method="xml" indent="yes" encoding="UTF-8"
omit-xml-declaration="yes"/>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xml.apache.org/fop/extensions">
<!--Start master-sets-->
<xsl:comment>Start master-sets</xsl:comment>
<fo:layout-master-set>
<fo:simple-page-master master-name="default-cover-master" page-width="11in"
page-height="8.5in">
<fo:region-body margin-top="0.50in" margin-bottom="0.50in"/>
<fo:region-before extent="0.50in" background-color="white"/>
<fo:region-after extent="0.40in" background-color="white"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="default-cover-master">
<fo:static-content flow-name="xsl-region-before">
<fo:block text-align="center" font-size="12pt" font-weight="bold"
color="black">
Region Before
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="center" font-size="12pt" font-weight="bold"
color="black">
Region After
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block text-align="center" font-size="12pt" font-weight="bold"
color="black">
Region Body
</fo:block>
</fo:flow>
</fo:page-sequence>

<!--Using for-each loop to get from sections    -->
<fo:page-sequence master-reference="default-cover-master">
<fo:static-content flow-name="xsl-region-before">
<fo:block>
Page Header inserted here
<!--<xsl:copy-of select="$PAGE-HEADER"/> -->
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block>
Page Footer Here <!-- <xsl:copy-of select="$PAGE-FOOTER"/>-->
</fo:block>

</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:table width="8in" border="solid 1px black" >
<xsl:comment> Count the number of repeated columns </xsl:comment>
<fo:table-column width="1in">
<xsl:attribute name="number-columns-repeated">3</xsl:attribute>
</fo:table-column>
<fo:table-body>
<xsl:for-each select="MUInventory/Category"> <!-- Outer Loop -->
<xsl:if test="1=1"><!--
self::node()[not(text()=preceding-sibling::node()/text())] This is the
latest test that was not working-->
<fo:table-row>
<fo:table-cell>
<fo:block><xsl:value-of select="concat(text(),' - ', ./Type)"/> and the
following-sibling is
<xsl:value-of select="preceding-sibling::node()/Model"/> </fo:block>
<!-- Just change the preceding-sibling to following-sibling and the output
will give you the proper value -->
</fo:table-cell>
</fo:table-row>
</xsl:if>
<fo:table-row>
<xsl:for-each select="Make"> <!-- Inner Loop -->
<fo:table-cell border="solid 1px black" width="1in">
<fo:block>
<xsl:value-of select="../Year/."/>
</fo:block>
</fo:table-cell>
<fo:table-cell border="solid 1px black" width="1in">
<fo:block>
<xsl:value-of select="."/>
</fo:block>
</fo:table-cell>
<fo:table-cell border="solid 1px black" width="1in">
<fo:block>
<xsl:value-of select="../Model/."/>
</fo:block>
</fo:table-cell>
</xsl:for-each>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
<!--  add the blank Page at end of report...-->
</fo:root>
</xsl:template>
</xsl:stylesheet>

----------------------------------------------------------------------------
XML File
-----------------------------------------------------------------------------
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by your name
here (Honeywell FM&T) -->
<MUInventory name="Major Units"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:\fop\fop-0.20.5\files\poi.xsd">
      <Category>Motorcycles
                  <Type>Cruisers</Type>
            <Make>Harley Davidson</Make>
            <Model>XL1200 Sportster</Model>
            <Year>2001</Year>
            <VIN_Number>9-30-2004-110395</VIN_Number>
            <MSRP>$8,399.00</MSRP>
            <Mileage>6800</Mileage>
            <Colors>Black</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/9-30-2004-110395.jpg"
larger="poiimages/larger/9-30-2004-110395.jpg">poiimages/thumb/9-30-2004-110395.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="Engine type: Air Cooled V2, 4
Stroke with 61.00 HP at 5500 RPM. Torque - Nm (kgf-m / ft.lbs): 88.00 (9.0
/ 64.9) at 4000.  Compression: 10.1:1. Bore x stroke: 88.8 x 96.8 mm (3.5 x
3.8 inches).  5 Speed transmission with Belt dive.  Eleltric start and
electronic ignition."/>
            <Engine eDisplacement="1199.00 cc (73.16 cubic inches)"/>
            <Stock_Number>118404</Stock_Number>
            <Receive_Date>8/17/2002</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="Want to Cruise on an American Original?  This
Sportster is in Excellent shape and priced right!"/>
      </Category>
      <Category>Motorcycles
                  <Type>Cruisers</Type>
            <Make>Harley Davidson</Make>
            <Model>883 Sportster</Model>
            <Year>2002</Year>
            <VIN_Number>10-30-2004-121552</VIN_Number>
            <MSRP>$5,499.00</MSRP>
            <Mileage>Low Miles</Mileage>
            <Colors>Red</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/10-30-2004-121552.jpg"
larger="poiimages/larger/10-30-2004-121552.jpg">poiimages/thumb/10-30-2004-121552.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="| Engine type: Air Cooled V2, 4
Stroke | 68.00 Nm (6.9 kgf-m or 50.2 ft.lbs) @ 4000 RPM |  Compression:
10.1:1. 76.2 x 96.8 mm (3.0 x 3.8 inches) | 5 Speed transmission with Belt
dive | Electric start and electronic ignition."/>
            <Engine eDisplacement="883.00 ccm (53.88 cubic inches)"/>
            <Stock_Number>118404</Stock_Number>
            <Receive_Date>8/17/2002</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories="Screaming Eagle Air Filter"/>
            <Other oNotes="Want to Cruise on an American Original?  This
Sportster is in Excellent shape and priced right!"/>
      </Category>
      <Category>Motorcycles
                  <Type>Cruisers</Type>
            <Make>Honda</Make>
            <Model>VT750 Shadow Spirit</Model>
            <Year>2003</Year>
            <VIN_Number>5132004-700707</VIN_Number>
            <MSRP>$5,199.00</MSRP>
            <Mileage>599</Mileage>
            <Colors>Purple/Grey</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/5132004-700707.jpg"
larger="poiimages/larger/5132004-700707.jpg">poiimages/thumb/5132004-700707.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="Four stroke V Twin 5 Speed. Liquid
cooled."/>
            <Engine eDisplacement="745.00 cc"/>
            <Stock_Number>700707</Stock_Number>
            <Receive_Date>3/14/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories="Windscreen, passenger backrest, Cobra
Floorboards, Engine Guards and custom paint job."/>
            <Other oNotes="Check this bike out, just begging to have a good
home, turn some heads with this one."/>
      </Category>
      <Category>Motorcycles
                  <Type>Cruisers</Type>
            <Make>Yamaha</Make>
            <Model>Royal Star Venture</Model>
            <Year>2000</Year>
            <VIN_Number>9-30-2004-063605</VIN_Number>
            <MSRP>$9,999.00</MSRP>
            <Mileage>26000</Mileage>
            <Colors>Raven (Royal Star Midnight Venture)</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/9-30-2004-063605.jpg"
larger="poiimages/larger/9-30-2004-063605.jpg">poiimages/thumb/9-30-2004-063605.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="79-cubic-inch; liquid-cooled;
DOHC; 70 degree  V-4"/>
            <Engine eDisplacement="1294cc"/>
            <Stock_Number>81957</Stock_Number>
            <Receive_Date>4/29/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="Fully Loaded!"/>
      </Category>
      <Category>Motorcycles
                  <Type>Cruisers</Type>
            <Make>Yamaha</Make>
            <Model>V Star 650 Custom</Model>
            <Year>2002</Year>
            <VIN_Number>10-30-2004-039173</VIN_Number>
            <MSRP>$4,499.00</MSRP>
            <Mileage>1841</Mileage>
            <Colors>Purple/Silver</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/10-30-2004-039173.jpg"
larger="poiimages/larger/10-30-2004-039173.jpg">poiimages/thumb/10-30-2004-039173.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="40-cubic-inch, air-cooled, SOHC,
70&#186; V-twin with 5 speeds"/>
            <Engine eDisplacement="649cc"/>
            <Stock_Number>100805</Stock_Number>
            <Receive_Date>3/14/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="This Single Owner middleweight cruiser has
reached new heights in performance, styling and value ever since its debut
&#151; and in the process, redefined what middleweight cruising is all
about. Motorcycle Cruiser crowned it both &#034;Cruiser of the Year&#034;
and &#034;Best Value&#034; the very first season it hit the streets,
hailing it as &#034; the bike that has raised the bar for middleweight
cruisers.&#034;  It has excellent rubber and well equipped.  Cruise through
fall with style!"/>
      </Category>
      <Category>Motorcycles
                  <Type>Cruisers</Type>
            <Make>Yamaha</Make>
            <Model>V Star 650 Silverado Classic</Model>
            <Year>2004</Year>
            <VIN_Number>9-5-2004-062657</VIN_Number>
            <MSRP>$6,499.00</MSRP>
            <Mileage>1473</Mileage>
            <Colors>Pearl White</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/9-5-2004-062657.jpg"
larger="poiimages/larger/9-5-2004-062657.jpg">poiimages/thumb/9-5-2004-062657.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="40-cubic-inch, air-cooled, SOHC,
70&#186; V-twin with 5 speeds"/>
            <Engine eDisplacement="649cc"/>
            <Stock_Number>32667</Stock_Number>
            <Receive_Date>4/29/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories="| Hard Bags | Custom Controls |
Floorboards"/>
            <Other oNotes="This Single Owner middleweight cruiser has
reached new heights in performance, styling and value ever since its debut
&#151; and in the process, redefined what middleweight cruising is all
about. Motorcycle Cruiser crowned it both &#034;Cruiser of the Year&#034;
and &#034;Best Value&#034; the very first season it hit the streets,
hailing it as &#034; the bike that has raised the bar for middleweight
cruisers.&#034;  It has excellent rubber and equiped with some quality
accessories!  Cruise into fall with style!"/>
      </Category>
      <Category>Motorcycles
                  <Type>Cruisers</Type>
            <Make>Yamaha</Make>
            <Model>V Star 650 Classic</Model>
            <Year>2004</Year>
            <VIN_Number>10-30-2004-061643</VIN_Number>
            <MSRP>$4,999.00</MSRP>
            <Mileage>461</Mileage>
            <Colors>Black</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/10-30-2004-061643.jpg"
larger="poiimages/larger/10-30-2004-061643.jpg">poiimages/thumb/10-30-2004-061643.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="40-cubic-inch, air-cooled, SOHC,
70&#186; V-twin with 5 speeds"/>
            <Engine eDisplacement="649cc"/>
            <Stock_Number>81957</Stock_Number>
            <Receive_Date>3/14/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="This Single Owner middleweight cruiser has
reached new heights in performance, styling and value ever since its debut
&#151; and in the process, redefined what middleweight cruising is all
about. Motorcycle Cruiser crowned it both &#034;Cruiser of the Year&#034;
and &#034;Best Value&#034; the very first season it hit the streets,
hailing it as &#034; the bike that has raised the bar for middleweight
cruisers.&#034;  It has excellent rubber and equiped with some quality
accessories!  Cruise into Fall with style!"/>
      </Category>
      <Category>Motorcycles
                        <Type>Cruisers</Type>
            <Make>Yamaha</Make>
            <Model>Royal Star Tour Deluxe</Model>
            <Year>2005</Year>
            <VIN_Number>9-30-2004-000462</VIN_Number>
            <MSRP>$12,999.00</MSRP>
            <Mileage>900</Mileage>
            <Colors>Charcoal Silver/Raven</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/9-30-2004-000462.jpg"
larger="poiimages/larger/9-30-2004-000462.jpg">poiimages/thumb/9-30-2004-000462.jpg</Image>
            <Warranty>5 Year (Limited Factory Warranty)</Warranty>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="79-cubic-inch, liquid-cooled,
DOHC, 70 degree V-4"/>
            <Engine eDisplacement="1294cc"/>
            <Stock_Number>700707</Stock_Number>
            <Receive_Date>4/29/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="Brand new bike at a reduced price!"/>
      </Category>
      <Category>Motorcycles
                  <Type>Off-Road</Type>
            <Make>Suzuki</Make>
            <Model>DR200</Model>
            <Year>2002</Year>
            <VIN_Number>8-21-04-0000002</VIN_Number>
            <MSRP>$3,349.00</MSRP>
            <Mileage>3324</Mileage>
            <Colors>Yellow</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/8-21-04-0000002.jpg"
larger="poiimages/larger/8-21-04-0000002.jpg">poiimages/thumb/8-21-04-0000002.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="Air cooled 4 Stroke"/>
            <Engine eDisplacement="198cc"/>
            <Stock_Number>32667</Stock_Number>
            <Receive_Date>4/29/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="There's good reason middleweight off-road bikes
are so popular. They offer abundant power combined with lightweight
handling - and the DR-200 sets the standard for the class. Grab a handful
of throttle and you'll be rewarded with hard-charging performance across
the powerband. And when the trail gets nasty, you can count on the DR-200's
long-travel suspension for a plush ride."/>
      </Category>
      <Category>Motorcycles
                  <Type>Scooters</Type>
            <Make>Aprilia</Make>
            <Model>Rally 50</Model>
            <Year>2003</Year>
            <VIN_Number>3172004-000265</VIN_Number>
            <MSRP>$1,499.00</MSRP>
            <Mileage>750</Mileage>
            <Colors>Purple</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/3172004-000265.jpg"
larger="poiimages/larger/3172004-000265.jpg">poiimages/thumb/3172004-000265.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="Four-stroke; single-cylinder 49cc
engine"/>
            <Engine eDisplacement="49cc"/>
            <Stock_Number>000265</Stock_Number>
            <Receive_Date>3/14/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="Great little scooter to Buzz around the campus
or down to the grocery store."/>
      </Category>
      <Category>Motorcycles
                  <Type>Scooters</Type>
            <Make>Aprilia</Make>
            <Model>SR 50</Model>
            <Year>2003</Year>
            <VIN_Number>7082004-002207</VIN_Number>
            <MSRP>$2,499.00</MSRP>
            <Mileage>545</Mileage>
            <Colors>Red</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/7082004-002207.jpg"
larger="poiimages/larger/7082004-002207.jpg">poiimages/thumb/7082004-002207.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="50cc scooter"/>
            <Engine eDisplacement="49cc"/>
            <Stock_Number>118404</Stock_Number>
            <Receive_Date>4/29/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="Take this sporty looking scooter for a ride and
have a blast."/>
      </Category>
      <Category>Motorcycles
                  <Type>Sport</Type>
            <Make>Suzuki</Make>
            <Model>Katana 600</Model>
            <Year>2004</Year>
            <VIN_Number>7152004-100805</VIN_Number>
            <MSRP>$4,999.00</MSRP>
            <Mileage>2800</Mileage>
            <Colors>Yellow</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/7152004-100805.jpg"
larger="poiimages/larger/7152004-100805.jpg">poiimages/thumb/7152004-100805.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="DOHC, 4-Cylinder,Liquid Cooled
600cc"/>
            <Engine eDisplacement="600cc"/>
            <Stock_Number>100805</Stock_Number>
            <Receive_Date>4/29/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="Very nice bike, clean 2004 model with low
mileage"/>
      </Category>
      <Category>ATV
                  <Type>Sport</Type>
            <Make>Yamaha</Make>
            <Model>Banshee</Model>
            <Year>2001</Year>
            <VIN_Number>9-30-2004-063606</VIN_Number>
            <MSRP>$3,499.00</MSRP>
            <Mileage>Low Hours</Mileage>
            <Colors>Black/Silver</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/9-30-2004-063606.jpg"
larger="poiimages/larger/9-30-2004-063606.jpg">poiimages/thumb/9-30-2004-063606.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="347cc; 2-Stroke Twin; Liquid
Cooled; Reed Valve"/>
            <Engine eDisplacement="347cc"/>
            <Stock_Number>000179</Stock_Number>
            <Receive_Date>4/29/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="This quad is just waiting to go the dunes.  This
powerful 2-stroke will leave you smiling for days."/>
      </Category>
      <Category>Motorcycles
                  <Type>Standard</Type>
            <Make>Suzuki</Make>
            <Model>SV650</Model>
            <Year>2004</Year>
            <VIN_Number>9-5-2004-102404</VIN_Number>
            <MSRP>$5,450.00</MSRP>
            <Mileage>1500</Mileage>
            <Colors>Blue</Colors>
            <Used_New_Flag>A</Used_New_Flag>
            <Image large="poiimages/large/9-5-2004-102404.jpg"
larger="poiimages/larger/9-5-2004-102404.jpg">poiimages/thumb/9-5-2004-102404.jpg</Image>
            <Warranty/>
            <Engine UseEngine="Y"/>
            <Engine eEngine_Description="| Compact 90 degree liquid-cooled
V-twin | DOHC 8-valve engine tuned for strong low to mid rpm power | 90
degree V-twin cylinder layout eliminates primary vibration without a
counterbalancer, keeping the engine simple and compact | Lightweight
chain-driven DOHC, shim-under-bucket valve system with 31 mm intake valves
and 25.5 mm exhaust valves | Electronic fuel injection system featuring the
Suzuki Dual Throttle Valve System (SDTV) - maintains optimum air velocity
in the intake tract for smooth low-to-mid rpm throttle response and high
torque output - includes Auto Fast Idle System (AFIS) | High capacity
liquid-cooling system enhances engine performance and durability - coolant
routing is integrated with the clutch cover and engine case for a cleaner
look and reduced weight | Smooth-shifting 6-speed transmission with
vertically staggered transmission shafts for a shorter, more compact
crankcase"/>
            <Engine eDisplacement="645cc"/>
            <Stock_Number>100805</Stock_Number>
            <Receive_Date>4/29/2003</Receive_Date>
            <Deployment_Date/>
            <Retirement_Date>12-01-2004</Retirement_Date>
            <Special/>
            <Other UseOther="Y"/>
            <Other oSpares=""/>
            <Other oAccessories=""/>
            <Other oNotes="After winning Motorcyclist magazines &#034;Best
Bang for the Buck&#034; award in 2003, the SV650S is back and better than
ever for 04. Powering the SV650S is a reliable 90-degree 645cc V-twin tuned
for crisp throttle response and class-leading horsepower and torque.
Housing the potent 645cc engine is an aluminum-alloy truss-style frame
designed for maximum strength and minimum weight. The SV650S is decked out
in aggressively styled bodywork with a slick new half-fairing, housing dual
multi-reflector headlights flanked by small running lights."/>
      </Category>
</MUInventory>




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Image Problem in FOP url(...)

Posted by Chris Bowditch <bo...@hotmail.com>.
cfisher@kcp.com wrote:
> I am trying to resolve my images dynamically.  When I perform the
> following:
> <fo:block>
>   <xsl:variable name="pic" select="../Image[@larger]"/>
>   <fo:external-graphic src="url(&quot;$pic&quot;)" content-height="201in"
> scaling="uniform"></fo:external-graphic>
>   Image=  <xsl:value-of select="$pic"/>
> </fo:block>

Variables inside an attribute are not resolved by default, in xsl terms you 
have to use an attribute template: this means just put {} around the variable, 
e.g.

<fo:external-graphic src="url('{$pic}')"/>

I have just used single quotes instead of trying to use $quot; entity as its 
easier. Note that content-height doesnt have any effect in FOP 0.20.5.

<snip/>

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: --- Potential SPAM ---: Re: Image Problem in FOP url(...)

Posted by cf...@kcp.com.
Thanks J., newbie mistake...  I get frustrated with the differences between
declaritive and procedural languages and I vent a little too much.  Having
been away from XSLT for a time, then coming back to it, there are new
topics to learn every day.  I thank you all for providing myself and the
larger community with your expertise and advice.

Curtis



                                                                           
             "J.Pietschmann"                                               
             <j3322ptm@yahoo.d                                             
             e>                                                         To 
                                       fop-user@xml.apache.org             
             12/21/2004 04:27                                           cc 
             PM                                                            
                                                                   Subject 
                                       --- Potential SPAM ---: Re: Image   
             Please respond to         Problem in FOP url(...)             
             fop-user@xml.apac                                             
                  he.org                                                   
                                                                           
                                                                           
                                                                           
                                                                           




cfisher@kcp.com wrote:
> I am trying to resolve my images dynamically.
...
>   <fo:external-graphic src="url(&quot;$pic&quot;)" content-height="201in"
> scaling="uniform"></fo:external-graphic>
>   Image=  <xsl:value-of select="$pic"/>
...
> I get this from Xalan:
...
> <fo:external-graphic scaling="uniform" content-height="201in" src="
> url(&quot;$pic&quot;)"/>
...
> I know this is a Xalan issue ...
 > I have searched high and low in the Xalan
 > and FOP Apache bug lists,

Wrong place to look, Xalan works as designed here. It is more an
issue about your understanding how XSLT works.
The  src="url(&quot;$pic&quot;)" is copied through to the output
literally, exactly as the spec says. XSLT is not a macro language
where everything prefixed with a $ is substituted or somesuch.
If you want to have $pic evaluated in other places than select
and test attributes of certain XSLT elements, you have to say so
explicitely. In your case, the magic is named "attribute value template"
or short AVT (google it), and it means that parts of attribute values
which are enclosed in braces are evaluated as XPath expressions.
More specifically, use
  <fo:external-graphic src="url(&quot;{$pic}&quot;)" ...
                                      ^    ^
Check your favorite XSLT book or online tutorial for details.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Image Problem in FOP url(...)

Posted by "J.Pietschmann" <j3...@yahoo.de>.
cfisher@kcp.com wrote:
> I am trying to resolve my images dynamically.
...
>   <fo:external-graphic src="url(&quot;$pic&quot;)" content-height="201in"
> scaling="uniform"></fo:external-graphic>
>   Image=  <xsl:value-of select="$pic"/>
...
> I get this from Xalan:
...
> <fo:external-graphic scaling="uniform" content-height="201in" src="
> url(&quot;$pic&quot;)"/>
...
> I know this is a Xalan issue ...
 > I have searched high and low in the Xalan
 > and FOP Apache bug lists,

Wrong place to look, Xalan works as designed here. It is more an
issue about your understanding how XSLT works.
The  src="url(&quot;$pic&quot;)" is copied through to the output
literally, exactly as the spec says. XSLT is not a macro language
where everything prefixed with a $ is substituted or somesuch.
If you want to have $pic evaluated in other places than select
and test attributes of certain XSLT elements, you have to say so
explicitely. In your case, the magic is named "attribute value template"
or short AVT (google it), and it means that parts of attribute values
which are enclosed in braces are evaluated as XPath expressions.
More specifically, use
  <fo:external-graphic src="url(&quot;{$pic}&quot;)" ...
                                      ^    ^
Check your favorite XSLT book or online tutorial for details.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Image Problem in FOP url(...)

Posted by cf...@kcp.com.
I am trying to resolve my images dynamically.  When I perform the
following:
<fo:block>
  <xsl:variable name="pic" select="../Image[@larger]"/>
  <fo:external-graphic src="url(&quot;$pic&quot;)" content-height="201in"
scaling="uniform"></fo:external-graphic>
  Image=  <xsl:value-of select="$pic"/>
</fo:block>

I get this from Xalan:

<fo:block>
<fo:external-graphic scaling="uniform" content-height="201in" src="
url(&quot;$pic&quot;)"/>
Image= poiimages/thumb/9-30-2004-110395.jpg</fo:block>
</fo:table-cell>

As you can guess, url(&quot;$pic&quot;) is not correct.

I know this is a Xalan issue, but graphics rendered in HTML are added as
src attributes and they work fine.  This does not.  As you can see, the
$pic variable is working as it produces the proper path and image name from
the XML file. All the examples I find for graphics are with the image hard
coded into the url.  Please...   Can someone supply me with a clue as to
what I can do to make this work?  I have searched high and low in the Xalan
and FOP Apache bug lists, and there are no examples that point out this
behavior.  It seems as though the entire world is stuck with hard coded
images and they like it like that!  arrrgh!

Thanks, and a Merry Christmas and Happy Hanukah to everyone!

Curtis Fisher



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Xalan preceding-sibling problem

Posted by "J.Pietschmann" <j3...@yahoo.de>.
cfisher@kcp.com wrote:
> I am attempting to compare the values in one node with the preceding node.
...
> self::node()[not(text()=preceding-sibling::node()/text())] 
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This expression will be true if at least one text node child of the
context node is equal to at least one text node child of any of the
preceding siblings of the context node.
If you want to compare to the immediatly preceding sibling only, use
  text()=preceding-sibling::node()[1]/text()
instead.
Also this may or may not do what you want if the nodes in question
have multiple text node children (may happen if they have mixed
content). You'll probably want to use the folllowing form, which
compares the string values of the nodes instead of the text node
children:
  .=preceding-sibling::node()[1]

Node comparision in XSLT are tricky until you get a grasp on working
with sets (somewhat similar to SQL).

Note further that this is a pure XSLT question, which would have better 
been asked on the XSLT 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: Xalan preceding-sibling problem

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Andreas L. Delmelle wrote:
> Not completely sure, but the problem might be that:
> 
> preceding-sibling::node()
> 
> returns the first node on the preceding-sibling axis,...

It returns a node set.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: Xalan preceding-sibling problem

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: cfisher@kcp.com [mailto:cfisher@kcp.com]
>

Hi,

Just for the sake of completeness:

>   <xsl:variable name="lastCat"><xsl:value-of select="
> normalize-space(preceding-sibling::node()[2]/id)"/></xsl:variable>
>   <xsl:variable name="lastType"><xsl:value-of select="
> normalize-space(preceding-sibling::node()[2]/Type)"/></xsl:variable>

It's a tiny bit more efficient to initialize xsl:variables using select,
like:

<xsl:variable name="lastCat" select="normalize-space(...)" />

as mentioned in Xalan's FAQ:
http://xml.apache.org/xalan-j/faq.html#faq-N10148


Good Luck!

Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: Xalan preceding-sibling problem

Posted by cf...@kcp.com.
Hello good people,

Thank you Andreas, J.Pietschmann, and Riz for helping me out.  Your
suggestions got me started on the right track.  For your edification, here
is what I came up with that works:

<xsl:for-each select="MUInventory/Category"> <!-- Outer Loop -->
  <xsl:variable name="lastCat"><xsl:value-of select="
normalize-space(preceding-sibling::node()[2]/id)"/></xsl:variable>
  <xsl:variable name="lastType"><xsl:value-of select="
normalize-space(preceding-sibling::node()[2]/Type)"/></xsl:variable>
     <xsl:if test="concat(id,Type) != concat($lastCat,$lastType)">
       <fo:table-row span="all">
          <fo:table-cell width="3in">
            <fo:block>
               <xsl:value-of select="concat(./id,' - ', ./Type)"/>  <!--
last = <xsl:value-of select="$lastCat"/>  -  <xsl:value-of
select="$lastType"/>
                 Current NODE: <xsl:value-of select="./node"/> and
Preceding NODE: <xsl:value-of select="preceding-sibling::node()[2]/node"/>
-->
            </fo:block>
          </fo:table-cell>
       </fo:table-row>
     </xsl:if>

     ...next

First, I got rid of the text nodes just to minimize ambiguous behaviors.
Then I went about testing your suggestions and found that when using
<xsl:if test="self::node()[not(id=preceding-sibling::node()[2]/id)] and
self::node()[not(Type=preceding-sibling::node()[2]/Type)]"> instead of <
xsl:if test="concat(id,Type) != concat($lastCat,$lastType)">, it would
evaluate true for the first node and the last node and give me a header for
Motorcycles - Cruisers   and   Motorcycles - Standard, leaving out the
others.  I had to use [2] instead of [1] in the path to get the correct
node.  I have no solid reason as to why, but maybe it's the manner in which
the nodes are being numbered internally on the object stack.  As you can
see, I had troubleshooting code in the output.  If I used the expressions
self::node()[not(id=preceding-sibling::node()[2]/id)] and
self::node()[not(Type=preceding-sibling::node()[2]/Type)] on separate
<xsl:if...> statements, it still would exibit the same same wrong behavior
as witnessed when chaining them together with boolean logic.  So much for
elegance, I concatenated and made a direct comparism and viola`, it now
gives me the table below:

My XML file will always be in category order, so there is no sorting or
other problem areas to anticipate.

Motorcycles - Cruisers
2001 Harley Davidson XL1200 Sportster
2002 Harley Davidson 883 Sportster
2003 Honda VT750 Shadow Spirit
2000 Yamaha Royal Star Venture
2002 Yamaha V Star 650 Custom
2004 Yamaha V Star 650 Silverado Classic
2004 Yamaha V Star 650 Classic
2005 Yamaha Royal Star Tour Deluxe
Motorcycles - Off-Road
2002 Suzuki DR200
Motorcycles - Scooters
2003 Aprilia Rally 50
2003 Aprilia SR 50
Motorcycles - Sport
2004 Suzuki Katana 600
ATV - Sport
2001 Yamaha Banshee
Motorcycles - Standard
2004 Suzuki SV650


Thanks again!

Curtis Fisher






> -----Original Message-----
> From: cfisher@kcp.com [mailto:cfisher@kcp.com]

Hi,

> I am attempting to compare the values in one node with the preceding
node.
> When using the preceding-sibling on the first node, it retuns a
> null (which is good), but thereafter returns the value of the first
> node (only) as the tree is processed.

Not completely sure, but the problem might be that:

preceding-sibling::node()

returns the first node on the preceding-sibling axis, but 'first' here
being
'in document order'... (as in: take the set of all preceding-siblings and
of
that set, return the one that appears first in the source document)

> If I use the axisName following:: or following-sibling:: then it works
fine.

Yes, because here the immediately following (sibling) node is always also
first one following in the document as well.

Try:

self::node()[not(text()=preceding-sibling::node()[1]/text())]

IIC, the addition of '[1]' should make sure you return the immediately
preceding-sibling.

HTH!

Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: Xalan preceding-sibling problem

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: cfisher@kcp.com [mailto:cfisher@kcp.com]

Hi,

> I am attempting to compare the values in one node with the preceding node.
> When using the preceding-sibling on the first node, it retuns a
> null (which is good), but thereafter returns the value of the first
> node (only) as the tree is processed.

Not completely sure, but the problem might be that:

preceding-sibling::node()

returns the first node on the preceding-sibling axis, but 'first' here being
'in document order'... (as in: take the set of all preceding-siblings and of
that set, return the one that appears first in the source document)

> If I use the axisName following:: or following-sibling:: then it works
fine.

Yes, because here the immediately following (sibling) node is always also
first one following in the document as well.

Try:

self::node()[not(text()=preceding-sibling::node()[1]/text())]

IIC, the addition of '[1]' should make sure you return the immediately
preceding-sibling.

HTH!

Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org