@@ -8,7 +8,7 @@ private class TXmlLocatable =
88 @xmldtd or @xmlelement or @xmlattribute or @xmlnamespace or @xmlcomment or @xmlcharacters;
99
1010/** An XML element that has a location. */
11- class XMLLocatable extends @xmllocatable, TXmlLocatable {
11+ class XmlLocatable extends @xmllocatable, TXmlLocatable {
1212 /** Gets the source location for this element. */
1313 Location getLocation ( ) { xmllocations ( this , result ) }
1414
@@ -32,13 +32,16 @@ class XMLLocatable extends @xmllocatable, TXmlLocatable {
3232 string toString ( ) { none ( ) } // overridden in subclasses
3333}
3434
35+ /** DEPRECATED: Alias for XmlLocatable */
36+ deprecated class XMLLocatable = XmlLocatable ;
37+
3538/**
36- * An `XMLParent ` is either an `XMLElement ` or an `XMLFile `,
39+ * An `XmlParent ` is either an `XmlElement ` or an `XmlFile `,
3740 * both of which can contain other elements.
3841 */
39- class XMLParent extends @xmlparent {
40- XMLParent ( ) {
41- // explicitly restrict `this` to be either an `XMLElement ` or an `XMLFile `;
42+ class XmlParent extends @xmlparent {
43+ XmlParent ( ) {
44+ // explicitly restrict `this` to be either an `XmlElement ` or an `XmlFile `;
4245 // the type `@xmlparent` currently also includes non-XML files
4346 this instanceof @xmlelement or xmlEncoding ( this , _)
4447 }
@@ -50,28 +53,28 @@ class XMLParent extends @xmlparent {
5053 string getName ( ) { none ( ) } // overridden in subclasses
5154
5255 /** Gets the file to which this XML parent belongs. */
53- XMLFile getFile ( ) { result = this or xmlElements ( this , _, _, _, result ) }
56+ XmlFile getFile ( ) { result = this or xmlElements ( this , _, _, _, result ) }
5457
5558 /** Gets the child element at a specified index of this XML parent. */
56- XMLElement getChild ( int index ) { xmlElements ( result , _, this , index , _) }
59+ XmlElement getChild ( int index ) { xmlElements ( result , _, this , index , _) }
5760
5861 /** Gets a child element of this XML parent. */
59- XMLElement getAChild ( ) { xmlElements ( result , _, this , _, _) }
62+ XmlElement getAChild ( ) { xmlElements ( result , _, this , _, _) }
6063
6164 /** Gets a child element of this XML parent with the given `name`. */
62- XMLElement getAChild ( string name ) { xmlElements ( result , _, this , _, _) and result .hasName ( name ) }
65+ XmlElement getAChild ( string name ) { xmlElements ( result , _, this , _, _) and result .hasName ( name ) }
6366
6467 /** Gets a comment that is a child of this XML parent. */
65- XMLComment getAComment ( ) { xmlComments ( result , _, this , _) }
68+ XmlComment getAComment ( ) { xmlComments ( result , _, this , _) }
6669
6770 /** Gets a character sequence that is a child of this XML parent. */
68- XMLCharacters getACharactersSet ( ) { xmlChars ( result , _, this , _, _, _) }
71+ XmlCharacters getACharactersSet ( ) { xmlChars ( result , _, this , _, _, _) }
6972
70- /** Gets the depth in the tree. (Overridden in XMLElement .) */
73+ /** Gets the depth in the tree. (Overridden in XmlElement .) */
7174 int getDepth ( ) { result = 0 }
7275
7376 /** Gets the number of child XML elements of this XML parent. */
74- int getNumberOfChildren ( ) { result = count ( XMLElement e | xmlElements ( e , _, this , _, _) ) }
77+ int getNumberOfChildren ( ) { result = count ( XmlElement e | xmlElements ( e , _, this , _, _) ) }
7578
7679 /** Gets the number of places in the body of this XML parent where text occurs. */
7780 int getNumberOfCharacterSets ( ) { result = count ( int pos | xmlChars ( _, _, this , pos , _, _) ) }
@@ -92,9 +95,12 @@ class XMLParent extends @xmlparent {
9295 string toString ( ) { result = this .getName ( ) }
9396}
9497
98+ /** DEPRECATED: Alias for XmlParent */
99+ deprecated class XMLParent = XmlParent ;
100+
95101/** An XML file. */
96- class XMLFile extends XMLParent , File {
97- XMLFile ( ) { xmlEncoding ( this , _) }
102+ class XmlFile extends XmlParent , File {
103+ XmlFile ( ) { xmlEncoding ( this , _) }
98104
99105 /** Gets a printable representation of this XML file. */
100106 override string toString ( ) { result = this .getName ( ) }
@@ -120,15 +126,18 @@ class XMLFile extends XMLParent, File {
120126 string getEncoding ( ) { xmlEncoding ( this , result ) }
121127
122128 /** Gets the XML file itself. */
123- override XMLFile getFile ( ) { result = this }
129+ override XmlFile getFile ( ) { result = this }
124130
125131 /** Gets a top-most element in an XML file. */
126- XMLElement getARootElement ( ) { result = this .getAChild ( ) }
132+ XmlElement getARootElement ( ) { result = this .getAChild ( ) }
127133
128134 /** Gets a DTD associated with this XML file. */
129- XMLDTD getADTD ( ) { xmlDTDs ( result , _, _, _, this ) }
135+ XmlDTD getADTD ( ) { xmlDTDs ( result , _, _, _, this ) }
130136}
131137
138+ /** DEPRECATED: Alias for XmlFile */
139+ deprecated class XMLFile = XmlFile ;
140+
132141/**
133142 * An XML document type definition (DTD).
134143 *
@@ -140,7 +149,7 @@ class XMLFile extends XMLParent, File {
140149 * <!ELEMENT lastName (#PCDATA)>
141150 * ```
142151 */
143- class XMLDTD extends XMLLocatable , @xmldtd {
152+ class XmlDTD extends XmlLocatable , @xmldtd {
144153 /** Gets the name of the root element of this DTD. */
145154 string getRoot ( ) { xmlDTDs ( this , result , _, _, _) }
146155
@@ -154,7 +163,7 @@ class XMLDTD extends XMLLocatable, @xmldtd {
154163 predicate isPublic ( ) { not xmlDTDs ( this , _, "" , _, _) }
155164
156165 /** Gets the parent of this DTD. */
157- XMLParent getParent ( ) { xmlDTDs ( this , _, _, _, result ) }
166+ XmlParent getParent ( ) { xmlDTDs ( this , _, _, _, result ) }
158167
159168 override string toString ( ) {
160169 this .isPublic ( ) and
@@ -165,6 +174,9 @@ class XMLDTD extends XMLLocatable, @xmldtd {
165174 }
166175}
167176
177+ /** DEPRECATED: Alias for XmlDTD */
178+ deprecated class XMLDTD = XmlDTD ;
179+
168180/**
169181 * An XML element in an XML file.
170182 *
@@ -176,18 +188,18 @@ class XMLDTD extends XMLLocatable, @xmldtd {
176188 * </manifest>
177189 * ```
178190 */
179- class XMLElement extends @xmlelement, XMLParent , XMLLocatable {
191+ class XmlElement extends @xmlelement, XmlParent , XmlLocatable {
180192 /** Holds if this XML element has the given `name`. */
181193 predicate hasName ( string name ) { name = this .getName ( ) }
182194
183195 /** Gets the name of this XML element. */
184196 override string getName ( ) { xmlElements ( this , result , _, _, _) }
185197
186198 /** Gets the XML file in which this XML element occurs. */
187- override XMLFile getFile ( ) { xmlElements ( this , _, _, _, result ) }
199+ override XmlFile getFile ( ) { xmlElements ( this , _, _, _, result ) }
188200
189201 /** Gets the parent of this XML element. */
190- XMLParent getParent ( ) { xmlElements ( this , _, result , _, _) }
202+ XmlParent getParent ( ) { xmlElements ( this , _, result , _, _) }
191203
192204 /** Gets the index of this XML element among its parent's children. */
193205 int getIndex ( ) { xmlElements ( this , _, _, result , _) }
@@ -196,7 +208,7 @@ class XMLElement extends @xmlelement, XMLParent, XMLLocatable {
196208 predicate hasNamespace ( ) { xmlHasNs ( this , _, _) }
197209
198210 /** Gets the namespace of this XML element, if any. */
199- XMLNamespace getNamespace ( ) { xmlHasNs ( this , result , _) }
211+ XmlNamespace getNamespace ( ) { xmlHasNs ( this , result , _) }
200212
201213 /** Gets the index of this XML element among its parent's children. */
202214 int getElementPositionIndex ( ) { xmlElements ( this , _, _, result , _) }
@@ -205,10 +217,10 @@ class XMLElement extends @xmlelement, XMLParent, XMLLocatable {
205217 override int getDepth ( ) { result = this .getParent ( ) .getDepth ( ) + 1 }
206218
207219 /** Gets an XML attribute of this XML element. */
208- XMLAttribute getAnAttribute ( ) { result .getElement ( ) = this }
220+ XmlAttribute getAnAttribute ( ) { result .getElement ( ) = this }
209221
210222 /** Gets the attribute with the specified `name`, if any. */
211- XMLAttribute getAttribute ( string name ) { result .getElement ( ) = this and result .getName ( ) = name }
223+ XmlAttribute getAttribute ( string name ) { result .getElement ( ) = this and result .getName ( ) = name }
212224
213225 /** Holds if this XML element has an attribute with the specified `name`. */
214226 predicate hasAttribute ( string name ) { exists ( this .getAttribute ( name ) ) }
@@ -220,6 +232,9 @@ class XMLElement extends @xmlelement, XMLParent, XMLLocatable {
220232 override string toString ( ) { result = this .getName ( ) }
221233}
222234
235+ /** DEPRECATED: Alias for XmlElement */
236+ deprecated class XMLElement = XmlElement ;
237+
223238/**
224239 * An attribute that occurs inside an XML element.
225240 *
@@ -230,18 +245,18 @@ class XMLElement extends @xmlelement, XMLParent, XMLLocatable {
230245 * android:versionCode="1"
231246 * ```
232247 */
233- class XMLAttribute extends @xmlattribute, XMLLocatable {
248+ class XmlAttribute extends @xmlattribute, XmlLocatable {
234249 /** Gets the name of this attribute. */
235250 string getName ( ) { xmlAttrs ( this , _, result , _, _, _) }
236251
237252 /** Gets the XML element to which this attribute belongs. */
238- XMLElement getElement ( ) { xmlAttrs ( this , result , _, _, _, _) }
253+ XmlElement getElement ( ) { xmlAttrs ( this , result , _, _, _, _) }
239254
240255 /** Holds if this attribute has a namespace. */
241256 predicate hasNamespace ( ) { xmlHasNs ( this , _, _) }
242257
243258 /** Gets the namespace of this attribute, if any. */
244- XMLNamespace getNamespace ( ) { xmlHasNs ( this , result , _) }
259+ XmlNamespace getNamespace ( ) { xmlHasNs ( this , result , _) }
245260
246261 /** Gets the value of this attribute. */
247262 string getValue ( ) { xmlAttrs ( this , _, _, result , _, _) }
@@ -250,6 +265,9 @@ class XMLAttribute extends @xmlattribute, XMLLocatable {
250265 override string toString ( ) { result = this .getName ( ) + "=" + this .getValue ( ) }
251266}
252267
268+ /** DEPRECATED: Alias for XmlAttribute */
269+ deprecated class XMLAttribute = XmlAttribute ;
270+
253271/**
254272 * A namespace used in an XML file.
255273 *
@@ -259,7 +277,7 @@ class XMLAttribute extends @xmlattribute, XMLLocatable {
259277 * xmlns:android="http://schemas.android.com/apk/res/android"
260278 * ```
261279 */
262- class XMLNamespace extends XMLLocatable , @xmlnamespace {
280+ class XmlNamespace extends XmlLocatable , @xmlnamespace {
263281 /** Gets the prefix of this namespace. */
264282 string getPrefix ( ) { xmlNs ( this , result , _, _) }
265283
@@ -276,6 +294,9 @@ class XMLNamespace extends XMLLocatable, @xmlnamespace {
276294 }
277295}
278296
297+ /** DEPRECATED: Alias for XmlNamespace */
298+ deprecated class XMLNamespace = XmlNamespace ;
299+
279300/**
280301 * A comment in an XML file.
281302 *
@@ -285,17 +306,20 @@ class XMLNamespace extends XMLLocatable, @xmlnamespace {
285306 * <!-- This is a comment. -->
286307 * ```
287308 */
288- class XMLComment extends @xmlcomment, XMLLocatable {
309+ class XmlComment extends @xmlcomment, XmlLocatable {
289310 /** Gets the text content of this XML comment. */
290311 string getText ( ) { xmlComments ( this , result , _, _) }
291312
292313 /** Gets the parent of this XML comment. */
293- XMLParent getParent ( ) { xmlComments ( this , _, result , _) }
314+ XmlParent getParent ( ) { xmlComments ( this , _, result , _) }
294315
295316 /** Gets a printable representation of this XML comment. */
296317 override string toString ( ) { result = this .getText ( ) }
297318}
298319
320+ /** DEPRECATED: Alias for XmlComment */
321+ deprecated class XMLComment = XmlComment ;
322+
299323/**
300324 * A sequence of characters that occurs between opening and
301325 * closing tags of an XML element, excluding other elements.
@@ -306,16 +330,19 @@ class XMLComment extends @xmlcomment, XMLLocatable {
306330 * <content>This is a sequence of characters.</content>
307331 * ```
308332 */
309- class XMLCharacters extends @xmlcharacters, XMLLocatable {
333+ class XmlCharacters extends @xmlcharacters, XmlLocatable {
310334 /** Gets the content of this character sequence. */
311335 string getCharacters ( ) { xmlChars ( this , result , _, _, _, _) }
312336
313337 /** Gets the parent of this character sequence. */
314- XMLParent getParent ( ) { xmlChars ( this , _, result , _, _, _) }
338+ XmlParent getParent ( ) { xmlChars ( this , _, result , _, _, _) }
315339
316340 /** Holds if this character sequence is CDATA. */
317341 predicate isCDATA ( ) { xmlChars ( this , _, _, _, 1 , _) }
318342
319343 /** Gets a printable representation of this XML character sequence. */
320344 override string toString ( ) { result = this .getCharacters ( ) }
321345}
346+
347+ /** DEPRECATED: Alias for XmlCharacters */
348+ deprecated class XMLCharacters = XmlCharacters ;
0 commit comments