SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on customization of some ContentByQueryWebPart.

This customization consists in defining custom contentquerymain.xsl and itemstyle.xsl file.

However, from one customization to another, only small changes are applied. For example, depending on the webpart, I'm changing the beginList variable to apply custom css class, or I add some custom markup.

The side effect, is that if I change something that is shared between all instances, I have to report the changes in all xsl files.

Is there a clean way to factorize standard xsl templates?

I've seen the <xsl:import> node, but I could not make it work.

[Edit] After some test, I discover that I can "import" the xsl will something like :


However, this is not dynamic, I have to know the site collection url in advance to make it works

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.