When the authoring tool imports <variable> tags it adds a blank visibility attribute to the import which isnt a property used by the tag. The visibility attribute is used by the <ahelp> tag. Example file - /text/shared/01/02180000.xhp XML <variable id="verknuepfungentext"> View in LO <VAR ID="verknuepfungentext" VISIBILITY="">
Same thing happens with a localize attribute being added to the <switch> tag. If it is blank, why show a blank attribute. Example - text/shared/01/02180000.xhp View in LO <SWITCH select="sys" localize="">
In case of 'variable' element the attribute 'visibility' is allowed. To not write 'VISIBILITY=""' a similar '<xsl:choose>' element is needed as it is used for the 'ahelp' element. The case of 'switch' element is more difficult. In xmlhelp.dtd the attribute 'localize' is not allowed for the 'switch' element. But the comment in the transformation xmlhelp2soffice.xsl mentions it. So first it is needed to examine, whether an attribute 'localize' is currently evaluated for a switch element. If it is evaluated, an '<xsl:choose>' element has to be used and the doctype has to be adapted. If it is not evaluated, this special part in the transformation can be dropped. [ I yet don't know how to examine it.]
Olivier: Have any input on this?
I have searched, whether there exists any switch-element with an attribute 'localize' in the current help files. I've found none. Therefore I thing it is save to prevent generating such attribute in the transformation 'xmlhelp2soffice.xsl'. I have used regex switch[^>]localize in \core\helpcontent2\source\text including subfolders using Notepad++
Created attachment 119150 [details] no localize on switch element, visibility on variable only when hidden Do you agree with this solution?
I'm not knowledgeable enough about xsl, so i'll have to leave it up to others to judge. @kendy: Can you look over regina's patch?
Regina: Thank you for your patch! :-) I've pushed the 1st part of that - the "no localize on switch element". For the 2nd - can we actually do the <xsl:choose> inside the block, like: <text:variable-set text:name="VAR_" text:value-type="string"> <xsl:choose> <xsl:when test="@visibility='hidden'"> <xsl:value-of select="concat('<VAR ID="',@id,'" VISIBILITY="',@visibility,'">')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="concat('<VAR ID="',@id,'">')"/> </xsl:otherwise> </xsl:choose> </text:variable-set> so that more code there is shared?
Regina Henschel committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/contrib/dev-tools/commit/?id=cfc05699a5e541f0e0785ed342443506f272255f tdf#94201: No 'localize' on the 'switch' element. It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Jan: That will be possible and I agree, it is a better solution. I'll make you a new patch.
Proposed patch is in https://gerrit.libreoffice.org/#/c/19223/
Regina Henschel committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/contrib/dev-tools/commit/?id=cfc05699a5e541f0e0785ed342443506f272255f tdf#94201: No 'localize' on the 'switch' element.
Sorry for the second notification, just tested the script if it now omits info about daily builds for dev-tools changes. :-)
(Sorry again for the second one, I promise not to spam here anymore. ;-) )
Regina Henschel committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/contrib/dev-tools/commit/?id=7876235adbb4b3da4a0e7e809524b21d4fb47c88 tdf#94201 Dont import blank visibility attribute of <variable> tag
Both is now in, I think we can close this bug. Thank you, Regina!