minidom and DTD

Discussion in 'Python' started by Laszlo Zsolt Nagy, May 23, 2005.

  1. Hi All,

    How can I put the

    <!DOCTYPE collection SYSTEM "recipes.dtd">

    thing into an XML created by xml.dom.minidom?

    Of course I can parse the generated XML file and insert the DOCTYPE string
    but there must be a standard way to do this...

    Best,

    Laci 2.0
     
    Laszlo Zsolt Nagy, May 23, 2005
    #1
    1. Advertising

  2. Laszlo Zsolt Nagy wrote:
    > How can I put the
    >
    > <!DOCTYPE collection SYSTEM "recipes.dtd">
    >
    > thing into an XML created by xml.dom.minidom?


    You should put a DocumentType node into your
    DocumentNode, and pass a qualifiedName of
    "collection" and a systemId of "recipes.dtd"
    to the createDocumentType call.

    Regards,
    Martin
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, May 23, 2005
    #2
    1. Advertising

  3. Martin v. Löwis wrote:

    >Laszlo Zsolt Nagy wrote:
    >
    >
    >>How can I put the
    >>
    >><!DOCTYPE collection SYSTEM "recipes.dtd">
    >>
    >>thing into an XML created by xml.dom.minidom?
    >>
    >>

    >
    >You should put a DocumentType node into your
    >DocumentNode, and pass a qualifiedName of
    >"collection" and a systemId of "recipes.dtd"
    >to the createDocumentType call.
    >
    >

    That worked, thank you.
     
    Laszlo Zsolt Nagy, May 23, 2005
    #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. Joseph Tilian
    Replies:
    0
    Views:
    363
    Joseph Tilian
    Dec 21, 2004
  2. Ronald Fischer
    Replies:
    4
    Views:
    1,774
    Ronald Fischer
    Mar 17, 2005
  3. David Pinto

    minidom and pulldom

    David Pinto, Dec 11, 2003, in forum: Python
    Replies:
    4
    Views:
    341
    John J. Lee
    Dec 15, 2003
  4. test
    Replies:
    2
    Views:
    2,095
    Oliver Wong
    Jul 28, 2006
  5. Replies:
    3
    Views:
    548
    Stefan Behnel
    Aug 3, 2007
Loading...

Share This Page