0

I am a beginner in XML, I want to be able to apply my DTD rules to an XSD. Can you help me? Thank in advance.

<!ELEMENT PurchaseOrder (Reference|Actions)*>
        <!ELEMENT Reference (#PCDATA)>
        <!ELEMENT Actions (Action|Reject|Requestor|CostCenter|ShippingInstructions|SpecialInstructions|LineItems)*>
        <!ELEMENT Action (User|Date)*>
        <!ELEMENT User (#PCDATA)>
        <!ELEMENT Date (#PCDATA)>
        <!ELEMENT Reject (Date|Comment|User)*>
        <!ELEMENT Requestor (#PCDATA)>
        <!ELEMENT CostCenter (#PCDATA)>
        <!ELEMENT ShippingInstructions (name|address|telephone)*>
        <!ELEMENT name (#PCDATA)>
        <!ELEMENT address (#PCDATA)>
        <!ELEMENT telephone (#PCDATA)>
        <!ELEMENT SpecialInstructions (#PCDATA)>
        <!ELEMENT LineItems (LineItem)*>
        <!ELEMENT LineItem (Description|Part)*>
        <!ATTLIST LineItem
                ItemNumber CDATA #REQUIRED>
        <!ELEMENT Description (#PCDATA)>
        <!ELEMENT Part (#PCDATA)>
        <!ATTLIST Part
                Id CDATA #REQUIRED
                Quantity CDATA #REQUIRED
                UnitPrice CDATA #REQUIRED>
        <!ELEMENT Comment (#PCDATA)>
  • I suggest start with some kind of tutorial : i.e. http://edutechwiki.unige.ch/en/XML_Schema_tutorial_-_Basics. And if you then got questions, share your current xsd-progress and ask something specific. Succes – Siebe Jongebloed Jun 10 '21 at 08:43

1 Answers1

0

There are quite a few tools to do this: see for example Free DTD to XSD conversion utility?

(The question was closed because SO doesn't accept questions asking for tool recommendations: but not before it attracted some good answers. If you ever need a tool recommendation, you can get around the SO rules by pretending you want to write the code yourself, and people will then answer that you don't need to.)

Michael Kay
  • 156,231
  • 11
  • 92
  • 164