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'參數,但是我從中得不到任何東西。 –