parsing XSD

S

Spitfire

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

~ I'm trying to use xml.dom.minidom parser to parse a XML schema file.
And, when I invoke 'childNodes' on the root element (schema) I get all
the nodes defined under it, instead of just getting the child nodes at
the first level! Why?

- --
_ _ _]{5pitph!r3}[_ _ _
__________________________________________________
“I'm smart enough to know that I'm dumb.â€
~ - Richard P Feynman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFInoWRKVWYDRRZoskRAs3PAJ9DSQYrQGQ6rsfNFddRMYG/8UcIeQCgqE1Y
KCx3mc2ly2Q3GNBUnJB7kbY=
=+O/T
-----END PGP SIGNATURE-----
 
S

Stefan Behnel

Hi,

quite a lengthy mail for four lines of content. I guess there was no space
left to say "hi"?
I'm trying to use xml.dom.minidom parser to parse a XML schema file.
And, when I invoke 'childNodes' on the root element (schema) I get all
the nodes defined under it, instead of just getting the child nodes at
the first level! Why?

Well, have you looked at your XML file? Maybe that's how it looks like? Unless
you show us some code that hints in a different direction, that's the most
likely explanation IMHO.

BTW, if you want to write XML handling code that lets you understand what you
are doing, try ElementTree or lxml. lxml also has support for XML Schema, in
case you want to do more than parsing with it.

Stefan
 
S

Spitfire

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Stefan,

Stefan Behnel wrote:
| BTW, if you want to write XML handling code that lets you understand
what you
| are doing, try ElementTree or lxml. lxml also has support for XML
Schema, in
| case you want to do more than parsing with it.
|
| Stefan

Thanks!

- --
_ _ _]{5pitph!r3}[_ _ _
__________________________________________________
“I'm smart enough to know that I'm dumb.â€
~ - Richard P Feynman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIn05gKVWYDRRZoskRAm0aAKCk3Sc7amPz16t1fhBaeSMvqJtnEgCffLL2
YHO0ahXp4cAese+zPSrzyH0=
=yQIO
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top