How to link fields from xml to odt file to create conditions

Discuss the word processor
Post Reply
raghava9247
Posts: 3
Joined: Fri Feb 15, 2019 7:43 am

How to link fields from xml to odt file to create conditions

Post by raghava9247 »

Hi Team,

Kindly help how to read values from xml and use in odt file to create conditions.
OpenOffice 4/windows10
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to link fields from xml to odt file to create condit

Post by John_Ha »

Hacking or changing any of the .odt xml files is neither recommended nor supported. It is only used as a last resort to repair damaged files.

If you want help on what you are trying to do please give a specific example in detail. It should be achievable without accessing the xml.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
raghava9247
Posts: 3
Joined: Fri Feb 15, 2019 7:43 am

Re: How to link fields from xml to odt file to create condit

Post by raghava9247 »

Hi,

Thanks for your reply.

I will explain my requirement.

I have one predefined template with some text.I will import template in open office. I want to hide and show some text based on some conditions. suppose have one field name Name on top of text. condition is like Name EQ "xyz" show some part of text. other show full text.

here the value "xyz" should pick from xml.
OpenOffice 4/windows10
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to link fields from xml to odt file to create condit

Post by John_Ha »

Search Help with conditional.

It would help if you uploaded a small example .odt file showing what you want to do.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
raghava9247
Posts: 3
Joined: Fri Feb 15, 2019 7:43 am

Re: How to link fields from xml to odt file to create condit

Post by raghava9247 »

Thanks for Reply.

Please find below example.

Xml
-----
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<Named>Raghava</Named>
<MailingAddress>Bangalore</MailingAddress>
<LICNumber>123456</LICNumber>
<PolicyEffectiveFrom>03/19/2019 to 03/19/2019</PolicyEffectiveFrom>
</Configuration>

Template from Open office
---------------------------------

As individuals it is inherent to differ. Each individual's insurance needs and requirements are different from that of the others. LIC's Insurance Plans are policies that talk to you individually and give you the most suitable options that can fit your requirement.

LIC's Jeevan Pragati Plan is a non-linked, with - profits plan which offers a combination of protection and savings. This plan provides for automatic increase in risk cover after every five years during the term of the policy. In addition, this plan also takes care of liquidity needs through loan facility.

As individuals it is inherent to differ. Each individual's insurance needs and requirements are different from that of the others. LIC's Insurance Plans are policies that talk to you individually and give you the most suitable options that can fit your requirement.

--------------

conditions need to create like below:

Case 1:

If Name == "Raghava" middle paragraph should hide. Output like below

As individuals it is inherent to differ. Each individual's insurance needs and requirements are different from that of the others. LIC's Insurance Plans are policies that talk to you individually and give you the most suitable options that can fit your requirement.

As individuals it is inherent to differ. Each individual's insurance needs and requirements are different from that of the others. LIC's Insurance Plans are policies that talk to you individually and give you the most suitable options that can fit your requirement.

Case 2:

If Name not equal Raghava should not hide. Output like below.

As individuals it is inherent to differ. Each individual's insurance needs and requirements are different from that of the others. LIC's Insurance Plans are policies that talk to you individually and give you the most suitable options that can fit your requirement.

LIC's Jeevan Pragati Plan is a non-linked, with - profits plan which offers a combination of protection and savings. This plan provides for automatic increase in risk cover after every five years during the term of the policy. In addition, this plan also takes care of liquidity needs through loan facility.

As individuals it is inherent to differ. Each individual's insurance needs and requirements are different from that of the others. LIC's Insurance Plans are policies that talk to you individually and give you the most suitable options that can fit your requirement.

Kindly help me as early as possible
OpenOffice 4/windows10
Post Reply