MCPcopy Create free account
hub / github.com/gawel/pyquery / xhtml_to_html

Method xhtml_to_html

pyquery/pyquery.py:310–326  ·  view source on GitHub ↗

Remove xhtml namespace: >>> doc = PyQuery( ... ' ') >>> doc [<{http://www.w3.org/1999/xhtml}html>] >>> doc.xhtml_to_html() [ ]

(self)

Source from the content-addressed store, hash-verified

308 yield self._copy(elem, parent=self)
309
310 def xhtml_to_html(self):
311 """Remove xhtml namespace:
312
313 >>> doc = PyQuery(
314 ... '<html xmlns="http://www.w3.org/1999/xhtml"></html>')
315 >>> doc
316 [<{http://www.w3.org/1999/xhtml}html>]
317 >>> doc.xhtml_to_html()
318 [<html>]
319 """
320 try:
321 root = self[0].getroottree()
322 except IndexError:
323 pass
324 else:
325 lxml.html.xhtml_to_html(root)
326 return self
327
328 def remove_namespaces(self):
329 """Remove all namespaces:

Callers 2

test_xhtml_namespaceMethod · 0.80

Calls

no outgoing calls

Tested by 2

test_xhtml_namespaceMethod · 0.64