2

I will have rather many attribute-sets combinations since I work with a parsed JSON data, with flat hierarchical structure (where I need to build up the attributes content in XSL). Since I have the XSL modularized with the file principal.xsl as primary XSL it would be benificial to gather all varations of attribute-set in one file and call that file from principal.xsl. I have understood that when performing an include one actual inserts the templates into principal.xsl. but the attribute-set is not inside a template.

How can I load attribute-sets from another XSL file into principal.xsl?

Toolbox
  • 2,333
  • 12
  • 26
  • 1
    If you include a stylesheet module declaring attribute sets you should be able to use those attribute sets in the including stylesheet. – Martin Honnen May 26 '21 at 15:23
  • Works great! I assumed that in a stylesheet it was mandatory to have a template. Please move your comment to an answer and I will accept it. – Toolbox May 26 '21 at 15:27

1 Answers1

3

If you include a stylesheet module declaring attribute sets you should be able to use those attribute sets in the including stylesheet.

https://www.w3.org/TR/xslt-30/#include talks about declarations https://www.w3.org/TR/xslt-30/#dt-declaration and of course xsl:attribute-set is one type of declarations you can include.

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110