Complex XPath combining several criteria

I am dealing with a rather complex XML file that contains a lot of content that is not be translated. So far, I managed to came up with an XPath query that identifies ONE piece of information that is to be translated, but I will have to combine quite a few criteria to make sure all the translatable content is identified, and I am afraid a bit at a loss here.  I am wondering if there is an expert around here who might want to have a look at the file and then point me in the right direction? There are a few things I am not sure about, and hours of trial and error have not produced any useful results yet.

Parents Reply Children
  • Hi Paul, I am sorry, I was away for a couple of days and haven't had time to get back to you all about this. First of all, I would like to thank everyone for their kind offers. Sébastien managed to solve the riddle for me. :) The problem is very specific, because the client's approach to content creation and translation is rather unique, but I will try and give a short, generic summary:

    The file I was working on had a lot of translatable content, but very little of this actually had to be translated. My first attempt was to find an element that identifies all the translatable content and then to create a doc type definition with an XPath rule that makes sure only the content to be translated ends up in the project file. Finding the common identifier of all translatable content was a bit of a challenge, because this information was actually hidden in the CDATA value. I was not aware that CDATA information can be used for XPath, but Sébastien was kind enough to give it a try and came up with the correct XPath rule. Now all I had to create the doc type definition and adapt the XPath for the individual pieces of content that need translating.

    I assume this is very abstract if you are not familiar with the project, but perhaps it makes sense to some of you. Lessons learned for me: 1) CDATA information can be used in XPath 2) It is sometimes easier to base a rule on what is NOT to be translated rather than on what IS to be translated.

    I will be happy to give some more information off-forum to anyone who's interested, but I prefer not to post client-specific information publicly.

    Best regards,
    Bettina