bosko lekovic
/
ETHtoCOM_10
nova verzija tcp+udp->serial com
doHTML.cpp@2:45b351b4fc2a, 2020-04-05 (annotated)
- Committer:
- bosko001
- Date:
- Sun Apr 05 12:56:41 2020 +0000
- Revision:
- 2:45b351b4fc2a
- Child:
- 3:1196befeace0
n0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bosko001 | 2:45b351b4fc2a | 1 | |
bosko001 | 2:45b351b4fc2a | 2 | #include "string.h" |
bosko001 | 2:45b351b4fc2a | 3 | #include "dxml.h" |
bosko001 | 2:45b351b4fc2a | 4 | |
bosko001 | 2:45b351b4fc2a | 5 | #include "doHTML.h" |
bosko001 | 2:45b351b4fc2a | 6 | |
bosko001 | 2:45b351b4fc2a | 7 | #include "HTMLpage.h" |
bosko001 | 2:45b351b4fc2a | 8 | |
bosko001 | 2:45b351b4fc2a | 9 | |
bosko001 | 2:45b351b4fc2a | 10 | char* p_HTMLpage; |
bosko001 | 2:45b351b4fc2a | 11 | dxml_t p_rootHTML; |
bosko001 | 2:45b351b4fc2a | 12 | |
bosko001 | 2:45b351b4fc2a | 13 | |
bosko001 | 2:45b351b4fc2a | 14 | void inic_html( void ) |
bosko001 | 2:45b351b4fc2a | 15 | { |
bosko001 | 2:45b351b4fc2a | 16 | |
bosko001 | 2:45b351b4fc2a | 17 | p_HTMLpage = (char*)malloc(sizeof(HTMLpage)); |
bosko001 | 2:45b351b4fc2a | 18 | strcpy( p_HTMLpage, HTMLpage); |
bosko001 | 2:45b351b4fc2a | 19 | |
bosko001 | 2:45b351b4fc2a | 20 | p_rootHTML = dxml_parse_str(p_HTMLpage, strlen(p_HTMLpage)); |
bosko001 | 2:45b351b4fc2a | 21 | |
bosko001 | 2:45b351b4fc2a | 22 | auto body = dxml_child(p_rootHTML, "body"); |
bosko001 | 2:45b351b4fc2a | 23 | auto form = dxml_child(body, "form"); |
bosko001 | 2:45b351b4fc2a | 24 | auto table = dxml_child(form, "table"); |
bosko001 | 2:45b351b4fc2a | 25 | auto tr = dxml_child(table, "tr"); |
bosko001 | 2:45b351b4fc2a | 26 | auto td = dxml_child(tr, "td"); |
bosko001 | 2:45b351b4fc2a | 27 | auto input = dxml_child(td, "input"); |
bosko001 | 2:45b351b4fc2a | 28 | |
bosko001 | 2:45b351b4fc2a | 29 | dxml_set_attr(input, "value", "dragomir"); |
bosko001 | 2:45b351b4fc2a | 30 | } |
bosko001 | 2:45b351b4fc2a | 31 | |
bosko001 | 2:45b351b4fc2a | 32 | char *getHTML_free( void ) |
bosko001 | 2:45b351b4fc2a | 33 | { |
bosko001 | 2:45b351b4fc2a | 34 | return dxml_toxml(p_rootHTML); |
bosko001 | 2:45b351b4fc2a | 35 | } |
bosko001 | 2:45b351b4fc2a | 36 | |
bosko001 | 2:45b351b4fc2a | 37 | |
bosko001 | 2:45b351b4fc2a | 38 |