It required to know xml for using SOAP.
Background of XML, html.
Both are markup language. Markup language have markup tags. Tags are special meaning. Suppose, you are reading following line,I am learning XML. XML is easy language.
You paused at full stop (.), you don't spell out (full stop literally), you followed it's meaning not literal meaning. Full stop is like tag. They are commands not just strings like others. All tags are start with < and ends with > . Most tags are in pairs, (opening and closing tags). Other are called empty tags. Some tags have attributes. They are properties of tags. Like <img src="location"> here src is attributes. (In XML tags may have attributes like HTML).
XML is similar to html with few differences given below-
- XML must be well-formed. Even if you skip html closing tag, you will see output correctly in browser. But XML need to be well formed. Well formed XML have following requirements,
- There should be 1 and only 1 document root.
<?xml version="1.0" encoding="UTF-8"?>
<root>
<child>Some text</child>
<child2>More text</child2>
</root>
<root>
<child>Some text</child>
<child2>More text</child2>
</root>
<child2>Some text</child2>
</root2>
It should be changed to,
<?xml version="1.0" encoding="UTF-8"?>
<uniqueRoot>
<root>
<child>Some text</child>
<child2>More text</child2>
</root>
<root>
<child>Some text</child>
<child2>More text</child2>
</root>
<child2>Some text</child2>
</root2>
</uniqueRoot>
- Proper nesting. Parent tag must end after child tag. The relation should be followed,
<parentTag>
<childTag>
Some sring
</parentTag>
</childTag>
Correct format,
<parentTag>
<childTag>
Some sring
</childTag>
</parentTag>
- Every tag must end even empty tag, example,
- Capital and small letter matters (not in html). <TagName> is different tag than <Tagname>.
- HTML has limited pre-defined tags. XML has unlimited tags. You can create tags of your own choice. As there is no pre-defined tags, sometimes DTD is given with XML. DTD (Document Type Definition) to define structure of XML document.
- In XML, special characters must be encoded. It should be encoded in html too , but browsers are intelligent and it don't show errors in HTML. Like if you use & , < , > , etc. But in XML, it will show you errors.
Valid XML
- Valid XML is well formed. (It should follow above all rules).
- It should be according to DTD.
No comments:
Post a Comment