2013-05-09 56 views
1

我使用下面XSLT與運行頁腳生成的報告第一頁上不可見,但療法報表沒有正在運行的頁腳的第一頁,請指教需要改變運行頁腳

<?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:msxsl="urn:schemas-microsoft-com:xslt" 
       xmlns:user="urn:my-scripts"> 
    <xsl:template match="/" > 
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
     <!-- defines the layout master --> 
     <fo:layout-master-set > 
     <fo:simple-page-master master-name="first" 
     page-height="290mm" page-width="210mm" margin-top="0mm" margin-bottom="10mm" margin-left="20mm" margin-right="0mm"> 
      <fo:region-body margin-top="15mm" margin-bottom="15mm"/> 
      <fo:region-after extent="10mm" region-name="footer-normal"></fo:region-after> 
     </fo:simple-page-master> 
     </fo:layout-master-set> 
     <fo:page-sequence master-reference="first"> 
     <fo:static-content flow-name="footer-normal"> 
      <fo:block text-align="center" font-size="7pt" font-style="italic" font-family="sans-serif"> 

       <fo:retrieve-marker retrieve-class-name="chapter"/> 
       PAGE <fo:page-number/> of 
       <fo:page-number-citation ref-id="last-page"/> 

      </fo:block> 
     </fo:static-content> 
     <fo:flow flow-name="xsl-region-body"> 
      <xsl:for-each select="ArrayOfRoomReportBE/RoomReportBE" > 
      <xsl:variable name="RoomNo_node" select=".//RoomNumber"/> 
      <fo:marker marker-class-name="chapter" font-size="7pt" font-style="italic" 
          font-family="sans-serif"> 
       <xsl:value-of select="$RoomNo_node"/> 
      </fo:marker> 
      <!-- Dispaly datat --> 
      </xsl:for-each> 
      <fo:block id="last-page"/> 
     </fo:flow> 
     </fo:page-sequence> 
    </fo:root> 
    </xsl:template> 
</xsl:stylesheet> 
什麼

使用的輸入文件是如下

