jstechg
jstechg

Reputation: 143

Is possible to customize rapidxml use of line breaks and tabs in a C++ application?

I am using rapidxml to generate an XML in a C ++ application:

    xml_document<> doc;
    xml_node<>* dec1 = doc.allocate_node(node_declaration);
    dec1->append_attribute(doc.allocate_attribute("version", "1.0"));
    dec1->append_attribute(doc.allocate_attribute("encoding", "utf-8"));
    doc.append_node(dec1);
    . . .

I convert this XML into a character string:

  std::string *s;
  s = new std::string;
  print(std::back_inserter(*s), doc, 0);

I then send it to a device as a byte array.

I see that the line breaks use the character 0x0A = 10 = "LF (new line)" and that in the indented lines it puts the character 0x09 = "horizontal tab".

I would need it to use instead:

Is it possible to configure rapidxml to do it this way?

Upvotes: 0

Views: 245

Answers (0)

Related Questions