Server side includes

Asked by Rasmus Villemoes

I just discovered nxhtml today, and find the idea of having almost real-time validation quite attractive. However, I use quite a lot of server side include statements in order not to duplicate code. So of course, in itself, the files with the actual content don't validate. Is it possible to make emacs/nxml-mode interpret these ssi directives and pretend that the contents of those files is actually present?

Question information

Language:
English Edit question
Status:
Answered
For:
nXhtml Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
lborgman (lennart-borgman) said :
#1

Thanks for this question, Rasmus. It is a very good suggestion actually.

Unfortunately it is a bit complicated to implement. The validator is written to work on one file only. It is very good for that (but not written by me, it is the validator in nxml-mode that is used).

I have made some suggestion (to Stefan Monnier, one of the Emacs maintainers) for how implementing this could be done. It would be nice if someone tried to implement it (or maybe some other solution). However it is above my C-level skills to try it.

If you are interested, please take this question up on the Emacs development mailing list (maybe referring to this question). If someone shows interest in it maybe some day we will find someone who is willing to offer time to try a solution.

Revision history for this message
Rasmus Villemoes (burner-imf) said :
#2

Thanks for your reply. I must admit that my C and elisp skills are virtually non-existent, so I'm not sure I could be of any help.

For now, I think I'll make a perl script to do the inclusion before I put the files on the web. Something like: Every #include directive is replaced by a html comment with some special content (an emacs folding marker, the file name, perhaps some other stuff), followed by the contents of the file, followed by another html comment (with a end folding marker, and some other stuff). If the script meets a line containing a html comment inserted by the script itself, the region until the end marker is replaced by the contents of the file. With folding-mode, I think this could get the best of both worlds (with a little extra overhead).

Can you help with this problem?

Provide an answer of your own, or ask Rasmus Villemoes for more information if necessary.

To post a message you must log in.