@@ -86,7 +86,7 @@ name(a::XMLAttr) = bytestring(a._struct.name)
86
86
87
87
function value (a:: XMLAttr )
88
88
pct = ccall (xmlNodeGetContent, Xstr, (Xptr,), a. _struct. children)
89
- (pct != nullptr ? _xcopystr (pct) : " " ):: ASCIIString
89
+ (pct != nullptr ? _xcopystr (pct) : " " ):: String
90
90
end
91
91
92
92
# iterations
@@ -160,7 +160,7 @@ child_nodes(nd::XMLNode) = XMLNodeIter(nd._struct.children)
160
160
161
161
function content (nd:: XMLNode )
162
162
pct = ccall (xmlNodeGetContent, Xstr, (Xptr,), nd. ptr)
163
- (pct != nullptr ? _xcopystr (pct) : " " ):: ASCIIString
163
+ (pct != nullptr ? _xcopystr (pct) : " " ):: String
164
164
end
165
165
166
166
# dumping
@@ -211,7 +211,7 @@ Base.show(io::IO, x::XMLElement) = Base.show(x.node)
211
211
212
212
# attribute access
213
213
214
- function attribute (x:: XMLElement , name:: ASCIIString ; required:: Bool = false )
214
+ function attribute (x:: XMLElement , name:: String ; required:: Bool = false )
215
215
pv = ccall (xmlGetProp, Xstr, (Xptr, Xstr), x. node. ptr, name)
216
216
if pv != nullptr
217
217
return _xcopystr (pv)
@@ -224,7 +224,7 @@ function attribute(x::XMLElement, name::ASCIIString; required::Bool=false)
224
224
end
225
225
end
226
226
227
- function has_attribute (x:: XMLElement , name:: ASCIIString )
227
+ function has_attribute (x:: XMLElement , name:: String )
228
228
p = ccall (xmlHasProp, Xptr, (Xptr, Xstr), x. node. ptr, name)
229
229
return p != nullptr
230
230
end
@@ -235,7 +235,7 @@ attributes(x::XMLElement) = XMLAttrIter(x.node._struct.attrs)
235
235
function attributes_dict (x:: XMLElement )
236
236
# make an dictionary based on attributes
237
237
238
- dct = (ASCIIString => ASCIIString )[]
238
+ dct = (String => String )[]
239
239
if has_attributes (x)
240
240
for a in attributes (x)
241
241
dct[name (a)] = value (a)
@@ -259,7 +259,7 @@ child_elements(x::XMLElement) = XMLElementIter(x.node.ptr)
259
259
260
260
# elements by tag name
261
261
262
- function find_element (x:: XMLElement , n:: ASCIIString )
262
+ function find_element (x:: XMLElement , n:: String )
263
263
for c in child_elements (x)
264
264
if name (c) == n
265
265
return c
@@ -268,7 +268,7 @@ function find_element(x::XMLElement, n::ASCIIString)
268
268
return nothing
269
269
end
270
270
271
- function get_elements_by_tagname (x:: XMLElement , n:: ASCIIString )
271
+ function get_elements_by_tagname (x:: XMLElement , n:: String )
272
272
lst = Array (XMLElement, 0 )
273
273
for c in child_elements (x)
274
274
if name (c) == n
285
285
#
286
286
# ######################################
287
287
288
- function new_element (name:: ASCIIString )
288
+ function new_element (name:: String )
289
289
p = ccall (xmlNewNode, Xptr, (Xptr, Xstr), nullptr, name)
290
290
XMLElement (p)
291
291
end
@@ -297,25 +297,25 @@ end
297
297
298
298
add_child (xparent:: XMLElement , xchild:: XMLElement ) = add_child (xparent, xchild. node)
299
299
300
- function new_child (xparent:: XMLElement , name:: ASCIIString )
300
+ function new_child (xparent:: XMLElement , name:: String )
301
301
xc = new_element (name)
302
302
add_child (xparent, xc)
303
303
return xc
304
304
end
305
305
306
- function new_textnode (txt:: ASCIIString )
306
+ function new_textnode (txt:: String )
307
307
p = ccall (xmlNewText, Xptr, (Xstr,), txt)
308
308
XMLNode (p)
309
309
end
310
310
311
- add_text (x:: XMLElement , txt:: ASCIIString ) = add_child (x, new_textnode (txt))
311
+ add_text (x:: XMLElement , txt:: String ) = add_child (x, new_textnode (txt))
312
312
313
- function set_attribute (x:: XMLElement , name:: ASCIIString , val:: ASCIIString )
313
+ function set_attribute (x:: XMLElement , name:: String , val:: String )
314
314
a = ccall (xmlSetProp, Xptr, (Xptr, Xstr, Xstr), x. node. ptr, name, val)
315
315
return XMLAttr (a)
316
316
end
317
317
318
- set_attribute (x:: XMLElement , name:: ASCIIString , val) = set_attribute (x, name, string (val))
318
+ set_attribute (x:: XMLElement , name:: String , val) = set_attribute (x, name, string (val))
319
319
320
320
function set_attributes {P<:NTuple{2}} (x:: XMLElement , attrs:: AbstractArray{P} )
321
321
for (nam, val) in attrs
0 commit comments