RE: Implementing Change bars

2013-06-20 Thread drevivo

here is a simplified fully functioning xml and xsl.
ThanksDavid

xml
data
   p rev=1text with revbar/p
   note
  ptext in a note No revbar/p
  p rev=1text in a note with revbar/p
   /note
/data

xsl
xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; 
xmlns:r=http://nwalsh.com/xmlns/extreme2006/recipes/; 
xmlns=http://www.w3.org/1999/xhtml; 
xmlns:fn=http://www.w3.org/2005/xpath-functions;   
xmlns:fo=http://www.w3.org/1999/XSL/Format;
version=1.0

xsl:template match=data
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

fo:layout-master-set
  fo:simple-page-master master-name=A4
xsl:attribute name=margin10mm 13.5mm 10mm 25mm/xsl:attribute
xsl:attribute name=page-width215.9mm/xsl:attribute
xsl:attribute name=page-height279.4mm/xsl:attribute
xsl:attribute name=font-familyHelvetica/xsl:attribute
fo:region-body region-name=xsl-region-body
xsl:attribute name=margin21mm 0mm 9.5mm 0mm/xsl:attribute
/fo:region-body

  /fo:simple-page-master
/fo:layout-master-set

fo:page-sequence master-reference=A4
  fo:flow flow-name=xsl-region-body

xsl:apply-templates /
  /fo:flow
/fo:page-sequence

/fo:root
/xsl:template



xsl:template match=p
fo:block
xsl:call-template name=rev.bar /

xsl:attribute name=margin-top5px/xsl:attribute
xsl:attribute name=margin-bottom5px/xsl:attribute 

xsl:apply-templates / 
/fo:block
/xsl:template

xsl:template match=note

fo:block
xsl:attribute name=text-aligncenter/xsl:attribute
xsl:attribute name=font-size10pt/xsl:attribute   
xsl:attribute name=font-weightbold/xsl:attribute
xsl:attribute name=margin2mm 37mm 0mm 37mm/xsl:attribute

xsl:apply-templates / 

/fo:block

/xsl:template

xsl:template name=rev.bar
xsl:if test=@rev='1'
xsl:attribute name=border-start-colorblack/xsl:attribute
xsl:attribute name=border-start-stylesolid/xsl:attribute
xsl:attribute name=padding-start13pt/xsl:attribute
xsl:attribute name=border-start-width2pt/xsl:attribute
 /xsl:if
/xsl:template
/xsl:stylesheet
  

RevBarSample.zip (12K) 
http://apache-fop.1065347.n5.nabble.com/attachment/38756/0/RevBarSample.zip




--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/Implementing-Change-bars-tp16058p38756.html
Sent from the FOP - Users mailing list archive at Nabble.com.

RE: Implementing Change bars

2013-06-20 Thread Bonekrusher
See below. The key is how you set up your page layout.

data
p rev=1text with revbar/p
note
ptext in a note No revbar/p
p rev=1text in a note with revbar/p
/note
pno rev bar/p
/data

xslt:

xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:r=http://nwalsh.com/xmlns/extreme2006/recipes/;
xmlns=http://www.w3.org/1999/xhtml;
xmlns:fn=http://www.w3.org/2005/xpath-functions;
xmlns:fo=http://www.w3.org/1999/XSL/Format; version=1.0
xsl:template match=data
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
fo:simple-page-master master-name=A4 
page-height=11in
page-width=8.5in margin-top=0.5in margin-left=0.5in
margin-right=1.0in
fo:region-body 
region-name=xsl-region-body margin-top=.6in
margin-bottom=1in overflow=auto/
fo:region-before 
region-name=xsl-region-before extent=1in/
fo:region-after 
region-name=xsl-region-after-last-even
extent=0.75in/
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=A4
fo:flow flow-name=xsl-region-body
xsl:apply-templates/
/fo:flow
/fo:page-sequence
/fo:root
/xsl:template
xsl:template match=p
fo:block
xsl:call-template name=rev.bar/
xsl:attribute name=margin-top5px/xsl:attribute
xsl:attribute name=margin-bottom5px/xsl:attribute
xsl:apply-templates/
/fo:block
/xsl:template
xsl:template match=note
fo:block
xsl:attribute name=text-aligncenter/xsl:attribute
xsl:attribute name=font-size10pt/xsl:attribute
xsl:attribute name=font-weightbold/xsl:attribute