<ArrayOfRoomReportBE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <RoomReportBE> 
    <Id>0</Id> 
    <RoomNumber>TestCap1</RoomNumber> 
    <RoomName>TestCap1</RoomName> 
    <Comment>Testing a bit</Comment> 
    <GeneralAspect> 
     <GeneralAttributeTitle> 
     <ReferenceLink>Reference Link</ReferenceLink> 
     <Notes>General Notes</Notes> 
     <GeneralHeader>General</GeneralHeader> 
     <MaxCO2>Max CO2</MaxCO2> 
     <DimensionHeader>Dimension</DimensionHeader> 
     <NetAreaTitle>Net area</NetAreaTitle> 
     <ClimateHeader>Climate</ClimateHeader> 
     <MinTempTitle>Min Temperature</MinTempTitle> 
     <MaxTempTitle>Max Temperature </MaxTempTitle> 
     <OpenHoursTitle>Open hours</OpenHoursTitle> 
     <NonOpenHoursTitle>Non open hours</NonOpenHoursTitle> 
     <AcousticsHeader>Acoustics</AcousticsHeader> 
     <MaxInstallationNoiseTitle>Max installation noise</MaxInstallationNoiseTitle> 
     <SoundInsulationTitle>Sound insulation</SoundInsulationTitle> 
     <WorkplacesOccupancyHeader>Occupancy/Workplaces</WorkplacesOccupancyHeader> 
     <OccupancyTitle>Occupancy</OccupancyTitle> 
     <NoOfWorkspaceTitle>Number of workplaces</NoOfWorkspaceTitle> 
     <TypeOfWorkspaceTitle>Type of workplaces</TypeOfWorkspaceTitle> 
     </GeneralAttributeTitle> 
     <AspectAttributeItems> 
     <GeneralAttributeItemBE> 
      <GeneralNoOfWorkplaces /> 
      <GeneralDimensionNetArea>12</GeneralDimensionNetArea> 
      <GeneralClimateMinTempOpen>-19°C</GeneralClimateMinTempOpen> 
      <GeneralClimateMinTempNonOpen>-15°C</GeneralClimateMinTempNonOpen> 
      <GeneralClimateMaxTempOpen>-6°C</GeneralClimateMaxTempOpen> 
      <GeneralClimateMaxTempNonOpen>-11°C</GeneralClimateMaxTempNonOpen> 
      <Notes /> 
      <ReferenceLink /> 
     </GeneralAttributeItemBE> 
     </AspectAttributeItems> 
    </GeneralAspect> 
    <FloorAspect> 
     <FloorAttributeTitle> 
     <Description>Description</Description> 
     <ReferenceLink>Reference Link</ReferenceLink> 
     <Notes>General Notes</Notes> 
     <FloorFinishTitle>Floor Finish</FloorFinishTitle> 
     <FloorHeader>Floor</FloorHeader> 
     <FloorSubstractTitle>Floor Substrate</FloorSubstractTitle> 
     <FloorColorTitle>Floor Colour</FloorColorTitle> 
     <FloorSkirtingTitle>Skirting</FloorSkirtingTitle> 
     </FloorAttributeTitle> 
     <AspectAttributeItems> 
     <FloorAttributeItemBE> 
      <Description /> 
      <Notes /> 
      <ReferenceLink /> 
     </FloorAttributeItemBE> 
     <FloorAttributeItemBE> 
      <FloorSubstract>Block pavement</FloorSubstract> 
      <FloorColor>Medium grey</FloorColor> 
      <FloorSkirting>N/A</FloorSkirting> 
      <FloorFinish>Ceramic tiles textured</FloorFinish> 
      <Description>test</Description> 
      <Notes /> 
      <ReferenceLink /> 
     </FloorAttributeItemBE> 
     </AspectAttributeItems> 
    </FloorAspect> 
    <WallAspect> 
     <WallAttributeTitle> 
     <Description>Description</Description> 
     <ReferenceLink>Reference Link</ReferenceLink> 
     <Notes>General Notes</Notes> 
     <WallHeader>Wall</WallHeader> 
     <WallNameTitle>Wall</WallNameTitle> 
     <WallFinishTitle>Wall finish</WallFinishTitle> 
     <WallColorTitle>Wall Colour</WallColorTitle> 
     </WallAttributeTitle> 
     <AspectAttributeItems> 
     <WallAttributeItemBE> 
      <WallName>Facade</WallName> 
      <WallFinish>Special</WallFinish> 
      <WallColor>TestValue</WallColor> 
      <Description>test</Description> 
      <Notes /> 
      <ReferenceLink>test</ReferenceLink> 
     </WallAttributeItemBE> 
     </AspectAttributeItems> 
    </WallAspect> 
    <CeilingAspect> 
     <CeilingAttributeTitle> 
     <ReferenceLink>Reference Link</ReferenceLink> 
     <Notes>General Notes</Notes> 
     <AcousticsTitle>Acoustics</AcousticsTitle> 
     <CeilingInsertsTitle>Inserts</CeilingInsertsTitle> 
     <CeilingHeightTitle>Ceiling height</CeilingHeightTitle> 
     <CeilingHeader>Ceiling</CeilingHeader> 
     <CeilingSuspendedTitle>Suspended Ceiling</CeilingSuspendedTitle> 
     <CeilingRoomAcousticsTitle>Room acoustics</CeilingRoomAcousticsTitle> 
     <CeilingCoverageTitle>Coverage</CeilingCoverageTitle> 
     <CeilingTypeTitle>Type</CeilingTypeTitle> 
     <CeilingOthersTitle>Other</CeilingOthersTitle> 
     </CeilingAttributeTitle> 
     <AspectAttributeItems> 
     <CeilingAttributeItemBE> 
      <Notes /> 
      <ReferenceLink /> 
     </CeilingAttributeItemBE> 
     </AspectAttributeItems> 
    </CeilingAspect> 
    <EquipmentAspect> 
     <EquipmentAttributeTitle> 
     <ReferenceLink>Reference Link</ReferenceLink> 
     <Notes>General Notes</Notes> 
     <EquipmentHeader>Equipment</EquipmentHeader> 
     <EquipmentNameTitle>Equipment</EquipmentNameTitle> 
     <EquipmentQuantityTitle>Quantity</EquipmentQuantityTitle> 
     <EquipmentConnectionsTitle>Connections</EquipmentConnectionsTitle> 
     <Description>Description</Description> 
     </EquipmentAttributeTitle> 
     <AspectAttributeItems> 
     <EquipmentAttributeItemBE> 
      <EquipmentName>-</EquipmentName> 
      <EquipmentQuantity>100</EquipmentQuantity> 
      <EquipmentConnections>220V</EquipmentConnections> 
      <Description>test2</Description> 
      <Notes /> 
      <ReferenceLink /> 
     </EquipmentAttributeItemBE> 
     </AspectAttributeItems> 
    </EquipmentAspect> 
    </RoomReportBE> 
    <RoomReportBE> 
    </RoomReportBE> 
</ArrayOfRoomReportBE> 
+0

您能否提供您的輸入XML以檢查轉換 – siva2012 2013-05-09 13:24:06

+0

我已添加輸入文檔 – user2366265 2013-05-09 14:06:37

+0

問題已解決..在fo後加入農民:block user2366265 2013-05-16 09:07:16

回答

0

請改爲兩件事情:第一,<fo:region-after extent="10mm" region-name="footer-normal"><fo:region-after extent="10mm">。其次,將<fo:static-content flow-name="footer-normal">更改爲<fo:static-content flow-name="xsl-region-after">.

+0

嗨納文,我試過你的解決方案,但仍然第一頁不包含所需的運行頁腳,而其他頁面具有正確的運行頁腳。這是有點道理爲什麼只有第一頁沒有運行頁腳 – user2366265 2013-05-10 14:38:31

+0

你創建了任何其他頁面序列,而不是'第一'? – 2013-05-10 15:44:56