How to create a full list of tags using XML and XSL

“Can I get a list of all tags used in an Adlib database?” is a Frequently Asked Question. The answer is yes.

In short, here’s how:

  1. using Adlib Designer, create XML documentation of the database you wish to list tags for.
  2. copy a header into that XML. This header specifies which XSL-stylesheet to use with the file you created in step 1. The XSL specifies what to list in which format.
  3. double-click on the XML-file with the header. A browser should open. Behold: a tag list. You can now save that page as a text file, so you can import it into Excel for further processing.

Here are XSLTtwo sample sets of XSL’s and headers (one Dutch and one English). Download them and save them in a separate folder called XSLT. (This is not mandatory, but the story below is easier to follow if you do.)

Step 1. Open Adlib Designer, set your main working directory to your main Adlib directory and open the application browser (package icon). In the application browser, open the data folder. You see a list of databases (If you see a list of folders first, scroll down). Right-click on the database you want the taglist for (usually collect or document), and select Create Documentation. A window opens. Click View and select XML. Then save this file in the folder with the sample XSL’s and headers you downloaded above, and give it a sensible name (like ‘collect’ or ‘document’). You don’t need to specify the extension (XML), that’s added automatically.

Step 2. Now copy the header into your documentation-XML.

The quick & dirty way is by opening the header in a text editor and press Control-A and Control-C.

Then you open the XML in a text editor and hit CTRL-V to paste your header.

NOTE!  XML documentation generated with recent versions of Designer starts with this line:

<?xml version="1.0" encoding="UTF-8" ?>

The header supports both types, but you must remember that only one such line is allowed, and it must be the first line of the file. XML is very picky.

So the first three lines of your file must look like this:

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="taglist_EN.xsl"?>
<adlib-documentation>

Save the XML with the changes.

Now double-click on your XML. It should look something like the screenshot on the right.

Knipsel

A few final notes.

Note 1: I’ve used this to list linked fields and link reference tags. It creates a table, with fixed width fields, semi-colon separated, so I could import into Excel easily.

Note 2: This is just one short example. XSL is a pattern matching programming language. The possibilities are truly endless. Learn-by-doing XSL is really not that difficult. Modify and experiment all you like. Doing so will enhance your career perspectives. I kid you not.

Note 3: XML and XSL are extremely CaSE SENsitIVE. So watch out. Firefox is a good browser for validating XML. Hint: Make Firefox the default application for XML files.

Note 4: you can create XML documentation on pretty much all Adlib objects, like screens, databases, applications, import jobs, and so on. This is extremely useful for a great many application management tasks, because it allows you to group, categorise and sort all sorts of Adlib stuff in Excel. More enhanced career perspectives.

Update:  with the most recent version of Designer, you can link the documentation stylesheet into Designer. This information was 22 hours old when I posted this article. We’re going to have to try this, won’t we?

4 gedachten over “How to create a full list of tags using XML and XSL”

  1. Pernille Richards

    That sounds really interesting. I will investigate this. I think this could help me a lot. Thank you for sharing. I=

Reacties zijn gesloten.

Scroll naar boven