[QE-users] xml parser for data-file-schema.xml in qe
Pietro Davide Delugas
pdelugas at sissa.it
Tue Nov 12 11:27:49 CET 2019
Hi Kumar
could you send me a snippet of the code you you used for parsing ?
You can also post the issue directly in the issue of the repository.
Disappointingly nobody has used that section yet
As a general answer parsing the xml file with python is very simple. You
don't even need qeschema, the xmlschema package is sufficient, even if
in that case you need to download the schema file by yourself, its
location is printed in the header of the xml file.
For example if you
current url for example is
http://www.quantum-espresso.org/ns/qes/qes_190304.xsd
To convert the whole output of QE in a python dictionay the python lines
are something like:
import xmlschema
from xml.etree import ElementTree
schema = xmlschema.XMLSCHEMA('qes_190304.xsd')
data = ElementTree.parse('prefix.save//data-file-schema.xml').getroot()
data_dict = schema.to_dict(data)
On 11/12/19 4:07 AM, Sonu Kumar wrote:
> Dear QE users,
>
> Is there any xml parser for data-file-schema.xml in "prefix".save
> directory of tmp directory?
>
> I found qeschema (https://github.com/QEF/qeschema), but stuck by the
> attribute errors of the object XsdConstraintXPathParser
> (AttributeError: type object 'XsdConstraintXPathParser' has no
> attribute 'end')
> Any suggestions for xml parser or the error would be appreciated.
>
> best regards,
> Kumar
>
> **
> *With kind regards,
> *
> *S Kumar | PhD.
> *
> **
>
> _______________________________________________
> Quantum ESPRESSO is supported by MaX (www.max-centre.eu/quantum-espresso)
> users mailing list users at lists.quantum-espresso.org
> https://lists.quantum-espresso.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20191112/e48f9c09/attachment.html>
More information about the users
mailing list