✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python27/share/doc/alt-python27-libxml2-devel/examples//tree2.c
/* 
 * section:  Tree
 * synopsis: Creates a tree
 * purpose:  Shows how to create document, nodes and dump it to stdout or file.
 * usage:    tree2 <filename>  -Default output: stdout
 * test:     tree2 > tree2.tmp && diff tree2.tmp $(srcdir)/tree2.res
 * author:   Lucas Brasilino <brasilino@recife.pe.gov.br>
 * copy:     see Copyright for the status of this software
 */

#include <stdio.h>
#include <libxml/parser.h>
#include <libxml/tree.h>

#if defined(LIBXML_TREE_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)

/*
 *To compile this file using gcc you can type
 *gcc `xml2-config --cflags --libs` -o tree2 tree2.c
 */

/* A simple example how to create DOM. Libxml2 automagically 
 * allocates the necessary amount of memory to it.
*/
int
main(int argc, char **argv)
{
    xmlDocPtr doc = NULL;       /* document pointer */
    xmlNodePtr root_node = NULL, node = NULL, node1 = NULL;/* node pointers */
    xmlDtdPtr dtd = NULL;       /* DTD pointer */
    char buff[256];
    int i, j;

    LIBXML_TEST_VERSION;

    /* 
     * Creates a new document, a node and set it as a root node
     */
    doc = xmlNewDoc(BAD_CAST "1.0");
    root_node = xmlNewNode(NULL, BAD_CAST "root");
    xmlDocSetRootElement(doc, root_node);

    /*
     * Creates a DTD declaration. Isn't mandatory. 
     */
    dtd = xmlCreateIntSubset(doc, BAD_CAST "root", NULL, BAD_CAST "tree2.dtd");

    /* 
     * xmlNewChild() creates a new node, which is "attached" as child node
     * of root_node node. 
     */
    xmlNewChild(root_node, NULL, BAD_CAST "node1",
                BAD_CAST "content of node 1");
    /* 
     * The same as above, but the new child node doesn't have a content 
     */
    xmlNewChild(root_node, NULL, BAD_CAST "node2", NULL);

    /* 
     * xmlNewProp() creates attributes, which is "attached" to an node.
     * It returns xmlAttrPtr, which isn't used here.
     */
    node =
        xmlNewChild(root_node, NULL, BAD_CAST "node3",
                    BAD_CAST "this node has attributes");
    xmlNewProp(node, BAD_CAST "attribute", BAD_CAST "yes");
    xmlNewProp(node, BAD_CAST "foo", BAD_CAST "bar");

    /*
     * Here goes another way to create nodes. xmlNewNode() and xmlNewText
     * creates a node and a text node separately. They are "attached"
     * by xmlAddChild() 
     */
    node = xmlNewNode(NULL, BAD_CAST "node4");
    node1 = xmlNewText(BAD_CAST
                   "other way to create content (which is also a node)");
    xmlAddChild(node, node1);
    xmlAddChild(root_node, node);

    /* 
     * A simple loop that "automates" nodes creation 
     */
    for (i = 5; i < 7; i++) {
        sprintf(buff, "node%d", i);
        node = xmlNewChild(root_node, NULL, BAD_CAST buff, NULL);
        for (j = 1; j < 4; j++) {
            sprintf(buff, "node%d%d", i, j);
            node1 = xmlNewChild(node, NULL, BAD_CAST buff, NULL);
            xmlNewProp(node1, BAD_CAST "odd", BAD_CAST((j % 2) ? "no" : "yes"));
        }
    }

    /* 
     * Dumping document to stdio or file
     */
    xmlSaveFormatFileEnc(argc > 1 ? argv[1] : "-", doc, "UTF-8", 1);

    /*free the document */
    xmlFreeDoc(doc);

    /*
     *Free the global variables that may
     *have been allocated by the parser.
     */
    xmlCleanupParser();

    /*
     * this is to debug memory for regression tests
     */
    xmlMemoryDump();
    return(0);
}
#else
int main(void) {
    fprintf(stderr, "tree support not compiled in\n");
    exit(1);
}
#endif


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jul 2024 8.44 AM
root / linksafe
0755
Makefile.am
3.974 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
Makefile.in
32.153 KB
16 Oct 2014 7.35 AM
root / linksafe
0644
examples.xml
31.409 KB
16 Oct 2014 7.30 AM
root / linksafe
0644
examples.xsl
7.063 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
index.html
32.148 KB
16 Oct 2014 7.30 AM
root / linksafe
0644
index.py
8.949 KB
3 Oct 2014 9.00 AM
root / linksafe
0755
io1.c
3.665 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
io1.res
0.201 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
io2.c
1.154 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
io2.res
0.042 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
parse1.c
1.27 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
parse2.c
1.921 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
parse3.c
1.471 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
parse4.c
3.462 KB
16 Oct 2014 4.13 AM
root / linksafe
0644
reader1.c
2.471 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
reader1.res
0.146 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
reader2.c
3.06 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
reader3.c
2.878 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
reader3.res
0.352 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
reader4.c
3.055 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
reader4.res
0.07 KB
17 Aug 2012 1.10 AM
root / linksafe
0644
test1.xml
0.007 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
test2.xml
0.222 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
test3.xml
0.813 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
testWriter.c
37.507 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
tree1.c
2.192 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
tree1.res
0.118 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
tree2.c
3.39 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
tree2.res
0.442 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
tst.xml
0.089 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
writer.xml
0.531 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
xpath1.c
6.469 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
xpath1.res
0.111 KB
30 Jul 2009 3.24 PM
root / linksafe
0644
xpath2.c
5.205 KB
3 Oct 2014 9.00 AM
root / linksafe
0644
xpath2.res
0.739 KB
30 Jul 2009 3.24 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF