3

I wanna use python to create sample xml from dtd. Don't know beautifulsoup will help

<?xml version="1.0" encoding="UTF-8"?>
   <!ELEMENT DatabaseInventory (DatabaseName+)>
   <!ELEMENT DatabaseName (   GlobalDatabaseName
                            , OracleSID
                            , DatabaseDomain
                            , Administrator+
                            , DatabaseAttributes
                            , Comments)
   >
   <!ELEMENT GlobalDatabaseName (#PCDATA)>
   <!ELEMENT OracleSID          (#PCDATA)>
   <!ELEMENT DatabaseDomain     (#PCDATA)>
   <!ELEMENT Administrator      (#PCDATA)>
   <!ELEMENT DatabaseAttributes EMPTY>
   <!ELEMENT Comments           (#PCDATA)>

   <!ATTLIST Administrator       EmailAlias CDATA #REQUIRED>
   <!ATTLIST Administrator       Extension  CDATA #IMPLIED>
   <!ATTLIST DatabaseAttributes  Type       (Production|Development|Testing) #REQUIRED>
   <!ATTLIST DatabaseAttributes  Version    (7|8|8i|9i) "9i">

   <!ENTITY AUTHOR "exampler">
   <!ENTITY WEB    "www.example.com">
   <!ENTITY EMAIL  "exampler@example.com">

I copied this dtd from other source.

vernomcrp
  • 3,459
  • 11
  • 34
  • 44
  • My crystal ball isn't helping with this... What have you tried, what sample is required, what DTD is being used... and as a note, BeautifulSoup really isn't for xml processing... – Jon Clements Jul 02 '12 at 10:19
  • read this http://stackoverflow.com/questions/17106/how-to-generate-sample-xml-documents-from-their-dtd-or-xsd, select one of the opensource solutions listed, and port it to Python. – bruno desthuilliers Jul 02 '12 at 12:05

0 Answers0