dom :: XMLStartTag
dom :: XMLStartTag :: data
Content of this XML tag held within aPCDATA
or CDATA
dom :: XMLStartTag :: defaultinit
dom :: XMLStartTag :: matching
Optional matching tag, must be matched for the document to be well-formeddom :: XMLStartTag :: matching=
Optional matching tag, must be matched for the document to be well-formeddom $ XMLStartTag :: SELF
Type of this instance, automatically specialized in every classdom :: XMLAttrTag :: attributes=
List of attributes in a Tagdom :: XMLAttrTag :: attributes_to_map
Attributes as a map (ignoring malformed attributes)core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
dom :: XMLStartTag :: data
Content of this XML tag held within aPCDATA
or CDATA
dom :: XMLTag :: defaultinit
dom :: XMLStartTag :: defaultinit
dom :: XMLAttrTag :: defaultinit
core :: Object :: defaultinit
dom :: XMLEntity :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
dom :: XMLStartTag :: matching
Optional matching tag, must be matched for the document to be well-formeddom :: XMLStartTag :: matching=
Optional matching tag, must be matched for the document to be well-formedcore :: Object :: output_class_name
Display class name on stdout (debug only).
# A (potentially) multi-line spanning XML Tag start
class XMLStartTag
super XMLAttrTag
# Optional matching tag, must be matched for the document to be well-formed
var matching: nullable XMLEndTag
redef fun to_s do
var s = "<{tag_name}"
if not attributes.is_empty then
s += " "
s += attributes.join(" ")
end
s += ">"
for i in children do s += i.to_s
var matching = self.matching
if matching != null then s += matching.to_s
return s
end
end
lib/dom/xml_entities.nit:188,1--207,3
redef class XMLStartTag
# Content of this XML tag held within a `PCDATA` or `CDATA`
#
# ~~~
# var code = """
# <?xml version="1.0" encoding="us-ascii"?>
# <animal>
# <cat/>
# <tiger>This is a white tiger!</tiger>
# <cat/>
# </animal>"""
#
# var xml = code.to_xml
# assert xml["animal"].first["tiger"].first.as(XMLStartTag).data == "This is a white tiger!"
# ~~~
fun data: nullable String
do
for child in children do
if child isa PCDATA then return child.content
if child isa CDATA then return child.content
end
return null
end
end
lib/dom/dom.nit:45,1--69,3