|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
change the color of a paragrapfhHello all,
how can I change the color of the following paragraph <para id="testpara"> Change my color </para> I have tried with <xsl:attribute-set id="testpara"> <xsl:attribute name="color">blue<xsl:attribute> </xsl:attribute-set> It doesn`t work. |
|
|
RE: change the color of a paragrapfhSee this message:
http://www.oasis-open.org/archives/docbook-apps/200801/msg00152.html For this technique to work, you should add the template to a customization layer <http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLaye r>. Btw., do you really want to do it based on id? I would think some other attribute would be more useful. David > -----Original Message----- > From: 61Sniper [mailto:bahtiyar.yanik@...] > Sent: Tuesday, February 12, 2008 8:25 AM > To: docbook-apps@... > Subject: [docbook-apps] change the color of a paragrapfh > > > Hello all, > > how can I change the color of the following paragraph > > <para id="testpara"> > Change my color > </para> > > I have tried with > > > <xsl:attribute-set id="testpara"> > <xsl:attribute name="color">blue<xsl:attribute> > </xsl:attribute-set> > > It doesn`t work. > -- > View this message in context: > http://www.nabble.com/change-the-color-of-a-paragrapfh-tp15434 > Sent from the docbook apps mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: > docbook-apps-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
Re: change the color of a paragrapfhDavid is right. Role is usually a better attribute for this. I believe
Bob's most excellent book (http://www.sagehill.net/docbookxsl/) discusses this. Here is a snippet from a customization layer I'm using. It customizes the fo translation. The xsl:import should point to the location of your docbook xsl fo stylesheet. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:d="http://docbook.org/ns/docbook" version="1.0"> <xsl:import href="/opt/local/share/oxygen/frameworks/docbook/xsl/fo/docbook.xsl"/> <xsl:template match="para[@role = 'scope']"> <fo:block xsl:use-attribute-sets="normal.para.spacing"> <xsl:call-template name="anchor"/> <fo:inline color="#0099FF"> <xsl:apply-templates/> </fo:inline> </fo:block> </xsl:template> </xsl:stylesheet> Note the best approach for html is to use a css stylesheet to tag off the role. The docbook stylesheets will cause the value of "role" to be a "class". Here is a snip from the stylesheet I'm using. .scope { font-style: italic; color: #B40000; } Anything with a role="scope" will be red on the html page. You can specify the name of your stylesheet with the "html.stylesheet" parameter when you do the xslt transform. This is from http://www.sagehill.net/docbookxsl/Parameters.html#ParameterSyntax xsltproc --output myfile.html \ *--stringparam html.stylesheet "corpstyle.css"* \ docbook.xsl myfile.xml Lou David Cramer wrote: > See this message: > http://www.oasis-open.org/archives/docbook-apps/200801/msg00152.html > > For this technique to work, you should add the template to a > customization layer > <http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLaye > r>. > > Btw., do you really want to do it based on id? I would think some other > attribute would be more useful. > > David > > >> -----Original Message----- >> From: 61Sniper [mailto:bahtiyar.yanik@...] >> Sent: Tuesday, February 12, 2008 8:25 AM >> To: docbook-apps@... >> Subject: [docbook-apps] change the color of a paragrapfh >> >> >> Hello all, >> >> how can I change the color of the following paragraph >> >> <para id="testpara"> >> Change my color >> </para> >> >> I have tried with >> >> >> <xsl:attribute-set id="testpara"> >> <xsl:attribute name="color">blue<xsl:attribute> >> </xsl:attribute-set> >> >> It doesn`t work. >> -- >> View this message in context: >> http://www.nabble.com/change-the-color-of-a-paragrapfh-tp15434 >> > 031p15434031.html > >> Sent from the docbook apps mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: docbook-apps-unsubscribe@... >> For additional commands, e-mail: >> docbook-apps-help@... >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: docbook-apps-help@... > > > |
|
|
Re: change the color of a paragrapfhHallo,
thank you for the replies. I have changed the following lines <section status="scope"> <para> change the color </para> </section> <xsl:template match="para[@role = 'scope']"> <fo:block xsl:use-attribute-sets="normal.para.spacing"> <xsl:call-template name="anchor"/> <fo:inline color="#008000"> <xsl:apply-templates/> </fo:inline> </fo:block> </xsl:template> It doesn`t work. Have you any ideas, what`s wrong?
|
|
|
RE: change the color of a paragrapfhThe section attribute should be named role, not status...
Alan -----Original Message----- From: 61Sniper [mailto:bahtiyar.yanik@...] Sent: Tuesday, February 12, 2008 1:09 PM To: docbook-apps@... Subject: Re: [docbook-apps] change the color of a paragrapfh Hallo, thank you for the replies. I have changed the following lines <section status="scope"> <para> change the color </para> </section> <xsl:template match="para[@role = 'scope']"> <fo:block xsl:use-attribute-sets="normal.para.spacing"> <xsl:call-template name="anchor"/> <fo:inline color="#008000"> <xsl:apply-templates/> </fo:inline> </fo:block> </xsl:template> It doesn`t work. Have you any ideas, what`s wrong? Lou Springer wrote: > > David is right. Role is usually a better attribute for this. I believe > Bob's most excellent book (http://www.sagehill.net/docbookxsl/) > discusses this. > > Here is a snippet from a customization layer I'm using. It customizes > the fo translation. The xsl:import should point to the location of your > docbook xsl fo stylesheet. > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:fo="http://www.w3.org/1999/XSL/Format" > xmlns:d="http://docbook.org/ns/docbook" > version="1.0"> > > <xsl:import > href="/opt/local/share/oxygen/frameworks/docbook/xsl/fo/docbook.xsl"/> > > <xsl:template match="para[@role = 'scope']"> > <fo:block xsl:use-attribute-sets="normal.para.spacing"> > <xsl:call-template name="anchor"/> > <fo:inline color="#0099FF"> > <xsl:apply-templates/> > </fo:inline> > </fo:block> > </xsl:template> > > > </xsl:stylesheet> > > Note the best approach for html is to use a css stylesheet to tag off > the role. The docbook stylesheets will cause the value of "role" to be > "class". Here is a snip from the stylesheet I'm using. > > .scope { > font-style: italic; > color: #B40000; > } > > Anything with a role="scope" will be red on the html page. You can > specify the name of your stylesheet with the "html.stylesheet" parameter > when you do the xslt transform. > > This is from > http://www.sagehill.net/docbookxsl/Parameters.html#ParameterSyntax > > xsltproc --output myfile.html \ > *--stringparam html.stylesheet "corpstyle.css"* \ > docbook.xsl myfile.xml > > > > Lou > > David Cramer wrote: >> See this message: >> http://www.oasis-open.org/archives/docbook-apps/200801/msg00152.html >> >> For this technique to work, you should add the template to a >> customization layer >> >> r>. >> >> Btw., do you really want to do it based on id? I would think some other >> attribute would be more useful. >> >> David >> >> >>> -----Original Message----- >>> From: 61Sniper [mailto:bahtiyar.yanik@...] >>> Sent: Tuesday, February 12, 2008 8:25 AM >>> To: docbook-apps@... >>> Subject: [docbook-apps] change the color of a paragrapfh >>> >>> >>> Hello all, >>> >>> how can I change the color of the following paragraph >>> >>> <para id="testpara"> >>> Change my color >>> </para> >>> >>> I have tried with >>> >>> >>> <xsl:attribute-set id="testpara"> >>> <xsl:attribute name="color">blue<xsl:attribute> >>> </xsl:attribute-set> >>> >>> It doesn`t work. >>> -- >>> View this message in context: >>> http://www.nabble.com/change-the-color-of-a-paragrapfh-tp15434 >>> >> 031p15434031.html >> >>> Sent from the docbook apps mailing list archive at Nabble.com. >>> >>> >>> >>> To unsubscribe, e-mail: docbook-apps-unsubscribe@... >>> For additional commands, e-mail: >>> docbook-apps-help@... >>> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: docbook-apps-unsubscribe@... >> For additional commands, e-mail: docbook-apps-help@... >> >> >> > > > -- View this message in context: http://www.nabble.com/change-the-color-of-a-paragrapfh-tp15434031p154431 28.html Sent from the docbook apps mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
RE: change the color of a paragrapfhOh, and the template is looking for para elements, not section
elements... You would be better off leaving the template as is and adding the role attribute to the para element, that is <para role="scope">change the color</para> Alan -----Original Message----- From: 61Sniper [mailto:bahtiyar.yanik@...] Sent: Tuesday, February 12, 2008 1:09 PM To: docbook-apps@... Subject: Re: [docbook-apps] change the color of a paragrapfh Hallo, thank you for the replies. I have changed the following lines <section status="scope"> <para> change the color </para> </section> <xsl:template match="para[@role = 'scope']"> <fo:block xsl:use-attribute-sets="normal.para.spacing"> <xsl:call-template name="anchor"/> <fo:inline color="#008000"> <xsl:apply-templates/> </fo:inline> </fo:block> </xsl:template> It doesn`t work. Have you any ideas, what`s wrong? Lou Springer wrote: > > David is right. Role is usually a better attribute for this. I believe > Bob's most excellent book (http://www.sagehill.net/docbookxsl/) > discusses this. > > Here is a snippet from a customization layer I'm using. It customizes > the fo translation. The xsl:import should point to the location of your > docbook xsl fo stylesheet. > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:fo="http://www.w3.org/1999/XSL/Format" > xmlns:d="http://docbook.org/ns/docbook" > version="1.0"> > > <xsl:import > href="/opt/local/share/oxygen/frameworks/docbook/xsl/fo/docbook.xsl"/> > > <xsl:template match="para[@role = 'scope']"> > <fo:block xsl:use-attribute-sets="normal.para.spacing"> > <xsl:call-template name="anchor"/> > <fo:inline color="#0099FF"> > <xsl:apply-templates/> > </fo:inline> > </fo:block> > </xsl:template> > > > </xsl:stylesheet> > > Note the best approach for html is to use a css stylesheet to tag off > the role. The docbook stylesheets will cause the value of "role" to be > "class". Here is a snip from the stylesheet I'm using. > > .scope { > font-style: italic; > color: #B40000; > } > > Anything with a role="scope" will be red on the html page. You can > specify the name of your stylesheet with the "html.stylesheet" parameter > when you do the xslt transform. > > This is from > http://www.sagehill.net/docbookxsl/Parameters.html#ParameterSyntax > > xsltproc --output myfile.html \ > *--stringparam html.stylesheet "corpstyle.css"* \ > docbook.xsl myfile.xml > > > > Lou > > David Cramer wrote: >> See this message: >> http://www.oasis-open.org/archives/docbook-apps/200801/msg00152.html >> >> For this technique to work, you should add the template to a >> customization layer >> >> r>. >> >> Btw., do you really want to do it based on id? I would think some other >> attribute would be more useful. >> >> David >> >> >>> -----Original Message----- >>> From: 61Sniper [mailto:bahtiyar.yanik@...] >>> Sent: Tuesday, February 12, 2008 8:25 AM >>> To: docbook-apps@... >>> Subject: [docbook-apps] change the color of a paragrapfh >>> >>> >>> Hello all, >>> >>> how can I change the color of the following paragraph >>> >>> <para id="testpara"> >>> Change my color >>> </para> >>> >>> I have tried with >>> >>> >>> <xsl:attribute-set id="testpara"> >>> <xsl:attribute name="color">blue<xsl:attribute> >>> </xsl:attribute-set> >>> >>> It doesn`t work. >>> -- >>> View this message in context: >>> http://www.nabble.com/change-the-color-of-a-paragrapfh-tp15434 >>> >> 031p15434031.html >> >>> Sent from the docbook apps mailing list archive at Nabble.com. >>> >>> >>> >>> To unsubscribe, e-mail: docbook-apps-unsubscribe@... >>> For additional commands, e-mail: >>> docbook-apps-help@... >>> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: docbook-apps-unsubscribe@... >> For additional commands, e-mail: docbook-apps-help@... >> >> >> > > > -- View this message in context: http://www.nabble.com/change-the-color-of-a-paragrapfh-tp15434031p154431 28.html Sent from the docbook apps mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
RE: change the color of a paragrapfhThe advantage of matching text()[ancestor::*/@role = 'scope']|xref[
ancestor::*/@role = 'scope' ] is that you can then add role="scope" to any element and all the text within that element will be affected. So you would do this in your customization layer: <xsl:template match="text()[ ancestor::*/@role = 'scope' ]| xref[ancestor::*/@role = 'scope' ]"> <fo:wrapper xmlns:fo="http://www.w3.org/1999/XSL/Format"; color="#008000"><xsl:apply-imports/></fo:wrapper> </xsl:template> Otherwise, you'll have to create new templates for every element that you want to be able to affect with role="scope". David > -----Original Message----- > From: Alan Oehler [mailto:Alan.Oehler@...] > Sent: Tuesday, February 12, 2008 3:16 PM > To: 61Sniper; docbook-apps@... > Subject: RE: [docbook-apps] change the color of a paragrapfh > > Oh, and the template is looking for para elements, not > section elements... > > You would be better off leaving the template as is and adding > the role attribute to the para element, that is > > <para role="scope">change the color</para> > > Alan > > -----Original Message----- > From: 61Sniper [mailto:bahtiyar.yanik@...] > Sent: Tuesday, February 12, 2008 1:09 PM > To: docbook-apps@... > Subject: Re: [docbook-apps] change the color of a paragrapfh > > > Hallo, > > thank you for the replies. I have changed the following lines > > <section status="scope"> > <para> > change the color > </para> > </section> > > <xsl:template match="para[@role = 'scope']"> > <fo:block xsl:use-attribute-sets="normal.para.spacing"> > <xsl:call-template name="anchor"/> > <fo:inline color="#008000"> > <xsl:apply-templates/> > </fo:inline> > </fo:block> > </xsl:template> > > > It doesn`t work. Have you any ideas, what`s wrong? > > > > > > > > > Lou Springer wrote: > > > > David is right. Role is usually a better attribute for > this. I believe > > > Bob's most excellent book (http://www.sagehill.net/docbookxsl/) > > discusses this. > > > > Here is a snippet from a customization layer I'm using. It > customizes > > > the fo translation. The xsl:import should point to the location of > your > > docbook xsl fo stylesheet. > > > > <?xml version="1.0" encoding="UTF-8"?> > > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > xmlns:fo="http://www.w3.org/1999/XSL/Format" > > xmlns:d="http://docbook.org/ns/docbook" > > version="1.0"> > > > > <xsl:import > > > href="/opt/local/share/oxygen/frameworks/docbook/xsl/fo/docbook.xsl"/> > > > > <xsl:template match="para[@role = 'scope']"> > > <fo:block xsl:use-attribute-sets="normal.para.spacing"> > > <xsl:call-template name="anchor"/> > > <fo:inline color="#0099FF"> > > <xsl:apply-templates/> > > </fo:inline> > > </fo:block> > > </xsl:template> > > > > > > </xsl:stylesheet> > > > > Note the best approach for html is to use a css stylesheet > to tag off > > the role. The docbook stylesheets will cause the value of > "role" to be > a > > "class". Here is a snip from the stylesheet I'm using. > > > > .scope { > > font-style: italic; > > color: #B40000; > > } > > > > Anything with a role="scope" will be red on the html page. You can > > specify the name of your stylesheet with the "html.stylesheet" > parameter > > when you do the xslt transform. > > > > This is from > > http://www.sagehill.net/docbookxsl/Parameters.html#ParameterSyntax > > > > xsltproc --output myfile.html \ > > *--stringparam html.stylesheet "corpstyle.css"* \ > > docbook.xsl myfile.xml > > > > > > > > Lou > > > > David Cramer wrote: > >> See this message: > >> > http://www.oasis-open.org/archives/docbook-apps/200801/msg00152.html > >> > >> For this technique to work, you should add the template to a > >> customization layer > >> > <http://www.sagehill.net/docbookxsl/CustomMethods.html#Customi > zationLaye > >> r>. > >> > >> Btw., do you really want to do it based on id? I would think some > other > >> attribute would be more useful. > >> > >> David > >> > >> > >>> -----Original Message----- > >>> From: 61Sniper [mailto:bahtiyar.yanik@...] > >>> Sent: Tuesday, February 12, 2008 8:25 AM > >>> To: docbook-apps@... > >>> Subject: [docbook-apps] change the color of a paragrapfh > >>> > >>> > >>> Hello all, > >>> > >>> how can I change the color of the following paragraph > >>> > >>> <para id="testpara"> > >>> Change my color > >>> </para> > >>> > >>> I have tried with > >>> > >>> > >>> <xsl:attribute-set id="testpara"> > >>> <xsl:attribute name="color">blue<xsl:attribute> > >>> </xsl:attribute-set> > >>> > >>> It doesn`t work. > >>> -- > >>> View this message in context: > >>> http://www.nabble.com/change-the-color-of-a-paragrapfh-tp15434 > >>> > >> 031p15434031.html > >> > >>> Sent from the docbook apps mailing list archive at Nabble.com. > >>> > >>> > >>> > --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: > docbook-apps-unsubscribe@... > >>> For additional commands, e-mail: > >>> docbook-apps-help@... > >>> > >>> > >>> > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: > docbook-apps-unsubscribe@... > >> For additional commands, e-mail: > docbook-apps-help@... > >> > >> > >> > > > > > > > > -- > View this message in context: > http://www.nabble.com/change-the-color-of-a-paragrapfh-tp15434 > 28.html > Sent from the docbook apps mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: > docbook-apps-help@... > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@... > For additional commands, e-mail: > docbook-apps-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@... For additional commands, e-mail: docbook-apps-help@... |
|
|
RE: change the color of a paragrapfhHello,
Your replies are very helpful, it works. Many thanks!
|
| Free embeddable forum powered by Nabble | Forum Help |