Page 1 of 1

Generate a dependency hierarchy for FO attribute sets

Posted: Fri May 15, 2020 2:38 am
by kirkilj
We need to audit all of our attribute sets that have become cluttered with explicit attributes added to fo: elements in addition to their attribute sets. Many attributes are defined at a deeper level that could have relied entirely on the cascading behavior. This can cause bugs if a higher level attribute set is changed, but they are explicitly defined at a lower level unduly. There are many times when overriding ancestral values is desired. In order so sort this out, I was wondering if anyone knows of a tool or method that would do for attribute sets what Oxygen now does with their hierarchy/dependency views? The perfect solution would examine templates and work its way up the inheritance tree to produce a dependency report.

We may write one ourselves if we have to, but I'd rather not if it exists in a useful form. Google searches have yielded nothing so far.

Re: Generate a dependency hierarchy for FO attribute sets

Posted: Fri May 15, 2020 7:50 am
by Radu
Hi John,

Indeed from what I remember xsl:attribute-sets are additive, for the same attribute set name you can define in multiple stylesheets multiple attribute definitions and all of them will be gathered together by the XSLT processor.
How would you see a tool useful for working with attribute sets implemented in Oxygen?
Right now if in an XSLT stylesheet I go on an xsl:use-attribute-sets="abc" attribute set reference I can right click and choose "Search->Search declarations in" to locate all definitions of the attribute set.
Do you want to somehow also see in a side view how attribute sets with the same name also overwrite each other? Somehow show them in a hierarchy ordered by the priority of each XSLT stylesheet so that there is a clear indication how they override each other? In this way if two attribute sets with the same name define the same attribute you could get a good idea about which one "wins".
Maybe a custom action which would be invoked on an element which refers an attribute set in the XSLT and which could report what the generated attributes would be and in what attribute sets they were defined...

Regards,
Radu