MCPcopy Index your code
hub / github.com/clips/pattern / xml

Method xml

pattern/text/tree.py:1094–1103  ·  view source on GitHub ↗

Yields the sentence as an XML-formatted string (plain bytestring, UTF-8 encoded). All the sentences in the XML are wrapped in a element.

(self)

Source from the content-addressed store, hash-verified

1092
1093 @property
1094 def xml(self):
1095 """ Yields the sentence as an XML-formatted string (plain bytestring, UTF-8 encoded).
1096 All the sentences in the XML are wrapped in a <text> element.
1097 """
1098 xml = []
1099 xml.append('<?xml version="1.0" encoding="%s"?>' % XML_ENCODING.get(self.encoding, self.encoding))
1100 xml.append("<%s>" % XML_TEXT)
1101 xml.extend([sentence.xml for sentence in self])
1102 xml.append("</%s>" % XML_TEXT)
1103 return "\n".join(xml)
1104
1105 @classmethod
1106 def from_xml(cls, xml):

Callers

nothing calls this directly

Calls 3

appendMethod · 0.45
getMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected