× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi

If you have a variable in your template, you always have to set it to something - otherwise you get this **Missing data** content there. Or another default that you can set, if I recall rightly.

If you can have the XML element empty, just pass the empty string in the UpdHTMLVar procedure call - the string with 2 quotes and nothing in between.

If you need to leave out empty elements, I suggest that you have a sections for <mytag> only - then a section for the stuff before <mytag> and another for the stuff after <mytag>..

So something like this:

<!-- $contentbeforemytag$ -->
    your XML content that comes before "mytag"
<!-- $mytag$ -->
<mytag><!-- %mytagcontent% --></mytag>
<!-- $contentaftermytag$ -->
   you XML content that comes after "mytag"

Then in your RPG you use an IF block to control whether to WrtSection('mytag')

Another way is to have 2 sections for the entire content - one has "mytag", the other does not contain "mytag". This could be easier to understand but has more things in the template.

You need to be sure that the XML content is valid when you leave out the "mytag" element.

I have used the both methods.

HTH
Vern


On 8/23/2017 9:13 AM, gio.cot wrote:
I'm try to use the example at
https://www.mcpressonline.com/index.php?option=com_content
<https://www.mcpressonline.com/index.php?option=com_content&view=article&id=
648> &view=article&id=648

for generating an Xml document; I have created my xml template .. but now
I have this problem : in some situation if the value that I have to put in
tag , is blank, I don't write the line with the tags (<mytag> </mytag>) ..
question how can solve it ? olny creating a record (/$Record) and inside the
RPG conditioning the WrtSection(' Record') or there are other ways ..

thanks in advance




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.