To create a filter for SGML files can be a difficult and expensive task, if you don’t know how to handle those files. I can tell this from experience. First I made the misinterpretation that SGML files are similar to XML files and tried to build something around an XML filter. I didn’t work! Why? Because the SDL tools are very strict in this matter and since the SGML might have the same structure as a XML file, the header and the doctype declarations are not the same at all. So the tools denied the creation of such a filter.

The next choice was my favorite: The RegEx. With the RegEx capability of Studio and/or WorldServer you can create filters for almost any files. But unfortunately in this case the file was so strange structured with returns in the tags, that this also did not work or just with some strange workarounds which also meant to have only a 99% solution. And when it is about translation handling, 99% is not good enough.

Only when I pointed my problem to the SDL support, they came up with another solution and it worked.

The solution is a HTML5 filter. It can do much more than HTML. When you create a new HTML5 filter in SDL Studio 2017.

You start with creating a [New…] filter and choose HTML.

Give the files a unique name, a unique file type identifier and add the correct file dialog wildcard expression (e.g. *.sgm)

Choose „Define HTML elements based on SGML…“ and point it to a reference file.

 

SDL Studio identifies automatically all elements from the reference file. Here I think SDL did a great job!  Go to the next window. You just need to define which elements are translatable and which ones not. Just click on the values and choose the correct one.

Open the reference file, copy the doctype tag and paste it into the dialog.

Leave it as it is.

I choose that everything stays as it is. So „preserve“ and „Do not change“ are our friends.

I choose that everything stays as it is. So „preserve“ and „Do not change“ are our friends.

Done!

Now the filter is working and SMGL files can be processed.

 

.over-and-out