0
我的Python(2.7)脚本输出使用lxml
库中的以下XML:拆分的长XML标签与LXML
<Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="17dp" android:layout_marginTop="16dp" android:text="Button"/>
我想将其输出到多条线路,每一个属性:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="17dp"
android:layout_marginTop="16dp"
android:text="Button" />
您必须找到lxml使用的变压器串行器实现的文档,并确定它是否有任何可以控制此变量的参数。我非常怀疑它。 –
感谢@JimGarrison的建议。我查阅了lxml文档,但找不到任何关于此的信息。我可以很容易地在标签之后操作字符串,但是我无法控制属性之后的字符串。我也在源代码中查找,以检查是否可以在'write()'函数中自定义'method'参数,但是我从中得不到任何东西。 –