0

I am trying to extract html code from a div:

<html xmlns="http://www.w3.org/1999/xhtml">

<body>
<div id="tbParams">
    <table class="ParametrList" style="border-collapse: collapse; width: 100%;">
        <tr class="Parametr altrow">
            <td class="Nazev">
            Hello                </td>
            <td class="Hodnota" style="vertical-align: top;">

            </td>
        </tr>
</table>
</div>
</body>
</html>

...with xidel:

xidel input.html -e '//div[@id="tbParams"]' --output-format html

For some reason it keeps adding XMLNS attributes to the output:

<div xmlns="http://www.w3.org/1999/xhtml" id="tbParams">
    <table class="ParametrList" style="border-collapse: collapse; width: 100%;">
        <tbody xmlns=""><tr xmlns="http://www.w3.org/1999/xhtml" class="Parametr altrow">
            <td class="Nazev">
            Hello                </td>
            <td class="Hodnota" style="vertical-align: top;">

            </td>
        </tr>
</tbody></table>
</div>

If I remove xmlns="http://www.w3.org/1999/xhtml" from the <html> tag, then it is OK.

Adrian
  • 2,576
  • 9
  • 49
  • 97

0 Answers0