93 struct soap *ctx = soap_new1(SOAP_XML_INDENT);
100 for (
int i = 0; i < 4; ++i)
102 Graph *branch = soap_new_Graph(ctx);
103 tree.edges.push_back(branch);
105 for (
int j = 0; j < i; ++j)
106 branch->edges.push_back(soap_new_Graph(ctx));
109 std::cout <<
"**** XML TREE FROM C++ TREE ****" << std::endl;
110 soap_write_Graph(ctx, &tree);
111 std::cout << std::endl << std::endl;
113 std::cout <<
"**** XML TREE FROM C++ DIGRAPH ****" << std::endl;
114 tree.edges[0] = tree.edges[1];
115 tree.edges[2] = tree.edges[3];
116 soap_write_Graph(ctx, &tree);
117 std::cout << std::endl << std::endl;
119 std::cout <<
"**** XML ID-REF DIGRAPH FROM C++ DIGRAPH ****" << std::endl;
120 soap_set_omode(ctx, SOAP_XML_GRAPH);
121 soap_write_Graph(ctx, &tree);
122 std::cout << std::endl << std::endl;
123 soap_clr_omode(ctx, SOAP_XML_GRAPH);
125 std::cout <<
"**** XML ID-REF DIGRAPH FROM C++ CYCLIC GRAPH ****" << std::endl;
126 tree.edges[0]->edges = tree.edges;
127 soap_set_omode(ctx, SOAP_XML_GRAPH);
128 soap_write_Graph(ctx, &tree);
129 std::cout << std::endl << std::endl;
130 soap_clr_omode(ctx, SOAP_XML_GRAPH);
132 std::cout <<
"**** XML TREE (PRUNED CYCLIC BRANCHES) FROM C++ CYCLIC GRAPH ****" << std::endl;
133 soap_set_omode(ctx, SOAP_XML_TREE);
134 soap_write_Graph(ctx, &tree);
135 std::cout << std::endl << std::endl;
136 soap_clr_omode(ctx, SOAP_XML_TREE);
138 std::cout <<
"**** SOAP 1.1 ENCODED GRAPH FROM C++ CYCLIC GRAPH ****" << std::endl;
140 soap_set_version(ctx, 1);
141 ctx->encodingStyle =
"";
142 soap_write_Graph(ctx, &tree);
143 std::cout << std::endl << std::endl;
145 std::cout <<
"**** SOAP 1.2 ENCODED GRAPH FROM C++ CYCLIC GRAPH ****" << std::endl;
147 soap_set_version(ctx, 2);
148 ctx->encodingStyle =
"";
149 soap_write_Graph(ctx, &tree);
150 std::cout << std::endl << std::endl;