BenR
BenR

Reputation: 2936

Do XSLT changes require a compile?

I'm unable to find any topic on this online or on the StackOverflow site. I'm specifically asking for ASP.Net applications, but does it require a compile for changes in any language?

Upvotes: 1

Views: 717

Answers (3)

Anshu
Anshu

Reputation: 7853

If you are keep XSL files as separate .xsl files, you would not need to compile them again after changing, but would need to reload new XSL file to your transformer.

To do so you create a Templates object, like:

TransformerFactory factory = TransformerFactory.newInstance();
factory.setErrorListener(new ErrorListener( ... ));
xslTemplate = factory.newTemplates(new StreamSource( ... ));

and use the template to get a transformer to do the work:

Transformer transformer = xslTemplate.newTransformer();

Depending on the XSL library your usage may vary

Upvotes: 0

Oded
Oded

Reputation: 499132

It depends on how you are using XSLT.

If the application reads the files externally it will not need to be recompiled as such (if it caches them XSLT then it will need a restart most likely, but not a recompile).

If the files are embedded resources or compiled XSLT then you will need to recompile changes.

Upvotes: 1

Aghilas Yakoub
Aghilas Yakoub

Reputation: 28990

You don't need compile your file XSLT if you fix path in your pages, but if your file is embeded ressource in this case you need compile

Upvotes: 0

Related Questions