John,
To follow up on the conditions aren't really conditional, but static
states: I got as far as page 613 of the ODF 1.2 specification. (which used
to be free from OASIS, but now costs chf198 from ISO.org.)
it says
"The text:condition attribute specifies a condition. Conditions do not have
a predefined
syntax, but the attribute value should begin with a namespace prefix,
followed by a ":" (U+003A,
COLON) separator, followed by the text of a formula. The namespace bound to
the prefix
determines the syntax and semantics of the formula."
But all my attempts to make this work within Libreoffice writer failed. LO
Writer evaluated anything I put into <text:conditional-text> as pure text,
not as a formula (as far as I could tell.)
I was approaching from a differential analysis on .fodt documents before
and after I made various changes, then studying ODF spec to determine what
that field could actually do.
There's clearly no interface to support this. It's in the spec so there
should be capability in LO Writer (or at least OpenOffice 2 & 3).. but
regardless what program I tried, I continued to get similar results...
regardless of what was in the <text:condition> attribute, i always got one
of the two results unless the evaluation was strictly either "FALSE" or
"TRUE" or some variant of capitalization of one of these. So wherever the
actual statement was it was looking for a boolean result but a string
result, which LO wasn't returning if the evaluation ever happened.
So, I switched to Calc where I know how to do boolean logic, and each cell
is visible realtime, so it doesn't take advanced forensics to see what is,
and fix.
On Fri, Jan 1, 2021 at 12:47 PM John Kaufmann <
[hidden email]> wrote:
> Thanks, Remy. I'm very familiar with that use of conditional text. [My
> wife is also a teacher, and also depends on the LO-user in the house to
> help when things get moderately complex. ;-) ]
>
> The problem comes not when I can specify a switch (like "User" ==
> "Teacher" or "Student"), but when merging external data -- where a field
> may be either empty or instantiated -- to control a section of conditional
> text. Is there some way to do "IF-EXISTS" or "IF-BLANK" test on a field?
>
> I appreciate your response,
> John
>
> On 2021-01-01 12:49, Remy Gauthier wrote:
> > Greetings,
> > You can use a section to do that in WRITER. The easy way to start is to
> highlight the text and then Insert > Section. In the section configuration,
> there is a conditional "Hide" you can use. For example, I created my wide's
> course material using WRITER and I use a variable named "User"; this
> variable is used on the cover page to indicate "Teacher's version" or
> "Student's version" (the value of User is Teacher or Student). The document
> contains the homework and practice exams the students will need to do
> throughout the semester. In the "Student's version", each question is
> followed by a blank area or by empty lines to allow them to write the
> answer to the question. In the "Teacher's version", each question is
> followed by a detailed answer. The way I did this was to create two
> sections after each question: the first section is for the detailed answer,
> and is hidden if 'User eq "Student"'. The second section contains the space
> needed for the students to write their answer; this
> > section is hidden if 'User neq "Student"'. This way, I can flip between
> versions by changing the value of the variable.
> >
> > There is more information here:
>
https://help.libreoffice.org/3.3/Writer/Hiding_Text <
>
https://help.libreoffice.org/3.3/Writer/Hiding_Text>
> >
> > There are multuple ways of doing what you are looking for, but I believe
> sections are more flexible.
> >
> > I hope this helps.
> > Rémy.
> >
> > Le vendredi 01 janvier 2021 à 09:53 -0500, John Kaufmann a écrit :
> >> WordPerfect has a very useful condition for conditional text that must
> be possible in Writer, but I have not figured out how to implement: How to
> hide a block or section of text (or frame/figure/table/etc) unless one or
> more instances of a class (to which that text pertains) exist. Is there a
> way of expressing the condition
> >> "If: a field {IS|IS NOT} BLANK"
> >> that can be used in the condition to hide or expose relevant text?
>
>
> --
> To unsubscribe e-mail to:
[hidden email]
> Problems?
>
https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/> Posting guidelines + more:
https://wiki.documentfoundation.org/Netiquette> List archive:
https://listarchives.libreoffice.org/global/users/> Privacy Policy:
https://www.documentfoundation.org/privacy>
--
To unsubscribe e-mail to:
[hidden email]
Problems?
https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/Posting guidelines + more:
https://wiki.documentfoundation.org/NetiquetteList archive:
https://listarchives.libreoffice.org/global/users/Privacy Policy:
https://www.documentfoundation.org/privacy