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,""");
22 QString quoteUmlaut(const QString &s)
26 r.replace ( rx,"ü");
28 r.replace ( rx,"Ü");
30 r.replace ( rx,"ö");
32 r.replace ( rx,"Ö");
34 r.replace ( rx,"ä");
36 r.replace ( rx,"Ä");
38 r.replace ( rx,"ß");
40 r.replace ( rx,"€");
47 int XMLObj::actindent=0; // make instance of actindent
60 QString XMLObj::singleElement(QString s, QString at)
62 return indent() + "<" + s +" " + at +" " + "/>\n";
66 QString XMLObj::beginElement(QString s)
68 return indent() + "<" + s + ">\n";
72 QString XMLObj::beginElement(QString s, QString at)
74 return indent() + "<" + s + " " + at + ">\n";
78 QString XMLObj::endElement(QString s)
80 return indent() + "</" + s + ">\n";
84 QString XMLObj::attribut(QString at, QString val)
86 return " " + at + "=\"" + quotemeta (val) + "\"";
89 // returns <s> val </s>
90 QString XMLObj::valueElement(QString el, QString val)
92 return indent() + "<" + el + ">" + quotemeta(val) + "</" +el + ">\n";
95 // returns <s at> val </s>
96 QString XMLObj::valueElement(QString el, QString val, QString at)
98 return indent() + "<" + el + " " + at + ">" + quotemeta(val) + "</" +el + ">\n";
101 void XMLObj::incIndent()
106 void XMLObj::decIndent()
109 if (actindent<0) actindent=0;
112 QString XMLObj::indent()
116 for (i=0; i<actindent*indentwidth; i++)