-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to convert DOM node #5
Comments
Hi, it's a while since I looked at the schema, but would suspect that the Don't think I want to change the code to allow invalid documents, and it would be difficult since the bindings uses pyxb that does quite a good job in validating;) But if you still think the bindings can be useful I guess it would just take a couple of lines of code to fix the document, something like from komle.bindings.v1411.read import witsml
from lxml import etree
tree=etree.parse("MY_VOLVE_FILE_WITH_PRIV_NODE.xml")
for not_witsml in tree.xpath("//*[starts-with(name(), 'priv_')]"):
not_witsml.getparent().remove(not_witsml)
logs = witsml.CreateFromDocument(etree.tostring(tree)) |
Yeah, I was thinking something similar, a pre-processing step to remove the offensive tags, but your suggested code is more elegant than what I would have come up with! I don't think these tags are used, it looks like the operator has added them for internal use so I'm okay not processing them. Thank you! |
Vendors often add some private stuff, although they should have used the customData tag for that I suspect. Thanks for the update on volve witsml:) |
Hi there
I'm trying out your code to see if I can import some Volve data but I'm not able to read in a file without getting the following error:
Some additional info:
Looking a bit closer, it appears that there's a bunch of tags with a
priv_
prefix that are casing the issue. Is it possible to add atry except
forUnrecognizedContentError
if there's an unofficial tag and have these tags ignored?The text was updated successfully, but these errors were encountered: