I have CQWP that is in the SubSIte.I want to give it Custom ItemStyle.xsl path.I had done it by following Link.

<property name="ItemXslLink" type="string">/sites/test35/Style%20Library/XSL/WebPartItemStyle.xsl</property>

It works fine But when I edit WebPart it Shows the Error.

2 Answers 2


There is a blog post covering this at http://paylord.wordpress.com/2012/09/28/cqwp-and-xslt-part-1/. Essentially you will need to edit the web part in SharePoint Designer. If you need to reuse it then you can export and import to the web part gallery and it can then be added to pages like any other web part.

  • But,I want to add Web Part programitically Nov 1, 2013 at 8:35
  • Ah OK - then I am not the right person for advice - good luck. Nov 1, 2013 at 9:14

try to use ~siteCollection tokens for site collection or ~site token for a web:

<property name="ItemXslLink" type="string">~siteCollection/Style%20Library/XSL/WebPartItemStyle.xsl</property>
  • It works fine.But,when I edit the WebPart it throws the Error "Object Reference not set to an Instance of an Object." Nov 2, 2013 at 10:32
  • Have you looked at ULS log? C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\LOGS
    – Alexander
    Nov 4, 2013 at 7:12
  • It says "Object Reference not set to an Instance of an Object." Nov 11, 2013 at 4:06
  • there is should be stack trace
    – Alexander
    Nov 11, 2013 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.