Suppose I start with an empty specialized stylesheet,
acme-corp-2html.xsl, that xsl:imports the general stylesheet,
us-gaap-ci-2html.xsl. Even without defining any templates of its own,
acme-corp-2html.xsl will handle all the elements that the general
stylesheet can handle. That's good.
However, the acme-corp instance documents uses many elements (let's say
it could be hundreds) that are not present in generic us-gaap-ci
instance documents. Assuming that the imported us-gaap-ci-2html.xsl just
simplistically defines templates that match based on element names in
the us-gaap-ci.xsd, these specialized Acme elements won't be matched by
the imported templates.
I don't see how xsl:import helps me to get the generic
us-gaap-ci-2html.xsl templates to apply to the new elements used by Acme
corp. (Or am I missing something?)
I could manually determine the names of elements that are unique to
acme-corp, and add template rules for each into acme-corp-2html.xsl.
The bodies of these templates would be exactly the same as the templates
of the corresponding elements in the included stylesheet. And there are
thousands of companies like Acme Corp.
I want to be able to write versions of generic stylesheets (like
us-gaap-ci-2html.xsl) that will work no only for us-gaap-ci.xsd instance
documents, but also for any documents derived from us-gaap-ci that
define their own more specialized elements.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list