xsl:apply-templates/
/fo:block
/xsl:template
xsl:template name=rev.bar
xsl:if test=@rev
xsl:attribute 
name=border-start-colorblack/xsl:attribute
xsl:attribute 
name=border-start-stylesolid/xsl:attribute
xsl:attribute name=padding-start13pt/xsl:attribute
xsl:attribute 
name=border-start-width2pt/xsl:attribute
/xsl:if
/xsl:template
/xsl:stylesheet




--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/Implementing-Change-bars-tp16058p38762.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Implementing Change bars

2013-06-20 Thread drevivo

Hi, your sample works because you removed the left and right margin from the 
note fo:block. I need this margin. 
The layout for a note and many other elements need to be indented.
any suggestions?
David 



--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/Implementing-Change-bars-tp16058p38763.html
Sent from the FOP - Users mailing list archive at Nabble.com.

RE: Implementing Change bars

2013-06-20 Thread Bonekrusher
Dont use margins, use start-indent or end-indent on the fo:block instead of
margin.



--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/Implementing-Change-bars-tp16058p38770.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Implementing Change bars

2013-06-20 Thread drevivo
using start-indent or end-indent on the fo:block  has the same result as using 
margin
using padding does not work either the padding-left / padding-right has no 
effect on the text


Thanks,David  



--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/Implementing-Change-bars-tp16058p38771.html
Sent from the FOP - Users mailing list archive at Nabble.com.

RE: Implementing Change bars

2013-06-20 Thread Bonekrusher
try this...

xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:r=http://nwalsh.com/xmlns/extreme2006/recipes/;
xmlns=http://www.w3.org/1999/xhtml;
xmlns:fn=http://www.w3.org/2005/xpath-functions;
xmlns:fo=http://www.w3.org/1999/XSL/Format; version=1.0
xsl:template match=data
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
fo:simple-page-master master-name=A4 
page-height=11in
page-width=8.5in margin-top=0.5in margin-left=0.5in
margin-right=1.0in
fo:region-body 
region-name=xsl-region-body margin-top=.6in
margin-bottom=1in overflow=auto/
fo:region-before 
region-name=xsl-region-before extent=1in/
fo:region-after 
region-name=xsl-region-after-last-even
extent=0.75in/
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=A4
fo:flow flow-name=xsl-region-body
xsl:apply-templates/
/fo:flow
/fo:page-sequence
/fo:root
/xsl:template
xsl:template match=p
fo:block
xsl:call-template name=rev.bar/
xsl:attribute name=margin-top5px/xsl:attribute
xsl:attribute name=margin-bottom5px/xsl:attribute
xsl:choose
xsl:when test=parent::note
fo:block start-indent=1.5in 
end-indent=1.5in
xsl:apply-templates/
/fo:block
/xsl:when
xsl:otherwise
xsl:apply-templates/
/xsl:otherwise
/xsl:choose
/fo:block
/xsl:template
xsl:template match=note
fo:block
xsl:attribute name=text-aligncenter/xsl:attribute
xsl:attribute name=font-size10pt/xsl:attribute
xsl:attribute name=font-weightbold/xsl:attribute

xsl:apply-templates/
/fo:block
/xsl:template
xsl:template name=rev.bar
xsl:if test=@rev
xsl:attribute 
name=border-start-colorblack/xsl:attribute
xsl:attribute 
name=border-end-colorwhite/xsl:attribute
xsl:attribute 
name=border-after-colorwhite/xsl:attribute
xsl:attribute 
name=border-start-stylesolid/xsl:attribute
xsl:attribute name=padding-start13pt/xsl:attribute
xsl:attribute 
name=border-start-width2pt/xsl:attribute
/xsl:if
/xsl:template
/xsl:stylesheet




--
View this message in context: 
http://apache-fop.1065347.n5.nabble.com/Implementing-Change-bars-tp16058p38772.html
Sent from the FOP - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org