• 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

    1. There must be an element that contains all other elements. This is the root of the element tree .
    2. Start and end tags must be properly nested; overlapping elements are not allowed.
    3. All elements, including empty elements, must have both the start tag and the end tag.
    All the parser needs to construct the syntactical tree is a stack to push a start tag on and pop it off when the matching end tag is found. If in the end the stack is empty, the document is well formed.

    Procedure :

    1. Start by creating the root node and make it the current node.
    2. 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.
    3. 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.
    4. 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 :
    1. Parsers for programming languages are difficult to write.
    2. The resulting binary objects are parser and platform specific.
    3. Transition from binary to textual form (disassembly) is hard and frequently illegal; certainly, no standard APIs are available for doing that.
    But simple XML parsers that only check for well-formedness and construct a syntax tree are easy to write, and their output is standard, platform independent, and easy to convert back to linear text form.(28)

    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 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.



Leave a Reply