[lxml-dev] Querying valid children of an element?
Brad Smith
usernamenumber at gmail.com
Wed May 7 15:13:04 CEST 2008
Hello,
I just discovered lxml and am pretty excited about it. There is one
thing I'm having trouble figuring out how to do, though, if it's even
possible:
I am writing a tool that translates xml tags mixed with a wiki-like
shorthand into full xml. It would be helpful to be able to
sanity-check the mix of explicit tags and implicit tags I'm deriving
from the shorthand by querying our DTD along the lines: "Is element
foo legal within element bar" Same for CDATA.
Is this possible using lxml? If not, is it possible using anything
else? The best I've been able to come up with so far is to assemble a
tree of dummy nodes in the proposed order and then validate it, but
this seems wasteful.
Thanks in advance for any help offered,
--Brad
--
~ Second Shift: An original, serialized audio adventure ~
http://www.secondshiftpodcast.com
More information about the lxml-dev
mailing list