1

Topic: To create html from , what methods?

(It is not assured that it is the correct forum, transfer, please if so) It is necessary to create   html a file. What beautiful methods are to create this from ? Thanks!

2

Re: To create html from , what methods?

Hello, gok, you wrote: gok> It is necessary to create   html a file. gok> what there are beautiful methods to create this from ? One of variants -  xml dataful and to set on it xslt.

3

Re: To create html from , what methods?

?

4

Re: To create html from , what methods?

Hello, tehKosh, you wrote: K> ? I create  dataful and a template to it.

5

Re: To create html from , what methods?

Hello, gok, you wrote: Doxygen can generate websites on the basis of the code. An example: here gok> It is necessary to create   html a file. gok> what there are beautiful methods to create this from ? gok> Thanks!

6

Re: To create html from , what methods?

Similar I not correctly understood a question.

7

Re: To create html from , what methods?

Hello, gok, you wrote: gok> What there are beautiful methods to create this from ? gok> Thanks! There is a template, then on it is set DOM-parser. For example COM-parser IID_IHTMLDocument2 under Windows or any libgdome

8

Re: To create html from , what methods?

Hello, gok, you wrote: gok> What there are beautiful methods to create this from ? fprintf (f, "<html>...");

9

Re: To create html from , what methods?

Hammer into Google c ++ html generator library shows many links on  select any

10

Re: To create html from , what methods?

Hello, V. Zudin, you wrote: SVZ> Hello, gok, you wrote: gok>> It is necessary to create   html a file. gok>> what there are beautiful methods to create this from ? SVZ> One of variants -  xml dataful and to set on it xslt. I.e. it is two files it is necessary to send to the user. And as though the data () and a template () to merge one (HTML)?

11

Re: To create html from , what methods?

Hello, kov_serg, you wrote: _> Hello, gok, you wrote: gok>> What there are beautiful methods to create this from ? _> _> fprintf (f, "<html>..."); _> it already was on one report. Other report, and if still  was required. It is boring to hammer in tags manually

12

Re: To create html from , what methods?

Hello, gok, you wrote: SVZ>> One of variants -  xml dataful and to set on it xslt. gok> i.e. it is two files it is necessary to send to the user. To send better ready result. gok> and as though the data () and a template () to merge one (HTML)? Somehow so (the code ancient as works I remember vaguely): Saved, depending on selected xslt, in csv, txt and html.//========================================================================== namespace xml {typedef MSXML2:: IXMLDOMDocument Document; typedef MSXML2:: IXMLDOMNode Node; typedef MSXML2:: IXMLDOMElement Element; typedef MSXML2:: IXMLDOMParseErrorPtr DOMParseErrorPtr; typedef MSXML2:: IXMLDOMElementPtr ElementPtr; typedef MSXML2:: IXMLDOMAttributePtr AttributePtr; typedef MSXML2:: IXMLDOMDocument2Ptr DocumentPtr;//====================================================================== DocumentPtr CreateDocument () {REFGUID clsid = __ uuidof (MSXML2:: DOMDocument60);//MSXML2:: DOMDocument); DocumentPtr document (clsid); return document;} //====================================================================== DOMParseErrorPtr LoadDocument (Document* document, LPCTSTR source) {document-> async = VARIANT_TRUE;//loading resources async. only! VARIANT_FALSE; document-> resolveExternals = VARIANT_FALSE; document-> validateOnParse = VARIANT_FALSE; document-> load (source); DOMParseErrorPtr domParseError = document-> parseError; return domParseError;}} Actually document creation: xml:: DocumentPtr m_xmldoc; CString m_targetFname, m_xslPath;...... try {//LOAD XSLT STYLE DOCUMENT xml:: DocumentPtr xsldoc = xml:: CreateDocument (); if (! xsldoc) {ASSERT (0);//Ku-ku, Grinja return false;} xml:: DOMParseErrorPtr parseError = xml:: LoadDocument (xsldoc, m_xslPath); if (parseError-> errorCode) {CString reason (LPCWSTR (parseError-> reason)); m_pimpl-> m_errString. Format (_T ("Failed to load document.\n%s"), reason. GetString ()); return false;} //SAVE XML FILE NEXT TO TARGET FILE CString xmlfname; xmlfname. Format (_T ("%s.xml"), m_targetFname. GetString ()); m_xmldoc-> save (_variant_t (xmlfname));//RUN XSLT TRANSFORMATION HRESULT hr = m_xmldoc-> setProperty (_bstr_t (_T ("AllowXsltScript")), _variant_t (true)); hr = xsldoc-> setProperty (_bstr_t (_T ("AllowXsltScript")), _variant_t (true)); _bstr_t retv = m_xmldoc-> transformNode (xsldoc); if (retv.length ()> 0) {CFile file (m_targetFname, CFile:: modeCreate | CFile:: modeWrite); file. Write (static_cast <const char *> (retv), retv.length ()); file. Close ();//SHOW RESULT:: ShellExecute (AfxGetMainWnd ()-> GetSafeHwnd (), _T ("open"), m_targetFname, NULL, NULL, SW_SHOW);} retval = true;//DONE!} catch (_com_error& ce) {}

