Wednesday, 6 June 2007

Viewing XForms and (x)html from the SVN web viewer

So we had a problem the other day, we wanted to be able to view html / xhtml examples as working pages direct from the SVN repository using a browser.

If you've committed a load of xhtml files (e.g. xforms) and you want to be able to view them as "applications" (or rendered html) from within svn, you need to set a property called svn:mime-type for all of the relevant files.

For old-skool html - you can use this mime-type:
text/html *.html (and any other extensions)

And in order to make xforms work properly - you can use this mime-type:
application/xhtml+xml *.xhtml

------------------------------
Within eclipse, right-click on the file (e.g. index.xhtml), go to Team > Set property, select svn:mime-type from the dropdown (or just type it) and enter the text property in the box below (e.g. application/xhtml+xml *.xhtml).

Eclipse/Subclipse also has a "Set property recursively) checkbox, selecting this should change the properties where there are several folders.

You can also select show properties to display the properties in a panel within the perspective.

For eclipse instructions - remember that you need subclipse installed (see my previous post)...

1 comment:

Sanjiv said...

I found this very useful. Thanks!