7 // returns masked "<" ">" "&"
8 QString quotemeta(const QString &s)
11 QRegExp rx("&(?!amp;)");
12 r.replace ( rx,"&");
14 r.replace ( rx,">");
16 r.replace ( rx,"<");
18 r.replace ( rx,""");
24 int XMLObj::actindent=0; // make instance of actindent
33 QString XMLObj::singleElement(QString s, QString at)
35 return indent() + "<" + s +" " + at +" " + "/>\n";
39 QString XMLObj::beginElement(QString s)
41 return indent() + "<" + s + ">\n";
45 QString XMLObj::beginElement(QString s, QString at)
47 return indent() + "<" + s + " " + at + ">\n";
51 QString XMLObj::endElement(QString s)
53 return indent() + "</" + s + ">\n";
57 QString XMLObj::attribut(QString at, QString val)
59 return " " + at + "=\"" + quotemeta (val) + "\"";
62 // returns <s> val </s>
63 QString XMLObj::valueElement(QString el, QString val)
65 return indent() + "<" + el + ">" + quotemeta(val) + "</" +el + ">\n";
68 // returns <s at> val </s>
69 QString XMLObj::valueElement(QString el, QString val, QString at)
71 return indent() + "<" + el + " " + at + ">" + quotemeta(val) + "</" +el + ">\n";
74 void XMLObj::incIndent()
79 void XMLObj::decIndent()
82 if (actindent<0) actindent=0;
85 QString XMLObj::indent()
89 for (i=0; i<actindent*indentwidth; i++)