13

Re: To create html from , what methods?

Hello, V. Zudin, you wrote: gok>> And as though the data () and a template () to merge one (HTML)? SVZ> Somehow so (the code ancient as works I remember vaguely): SVZ> Saved, depending on selected xslt, in csv, txt and html. I similar wrote about 15 years ago. sad Nevertheless  IMHO strongly it is better.  this XSLT - it unreadable. That is, any library which is able (on mustache there or still that) Here for example saw templates: https://github.com/pantor/inja json data; data ["name"] = "world"; inja:: render ("<h1> Hello {{name}}! </h1>", data);

14

Re: To create html from , what methods?

Hello, bnk, you wrote: SVZ>> Somehow so (the code ancient as works I remember vaguely): SVZ>> Saved, depending on selected xslt, in csv, txt and html. bnk> I similar wrote about 15 years ago. bnk> Nevertheless  IMHO strongly it is better.  this XSLT - it unreadable. . I wrote that code in 2011. Alas, I had a restriction - any indirect linguistic data bases, only standard means. And so existed and CrystalReports, and other tools, for certain above a roof. And now and for a long time.

15

Re: To create html from , what methods?

Hello, V. Zudin, you wrote: SVZ> Hello, gok, you wrote: SVZ>>> One of variants -  xml dataful and to set on it xslt. gok>> i.e. it is two files it is necessary to send to the user. SVZ> to send better ready result. gok>> and as though the data () and a template () to merge one (HTML)? SVZ> Somehow so (the code ancient as works I remember vaguely): SVZ> Saved, depending on selected xslt, in csv, txt and html. At me it turned out! Thanks for the help, Stanislav! I will try  as other colleague offered. It is not clear yet as  with it "communicates".

16

Re: To create html from , what methods?

Hello, bnk, you wrote: bnk> Hello, V. Zudin, you wrote: gok>>> And as though the data () and a template () to merge one (HTML)? SVZ>> Somehow so (the code ancient as works I remember vaguely): SVZ>> Saved, depending on selected xslt, in csv, txt and html. bnk> I similar wrote about 15 years ago. bnk> Nevertheless  IMHO strongly it is better.  this XSLT - it unreadable. bnk> that is, any library which is able (on mustache there or still that) bnk> Here for example saw templates: https://github.com/pantor/inja bnk> bnk> json data; bnk> data ["name"] = "world"; bnk> inja:: render ("<h1> Hello {{name}}! </h1>", data); bnk> it impresses: Returns "Hello world!" As it is all to organize for creation most ? (Only quitted on this track, )  inside ? , it is possible . The data too is strewed therefrom. render (.) Spits out the formatted line of the data on the gated in template (Returns "Hello world!") and how it now to interpose in  a file on an output? This sdk  vaguely reminds Something fprintf (f, "<html>..."); in

17

Re: To create html from , what methods?

Hello, bnk, you wrote: bnk> this Nafik XSLT - it unreadable. Someone of life does not think of a matter of habit without AWK, some bild-scripts  on it.

18

Re: To create html from , what methods?

Hello, gok, you wrote: gok> it impresses: Returns "Hello world!" gok> as it is all to organize for creation most ? (Only quitted on this track, ) gok> render (.) spits out the formatted line of the data on the gated in template (Returns "Hello world!") and how it now to interpose in  a file on an output? Well so in we wash an example above HTML. Should return "<h1> Hello world! </h1>" I would create a template file (on a disk, real HTML a file) therefore made a data structure just like, then render () gok> this sdk  vaguely reminds Something fprintf (f, "<html>..."); in  sad It it also is. Only parameters named. When than them there are more than two tens for example, c printf . Plus any lists normally, conditions there in a template are supported, object hierarchy (structured data that is) Generally the list  (template engine) is extensive enough. Here for example https://stackoverflow.com/questions/355 … or-library

19

Re: To create html from , what methods?

Hello, bnk, you wrote: bnk> Hello, gok, you wrote: gok>> it impresses: Returns "Hello world!" gok>> as it is all to organize for creation most ? (Only quitted on this track, ) gok>> render (.) spits out the formatted line of the data on the gated in template (Returns "Hello world!") and how it now to interpose in  a file on an output? bnk> well so in we wash an example above HTML. Should return "<h1> Hello world! </h1>" bnk> I would create a template file (on a disk, real HTML a file) therefore made a data structure just like, then render () gok>> this sdk  vaguely reminds Something fprintf (f, "<html>..." ); in  bnk> It it also is. Only parameters named. When than them there are more than two tens for example, c printf . bnk> Plus any lists normally, conditions there in a template are supported, object hierarchy (structured data that is) bnk> Generally the list  (template engine) is extensive enough. Here for example bnk> https://stackoverflow.com/questions/355 … or-library About, like reaches! In  the approach it is unnecessary ! It already inside  which reads out  with key , fills with their data and produces ready . Very interesting technology. Went to try.