Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 246819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:12:15+00:00 2026-05-11T21:12:15+00:00

I know that XSLT itself has attribute-sets, but that forces me to use <xsl:element

  • 0

I know that XSLT itself has attribute-sets, but that forces me to use

<xsl:element name="fo:something">

every time I want to output an

<fo:something>

tag. Is there anything in the XSL-FO spec that would allow me to specify (let’s say) a default set of attributes (margin, padding, etc.) for all Tables in the FO output?

Essentially I’m looking for the functionality of CSS, but for FO output instead of HTML.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:12:15+00:00Added an answer on May 11, 2026 at 9:12 pm

    No, you are not required to use xsl:element, the use-attribute-sets attribute can appear on literal result elements if you place it in the XSLT namespace, so you can use something like:

    <fo:something xsl:use-attribute-sets="myAttributeSet">
    

    If you want to have something close to the CSS functionality then you can add another XSLT transformation at the end of your processing that adds the attributes that you want. You can start with a recursive identity transformation and then add templates matching on the elements you want to change, see a small example below

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:attribute-set name="commonAttributes">
        <xsl:attribute name="common">value</xsl:attribute>
      </xsl:attribute-set>
      <xsl:template match="node() | @*">
        <xsl:copy>
          <xsl:apply-templates select="node() | @*"/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="someElement">
        <xsl:copy use-attribute-sets="commonAttributes">
          <xsl:attribute name="someAttribute">someValue</xsl:attribute>
          <xsl:apply-templates select="node() | @*"/>
        </xsl:copy>
      </xsl:template>
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that XSLT does not work in procedural terms, but unfortunately I have
I know that I can do something like $int = (int)99; //(int) has a
In my XSLT file. I use the document() function <xsl:variable name=Publicity select=document('./publicity.xml') /> and
I know that |DataDirectory| will resolve to App_Data in an ASP.NET application but is
I know that IList is the interface and List is the concrete type but
I know that if I have an XML file like this: <persons> <class name=English>
Does anyone know of a solid non-encumbered suite of XSLT sheets that can generate
Greetings, I'm no XSL/XSLT/XML shark, I have worked with some, though, but I've never
Does anyone know of a library that is capable of generating XSL-FO from a
The java standard tutorial http://download.oracle.com/javase/tutorial/jaxp/xslt/xpath.html explains the XPath standard itself but not the java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.