| 1 |
|
| 2 |
|
| 3 |
<!DOCTYPE html> |
| 4 |
<html class="writer-html5" lang="en" data-content_root="../"> |
| 5 |
<head> |
| 6 |
<meta charset="utf-8" /> |
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 8 |
<title>lxml — lxml documentation</title> |
| 9 |
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" /> |
| 10 |
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" /> |
| 11 |
|
| 12 |
|
| 13 |
<script src="../_static/jquery.js?v=5d32c60e"></script> |
| 14 |
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script> |
| 15 |
<script src="../_static/documentation_options.js?v=5929fcd5"></script> |
| 16 |
<script src="../_static/doctools.js?v=fd6eb6e6"></script> |
| 17 |
<script src="../_static/sphinx_highlight.js?v=6ffebe34"></script> |
| 18 |
<script src="../_static/js/theme.js"></script> |
| 19 |
<link rel="index" title="Index" href="../genindex.html" /> |
| 20 |
<link rel="search" title="Search" href="../search.html" /> |
| 21 |
</head> |
| 22 |
|
| 23 |
<body class="wy-body-for-nav"> |
| 24 |
<div class="wy-grid-for-nav"> |
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> |
| 26 |
<div class="wy-side-scroll"> |
| 27 |
<div class="wy-side-nav-search" > |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
<a href="../index.html" class="icon icon-home"> |
| 32 |
lxml |
| 33 |
<img src="../_static/python-xml.png" class="logo" alt="Logo"/> |
| 34 |
</a> |
| 35 |
<div role="search"> |
| 36 |
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> |
| 37 |
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" /> |
| 38 |
<input type="hidden" name="check_keywords" value="yes" /> |
| 39 |
<input type="hidden" name="area" value="default" /> |
| 40 |
</form> |
| 41 |
</div> |
| 42 |
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> |
| 43 |
<ul> |
| 44 |
<li class="toctree-l1"><a class="reference internal" href="../lxml.html">lxml package</a><ul> |
| 45 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.html.html">lxml.html package</a><ul> |
| 46 |
<li class="toctree-l3"><a class="reference internal" href="../lxml.html.ElementSoup.html">lxml.html.ElementSoup module</a></li> |
| 47 |
<li class="toctree-l3"><a class="reference internal" href="../lxml.html.builder.html">lxml.html.builder module</a></li> |
| 48 |
<li class="toctree-l3"><a class="reference internal" href="../lxml.html.clean.html">lxml.html.clean module</a></li> |
| 49 |
<li class="toctree-l3"><a class="reference internal" href="../lxml.html.defs.html">lxml.html.defs module</a></li> |
| 50 |
<li class="toctree-l3"><a class="reference internal" href="../lxml.html.diff.html">lxml.html.diff module</a></li> |
| 51 |
<li class="toctree-l3"><a class="reference internal" href="../lxml.html.formfill.html">lxml.html.formfill module</a></li> |
| 52 |
<li class="toctree-l3"><a class="reference internal" href="../lxml.html.html5parser.html">lxml.html.html5parser module</a></li> |
| 53 |
<li class="toctree-l3"><a class="reference internal" href="../lxml.html.soupparser.html">lxml.html.soupparser module</a></li> |
| 54 |
</ul> |
| 55 |
</li> |
| 56 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.isoschematron.html">lxml.isoschematron package</a></li> |
| 57 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.ElementInclude.html">lxml.ElementInclude module</a></li> |
| 58 |
<li class="toctree-l2"><a class="reference internal" href="../lxml._elementpath.html">lxml._elementpath module</a></li> |
| 59 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.builder.html">lxml.builder module</a></li> |
| 60 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.cssselect.html">lxml.cssselect module</a></li> |
| 61 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.doctestcompare.html">lxml.doctestcompare module</a></li> |
| 62 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.etree.html">lxml.etree module</a></li> |
| 63 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.objectify.html">lxml.objectify module</a></li> |
| 64 |
<li class="toctree-l2"><a class="reference internal" href="../lxml.sax.html">lxml.sax module</a></li> |
| 65 |
</ul> |
| 66 |
</li> |
| 67 |
</ul> |
| 68 |
|
| 69 |
</div> |
| 70 |
</div> |
| 71 |
</nav> |
| 72 |
|
| 73 |
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > |
| 74 |
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> |
| 75 |
<a href="../index.html">lxml</a> |
| 76 |
</nav> |
| 77 |
|
| 78 |
<div class="wy-nav-content"> |
| 79 |
<div class="rst-content"> |
| 80 |
<div role="navigation" aria-label="Page navigation"> |
| 81 |
<ul class="wy-breadcrumbs"> |
| 82 |
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li> |
| 83 |
<li class="breadcrumb-item"><a href="index.html">Module code</a></li> |
| 84 |
<li class="breadcrumb-item active">lxml</li> |
| 85 |
<li class="wy-breadcrumbs-aside"> |
| 86 |
</li> |
| 87 |
</ul> |
| 88 |
<hr/> |
| 89 |
</div> |
| 90 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
| 91 |
<div itemprop="articleBody"> |
| 92 |
|
| 93 |
<h1>Source code for lxml</h1><div class="highlight"><pre> |
| 94 |
<span></span><span class="c1"># this is a package</span> |
| 95 |
|
| 96 |
<span class="n">__version__</span> <span class="o">=</span> <span class="s2">"6.1.0"</span> |
| 97 |
|
| 98 |
|
| 99 |
<div class="viewcode-block" id="get_include"> |
| 100 |
<a class="viewcode-back" href="../lxml.html#lxml.get_include">[docs]</a> |
| 101 |
<span class="k">def</span><span class="w"> </span><span class="nf">get_include</span><span class="p">():</span> |
| 102 |
<span class="w"> </span><span class="sd">"""</span> |
| 103 |
<span class="sd"> Returns a list of header include paths (for lxml itself, libxml2</span> |
| 104 |
<span class="sd"> and libxslt) needed to compile C code against lxml if it was built</span> |
| 105 |
<span class="sd"> with statically linked libraries.</span> |
| 106 |
<span class="sd"> """</span> |
| 107 |
<span class="kn">import</span><span class="w"> </span><span class="nn">os</span> |
| 108 |
<span class="n">lxml_path</span> <span class="o">=</span> <span class="n">__path__</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> |
| 109 |
<span class="n">include_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">lxml_path</span><span class="p">,</span> <span class="s1">'includes'</span><span class="p">)</span> |
| 110 |
<span class="n">includes</span> <span class="o">=</span> <span class="p">[</span><span class="n">include_path</span><span class="p">,</span> <span class="n">lxml_path</span><span class="p">]</span> |
| 111 |
|
| 112 |
<span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">include_path</span><span class="p">):</span> |
| 113 |
<span class="n">path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">include_path</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> |
| 114 |
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">path</span><span class="p">):</span> |
| 115 |
<span class="n">includes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">path</span><span class="p">)</span> |
| 116 |
|
| 117 |
<span class="k">return</span> <span class="n">includes</span></div> |
| 118 |
|
| 119 |
</pre></div> |
| 120 |
|
| 121 |
</div> |
| 122 |
</div> |
| 123 |
<footer> |
| 124 |
|
| 125 |
<hr/> |
| 126 |
|
| 127 |
<div role="contentinfo"> |
| 128 |
<p>© Copyright 2026, lxml dev team.</p> |
| 129 |
</div> |
| 130 |
|
| 131 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a |
| 132 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> |
| 133 |
provided by <a href="https://readthedocs.org">Read the Docs</a>. |
| 134 |
|
| 135 |
|
| 136 |
</footer> |
| 137 |
</div> |
| 138 |
</div> |
| 139 |
</section> |
| 140 |
</div> |
| 141 |
<script> |
| 142 |
jQuery(function () { |
| 143 |
SphinxRtdTheme.Navigation.enable(true); |
| 144 |
}); |
| 145 |
</script> |
| 146 |
|
| 147 |
</body> |
| 148 |
</html> |