parsing XSD

Discussion in 'Python' started by Spitfire, Aug 10, 2008.

  1. Spitfire

    Spitfire Guest

    -----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-----
     
    Spitfire, Aug 10, 2008
    #1
    1. Advertising

  2. Hi,

    quite a lengthy mail for four lines of content. I guess there was no space
    left to say "hi"?

    Spitfire wrote:
    > 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
     
    Stefan Behnel, Aug 10, 2008
    #2
    1. Advertising

  3. Spitfire

    Spitfire Guest

    -----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-----
     
    Spitfire, Aug 10, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,187
    Markus
    Nov 22, 2005
  2. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    532
    C. M. Sperberg-McQueen
    Sep 26, 2003
  3. Replies:
    1
    Views:
    912
    Martin Honnen
    Jan 14, 2004
  4. Peter Aberline

    xsd:any as a child of xsd:all

    Peter Aberline, Apr 5, 2004, in forum: XML
    Replies:
    0
    Views:
    823
    Peter Aberline
    Apr 5, 2004
  5. Bernd Oninger
    Replies:
    1
    Views:
    559
    Henry S. Thompson
    Jun 30, 2004
Loading...

Share This Page