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

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

    Share/Save/Bookmark

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

    Share/Save/Bookmark

    more
  • ASP.NET INTRODUCTION

    Unlike the ASP runtime, ASP.NET uses the Common Language Runtime (CLR) provided by the .NET Framework. The CLR is the .NET runtime, which manages the execution of code. The CLR allows the objects, which are created in different languages, to interact with each other and hence removes the language barrier. CLR thus makes Web application development more efficient.

    In addition to simplifying the designing of Web applications, the .NET CLR offers many advantages. Some of these advantages are listed as follows.

    Improved performance:

    The ASP.NET code is a compiled CLR code instead of an interpreted code. The CLR provides just-in-time compilation, native optimization, and caching. Here, it is important to note that compilation is a two-stage process in the .NET Framework. First, the code is compiled into

    the Microsoft Intermediate Language (MSIL).

    Then, at the execution time, the MSIL is compiled into native code. Only the portions of the code that are actually needed will be compiled into native code. This is called Just In Time compilation. These features lead to an overall improved performance of ASP.NET applications.

    Flexibility:

    The entire .NET class library can be accessed by ASP.NET applications. You can use the language that best applies to the type of functionality you want to implement, because ASP.NET is language independent.

    Configuration settings:

    The application-level configuration settings are stored in an Extensible Markup Language (XML) format. The XML format is a hierarchical text format, which is easy to read and write. This format makes it easy to apply new settings to applications without the aid of any local administration tools.

    Security:

    ASP.NET applications are secure and use a set of default authorization and authentication schemes. However, you can modify these schemes according to the security needs of an application.

    In addition to this list of advantages, the ASP.NET framework makes it easy to migrate from ASP applications.

    Creating an ASP.NET Application

    Use a text editor:

    In this method, you can write the code in a text editor, such as Notepad, and save the code as an ASPX file. You can save the ASPX file in the directory C:inetpubwwwroot. Then, to display the output of the Web page in Internet Explorer, you simply need to type http://localhost/.aspx in the Address box. If the IIS server is installed on some other machine on the network, replace "localhost" with the name of the server. If you save the file in some other directory, you need to add the file to a virtual directory in the Default WebSite directory on the IIS server. You can also create your own virtual directory and add the file to it.

    Use the VS.NET IDE:

    In this method, you use the IDE of Visual Studio .NET to create a Web page in a WYSIWYG manner. Also, when you create a Web application, the application is automatically created on a Web server (IIS server). You do not need to create a separate virtual directory on the IIS server.

    From the preceding discussion, it is obvious that the development of ASP.NET Web applications is much more convenient and efficient in Visual Studio .NET.

    ASP.NET Web pages consist of HTML text and the code. The HTML text and the code can be separated in two different files. You can write the code in Visual Basic or C# . This separate file is called the code behind file. In this section, you'll create simple Web pages by using VB as well as C#.

    Before you start creating a Web page, you should be familiar with basic ASP.NET syntax. At the top of the page, you must specify an @ Page directive to define page specific attributes, such as language.

    To specify the language as VB for any code output to be rendered on the page.

    This line indicates that any code in the block, <% %>, on the page is compiled by using VB.

    To render the output on your page, you can use the Response.Write() method.

    Creating a Visual Basic Web Application

    You can create an ASP.NET application using Visual Basic by creating a Visual Basic

    Web Application project. To do so, complete the following steps:

    1. Select File ® New ® Project. The New Project dialog box appears.

    2. Select Visual Basic Projects from the Project Types pane.

    3. Select ASP.NET Web Application from the Templates pane. The Name box contains a default name of the application. The Location box contains the name of a Web server where the application will be created. However, you can change the default name and location. In this case, the name of the sample application is SampleVB.

    Deploying an ASP.NET Web Application

    After creating and testing your ASP.NET Web applications, the next step is deployment.

    Deployment is the process of distributing the finished applications (without the source code) to be installed on other computers.

    In Visual Studio .NET, the deployment mechanism is the same irrespective of the programming language and tools used to create applications. In this section, you'll deploy the "Hello World" Web application that you created. You can deploy any of the application that was created by using VB or C#. Here, you'll deploy the application created by using VB. To do so, follow these steps:

    1. Open the Web application project that you want to deploy. In this case, open the SampleVB project.

    2. Select File ® Add Project ® New Project to open the Add New Project dialog box.

    3. From the Project Types pane, select Setup and Deployment Projects.

    From the Templates pane, select Web Setup Project.

    4. Change the default name of the project. In this case, change it to "SampleVBDeploy."

    5. Click OK to complete the process. The project is added in the Solution Explorer window.

    more