How to use xsi namespace in XML created by Python (2.5.4) etree -
How to use xsi namespace in XML created by Python (2.5.4) etree -
i have been using python interfaces; time can't find solution "tiny" problem xml namespace:
this xml wanted:
<alternate xsi:type="gallery" fragment="123">
the problematic part : xsi:type
this> etree.subelement(alternates,"alternate",{"type":"gallery","fragment":"123"})
would return: < alternate type="gallery" fragment="123" >
so question how xsi namespace. tried various things namespace declarations no success.
the root element requires somehow same: < article xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" >
i managed only: < xsi:article xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" >
using syntax: articles = etree.element("{http://www.w3.org/2001/xmlschema-instance}article" )
python xml namespaces
Comments
Post a Comment