Implementing XML with DTD schemas

2
8967

In this session today, we will learn to implement xml with the DTD schema and validate it using xml validator.

  • To implement xml with DTD schema follow the steps given below :

  1. Create a new folder on the desktop for example xml :
  2. v0

  3. Inside this folder create a new file called as index.xml.
  4. Right click on index.xml and open it with Notepad++ ,so the window will look like as shown below:-
  5. v1

  6. So to create an xml with DTD schema write the following code in Notepad++ .

  7. After writting the code you will have the following look of the window :
  8. v2
    v3

  9. So now when you open the file in Internet explorer you will have the following output :
  10. v4
    v5

  11. Create an another file say for example movies.dtd in your xml folder.
  12. v5.1

  13. So now write the following code in Notepad++.

  14. So after writting the code you will have the following Notepad++ window look out:
  15. v8

  16. Now we have to validate the XML and DTD file, for that we will used the xml validator. (Search on Google, xml validator).
  17. You will get the different xml validator ,with the respective validator you have to validate your xml or DTD document.
  18. v9

  19. So as shown in the abve figure we have to use the w3 validator to run our xml document structure.
  20. v10

  21. Copy and paste our index.xml file code into syntax-checker, hence after doing it you will have following view of your window :
  22. v11

  23. When we click on the validate button it will display the dialog box with a message that no error found,if your xml document is correct but if there is an error in your xml it will display the error description. Otherwise it will simply display No error Found message.
  24. To add the movies.dtd file to the syntax checker First we have to Copy ourindex.xml file code to the syntax-checkeralso mention the movies.dtd file code in it. So the complete code is given below.

  25. Then syntax-checker validates the movies.dtd code with xml (i .e our index.xml ) .This is called XML with DTD schemas.
  26. When we click the validate button at that time it will display the dialog box. If the XML with DTD schemas is correct then it will display No error Found message.
  27. Hence the window will look like as shown below :-
  28. v12

  29. You can also check by giving the filename path,so the window looks like this:-
  30. v13

  31. Thus we have implemented xml with DTD schema and have validated it using xml validator.

2 COMMENTS

  1. 99% of these websites are offering out dated
    and old software written in Java. In the present day We’re the right to contact most people close
    to hay day hack and even principe, the explanations these aren’t actually exasperating but yet very dangerous, solutions to individually
    keep on being rigorous in order to avoid these people.

    However, if another user with Administrator privileges then accesses these same servers and re-enables the Guest Account for any
    reason, you will then be left exposed.

  2. 99% of these websites are offering out dated
    and old software written in Java. Well first off people realize this is Pay
    – Pal, one of the most trusted online banking sites out there that people use on the daily basis for all of their personal or business needs.
    So, just with some nominal monthly fee, the organizations handover all their essential IT operations parts like; backup, updates, security practices to
    their cloud provider.

LEAVE A REPLY

Please enter your comment!
Please enter your name here