× 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.



I add my hearty endorsement of CGIDEV2 for this - it's an ideal solution.

If your existing template has tags or markers for what has to be replaced, you might be able to use those when calling GetHTMLIFS - there are 4 more parameters to that function, to specify the opening and closing markers for the sections of the template and for the variables.

Briefly, sections are like record formats in display files - they can be written individually, like header and body and footer.

The variables are the markers for data you need to replace.

On the www.easy400.net site, which is where you get CGIDEV2 (and it's free) there are many articles and examples, I believe there is one specifically for writing to XML, but, as Charles says, that amounts to the same thing as writing to any file.

Good luck!
Vern

On 9/16/2015 9:20 AM, Charles Wilt wrote:
Yes,

You use the GetHTMLIFS() function to load your template like so:
GetHTMLIFS('/myfolder/mytemplate.html');

Now, you're going to have to modify the existing template to use CGIDEV2
compatible section names and replacement variables.

But that's a lot easier than trying to write the code to parse the document
yourself.

If you want more help with CGIDEV2, the WEB400 list
http://lists.midrange.com/mailman/listinfo/web400 is probably a better
choice. Since CGIDEV2 is designed for web enabling the IBM i. Also, the
offical support forum for CGIDEV2 is here:
https://groups.yahoo.com/neo/groups/Easy400Group/info

Charles



On Wed, Sep 16, 2015 at 10:05 AM, Programador IBMi <hn000246@xxxxxxxxx>
wrote:

Thanks Charles for your answer, but in my case I have to read an html
template created already in my ifs folder.
Works the same way?

Best Regards,


2015-09-16 8:02 GMT-06:00 Charles Wilt <charles.wilt@xxxxxxxxx>:

Easiest way to do this would be to use CGIDEV2..

CGIDEV2 has built in support of "merging" data into an existing HTML
template. Normally, that merged document would be sent out in response
to
an HTTP request. Luckily, CGIDEV2 has the functionality built in to
write
the updated document to an IFS file.

Here's a good article that discusses building XML docs with CGIDEV2 (HTML
would work the same, CGIDEV2 doesn't care what type of document it is)


http://www.ibmsystemsmag.com/ibmi/developer/rpg/Using-CGIDEV2-for-Generating-XML/
Charles

On Wed, Sep 16, 2015 at 9:50 AM, Programador IBMi <hn000246@xxxxxxxxx>
wrote:

Hello Everyone,
Hope this is the correct group to make this question.
I'm a rookie reading HTML files, but in this case I have to read an
HTML
template from IFS and replace values, then I have to send it by mail.
I would appreciate your help, some examples to learn how to do this.

Thanks guys, have a great day!!

Best Regards,

Mario Salgado
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




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.