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
37 QString XMLObj::singleElement(QString s, QString at)
39 return indent() + "<" + s +" " + at +" " + "/>\n";
43 QString XMLObj::beginElement(QString s)
45 return indent() + "<" + s + ">\n";
49 QString XMLObj::beginElement(QString s, QString at)
51 return indent() + "<" + s + " " + at + ">\n";
55 QString XMLObj::endElement(QString s)
57 return indent() + "</" + s + ">\n";
61 QString XMLObj::attribut(QString at, QString val)
63 return " " + at + "=\"" + quotemeta (val) + "\"";
66 // returns <s> val </s>
67 QString XMLObj::valueElement(QString el, QString val)
69 return indent() + "<" + el + ">" + quotemeta(val) + "</" +el + ">\n";
72 // returns <s at> val </s>
73 QString XMLObj::valueElement(QString el, QString val, QString at)
75 return indent() + "<" + el + " " + at + ">" + quotemeta(val) + "</" +el + ">\n";
78 void XMLObj::incIndent()
83 void XMLObj::decIndent()
86 if (actindent<0) actindent=0;
89 QString XMLObj::indent()
93 for (i=0; i<actindent*indentwidth; i++)