---------------------------------------------------------------------------
| 219 | |
| 220 | //--------------------------------------------------------------------------- |
| 221 | string To_JSON_Attributes(Node& Cur_Node, const int& Level, bool Indent, bool Carriage_Returns) |
| 222 | { |
| 223 | string Result; |
| 224 | for (size_t Pos=0; Pos<Cur_Node.Attrs.size(); Pos++) |
| 225 | { |
| 226 | if (Cur_Node.Attrs[Pos].first.empty() || Cur_Node.Attrs[Pos].first.substr(0, 5)=="xmlns" || Cur_Node.Attrs[Pos].first.substr(0, 3)=="xsi") |
| 227 | continue; |
| 228 | |
| 229 | Result+=(Carriage_Returns?("\n"+(Indent?string(Level, '\t'):string())):string())+"\"@"+Cur_Node.Attrs[Pos].first+(Carriage_Returns?"\": \"":"\":\"") |
| 230 | +JSON_Encode(Cur_Node.Attrs[Pos].second)+"\""; |
| 231 | |
| 232 | if (Pos<Cur_Node.Attrs.size()-1 || Cur_Node.Value.size() || Cur_Node.Childs.size()) |
| 233 | Result+=","; |
| 234 | } |
| 235 | Cur_Node.Attrs.clear(); //Free memory |
| 236 | |
| 237 | return Result; |
| 238 | } |
| 239 | |
| 240 | //--------------------------------------------------------------------------- |
| 241 | string To_JSON_Elements(Node& Cur_Node, const int& Level, bool Indent, bool Carriage_Returns) |
no test coverage detected