Detecting language please wait for.......
So here's my next query. Imagine the following XML:
<par>This is a <xref>Link</xref> to something else.</par><par><xref>Link</xref> to something else.</par>I am looking to differentiate between the 2 xref tags. The only difference is whether they are treated as a word end. In the first, it SHOULD be; in the second, it SHOULDN'T be. I therefore need a parser rule that can determine that there is no text between the parent and sibling.
Unfortunately, I am having no luck and hoping someone can help with this special case.
I am not proficient in Xpat at all, but I see "word end" here. Why should a tag, which is obviously an inline tag, be no word end? When you are a translator and your vendor has defined a tag not to be a word end, you have much fun when selecting word. Each time you select a text before such tag not being a word end, the text and the tag are selected together and you have to go back. So from a translators point of view, all inline tags MUST be word end, just because then they will be treated separate from text. This is then much easier in editing. So may I ask, why you will define one of this ref tags as no word end?
Due to a quirk in how WorldServer parses XML files, it seems to make a distinction between word ends. I also would never for the life of me want to define tags as NO word end, but I have to in order to avoid units that look like this:
When when I want is this:
So when xref is in the middle of a unit, WORD END works with the "Include with text" rule. When it's at the beginning, it doesn't.
OK, I see - but "Include" or "Always include" should work despite the setting for word end. If it does not work, I suppose a bug here...
Thank you for clarification.
Jerzy Czopik said:Why should a tag, which is obviously an inline tag, be no word end?
E.g. when individual letters (or parts of word, or similar) are colored/formatted differently?
No problem. Neither "Include" or "Include with Text" works in this case. (Include with Text is the default setting for the "normal" tag -> Word end).
After scrounging around online for hours, I was able to finally put this together and it seems to work:
In case it helps anyone else out there.
Nice work Michael Schroeder... there are some good examples with your recent questions. Thank you for sharing.