How to Convert a DTD to XSD

How to Convert a DTD to XSD thumbnail
Convert your DTD file to XSD.

Document Type Definition (DTD) is an older standard that defines the schema for an XML document. An XML document provides Web pages with a list of logical data. For instance, an XML document can contain a list of customers. The DTD file creates the layout that defines each customer field, so the Web engine knows what to expect, such as data type and name, when displaying the content to the user. XSD is a newer standard, so you can convert your older DTD files to XSD.

Instructions

    • 1

      Create the XSD schema definition tags. Place the following code at the top of your file, which indicates to the Web engine that the file is an XSD file:

      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

      targetNamespace="http://www.yourdomain.com"

      xmlns="http://www.yourdomain.com">

      The "yourdomain" is replaced with your own website domain.

    • 2

      Add the tags that contain the XML data record definitions. Within these tags contain the translation from DTD to XSD. Add the following code to your file:

      <xs:element name="customer">

      <xs:complexType>

      <xs:sequence>

      </xs:sequence>

      </xs:complexType>

      </xs:element>

    • 3

      Translate each DTD tag to XSD. The following code is an example of a DTD record that describes XML data fields for a customer's first and last name:

      <!ELEMENT first_name (#PCDATA)>

      <!ELEMENT last_name (#PCDATA)>

      Within the tags created in step two, those two data tags translate to the following in XSD:

      <xs:element name="first_name" type="xs:string"/>

      <xs:element name="last_name" type="xs:string"/>

Tips & Warnings

  • Continue to replace each DTD line with a new XSD field. An XSD file can grow to be several fields or only a few, depending on the size of the DTD file. After each field is translated, the new XSD file provides a complete schema for your XML file.

Related Searches:

References

  • Photo Credit computer image by Orlando Florin Rosu from Fotolia.com

Comments

You May Also Like

  • How to Convert a XML File to XSD

    XML is the extension for the Extensible Markup Language file type. These are data files which use tags to define objects and...

  • What Is the DTD File Extension?

    The DTD file extension indicates that a file follows the Document Type Definition (DTD) format, which was created to define the structure...

  • How to Convert XML to Xsd Online

    XML means eXtensible Markup Language whereas XSD means XML Schema definition. XML documents transfer data to and from web services. XSD defines...

  • XSD to XML Conversion

    XML (eXtensible Markup Language) is a standardized method of describing data and the relationships between data. XML is used to simplify the...

  • How to Convert an XSD to an XML Tool

    The XSD schema created in your Visual Studio applications is the layout and "instructions" for the XML data. Visual Studio has a...

  • Xsd to XML Conversion Tools

    Comments. You May Also Like. How to Convert XML to Xsd Online. XML means eXtensible Markup Language whereas XSD means XML Schema...

  • XSD to XML Tools

    XSD to XML Tools. XML Schema Definitions, also known as XSD, provides the syntax and defines a way in which elements and...

  • How to Generate an XSD

    XSD files are Extensible Markup Language (XML) schema files that are alternatives to DTD files. XSD files are used to define the...

  • How to Convert a FrontPage Website to XHTML

    According to the World Wide Web Consortium, the academic community designed HTML for the exchange of scientific and other technical documents. In...

  • How to Make XSD

    The W3C, or World Wide Web Consortium, has recommended the XML Schema language (XSD) as a replacement to the older Document Type...

  • How to View Xsd Files

    Many different file types can be found on an operating system, some created by Windows itself, and others created by applications that...

  • What Is the Difference Between XSL & XSD?

    The Extensible Markup Language (XML) is a tool programmers can use to format and internally describe data. XSL and XSD are two...

  • How to Connect Basic Cable to a DTV Converter Box

    A digital television (DTV) converter box translates digital television programming from a source signal,such as cable TV service, into an analog signal...

  • The Difference Between XSD & WSDL

    XSD, which stands for XML Schema Definition, is the standard for defining the format of any given XML--Extensible Markup Language--file. Another acronym,...

  • What Is the File Extension XSD?

    The .XSD file suffix stands for Extensible Markup Language (XML) Schema Definition (XSD). This is a file type that is used to...

Related Ads

Featured