Advertisement
Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts
-
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.
-
What is XML ?
XML stands for eXtensible Markup Language is not really a language but a framework for defining and using markup languages. Markup languages are used for creating units of information called XML documents, which have two standard representations: as a linear text with markup and as a tree data structure.
A tree is a connected set of nodes and a parent-child relationship defined on them. One special node is called the root. Every node except the root has exactly one parent node, and the root is the only node that doesn’t have a parent.
Trees are always drawn upside down, with the root on top and leaves at the bottom. If you start from any node that is not a root, go up to its parent, and continue up the tree, sooner or later you get to the root.
The nodes you encounter along the way are called the ancestors of the node you started from. The root is an ancestor of all nodes in the tree, and all nodes in the tree are its descendants. If node P is the parent of node C, then C is usually called a child of P. Children of the same node are called siblings. Nodes that have no children are called leaves.
A program that takes a text and checks the correctness of its syntax is called a parser. A parser does not simply return a Boolean answer (“correct” or “not correct”): if the text is grammatically correct, it builds an internal representation of its syntactical structure. Such internal representations are called syntax diagrams. For XML documents (as well as computer programs), syntax diagrams form a tree structure.
An XML document consists of text data and markup. The markup indicates the syntactical structure of the document.
This XML document contains three elements: encounter, greeting, and response. Here is the greeting element.An element consists of a start tag, the element’s content (which can be empty), and an end tag. A start tag minimally consists of the “<” character, a tag name, and the “>” character. The tag name can be followed by attribute declarations. An end tag consists of the character sequence “
An element consists of a start tag, the element’s content (which can be empty), and an end tag. A start tag minimally consists of the “<” character, a tag name, and the “>” character. The tag name can be followed by attribute declarations. An end tag consists of the character sequence “What is the tree structure of the document shown . In XML, the parent-child tree relationship corresponds to how elements are nested within each other in the linear text. In our example, encounter properly contains greeting and response; therefore, in the tree, encounter is the parent of greeting and response, whereas greeting and response are children of encounter and siblings to each other. Leaf elements are either empty or contain only text. (24.5)
Previous post deals with ASP.NET.
Related Posts
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:
Posts (Atom)