Advertisement
-
XML Parsing
A parser for a programming language knows only that one programming language. to parse a program, the parser has to consult the grammar of the language. But XML parsers are different on both counts. The same parser can do all XML languages, and, to parse a document, the parser does not need to know the grammar of its markup language. A general XML requirement is that the elements of an XML document must form a tree and that the tree structure of elements must be clearly shown in markup.
Tree conditions must be met in XML parsing is- There must be an element that contains all other elements. This is the root of the element tree .
- Start and end tags must be properly nested; overlapping elements are not allowed.
- All elements, including empty elements, must have both the start tag and the end tag.
Procedure :- Start by creating the root node and make it the current node.
- When a start tag is encountered, create a child of the current node and make it the current node. Put the start tag name on stack.
- When an end tag is encountered, check to see that its tag name is the same as the name on top of the stack. If it is not the same, declare failure and exit. If it is the same, close the current node (that is, pop the tag name off the stack) and make its parent the current node.
- If in the end the stack is empty, declare success, and return the tree. If it is not empty, declare failure and exit.
XML parsers within XML-aware browsers follow this procedure.
Why Is XML Great ?
1. XML makes it easy to agree on a common language or data format. A common language is the main prerequisite for cooperation.
2. Iit is very easy to switch between the linear text and the syntax tree view of an XML document. XML parsers are standard, high quality, ubiquitous, and free, and they can perform the switch both ways without any loss of significant information.
3. With XML, it is easy to construct networks of cooperating computer programs that receive XML text over the network, parse it into its internal representation, perform some computations on it, convert it back into linear text and send it over the network to another program for further processing.
4. XML is a major enabling technology for cooperation, both between human agents and between computer programs (interoperability).
Problems with programming language parsers :- Parsers for programming languages are difficult to write.
- The resulting binary objects are parser and platform specific.
- Transition from binary to textual form (disassembly) is hard and frequently illegal; certainly, no standard APIs are available for doing that.
The previous post is about the introduction of XML.
Software Testing Topics
Recovery testing technique Execution testing Structural software testing Static and dynamic testing Functional and structural testing Testing verification and validation Test Process Independent Software Testing and part two Testing metrics and Life cycle testing c programming break statement Compliance software testing V model Software Testing
Other Programming Courses :
ASP.NET part one and two
Programming with C and C Sharp
Dot Net Complete Course Part one and two
Interview Questions in dot net and asp.net part one part two
Software Testing Complete course part one and two
Interview Questions in software Testing
Thank you for visiting PROGRAMMING BLOG. If you liked the post, please subscribe to my blog via email or RSS FEED.You can contact me here for any specific feed back .
COMMENT HERE and thank you for sparing your valuable time.
I will be very glad if you share this page on your social book marking site with the below link.
Subscribe to:
Post Comments (Atom)
0 comments: