Archive for the ‘General’ Category
How to Retrieve Data from SQL Server Database in XML Format?
After the release of the SQL Server 2000 the way the data is retrieved has taken a new dimension. The support for XML format is there from the version of SQL Server 2000.
With that it is possible to retrieve data from the SQL Server database in the XML format. SQLXML is used for this purpose. With such possibilities it is possible to access data in the SQL Server using URL based queries where the queries are transported using HTTP.
If you are already familiar with the SQL queries then it is very easy to create queries that return data in XML format. The syntax for such SQL queries would be,
SELECT … FOR XML mode
The values of the mode may be auto, explicit, raw, and nested. Depending on the mode that you are using the format of the XML output varies. If the mode is auto, the resulting XML document will have an element for each row that is found in the table of the SQL Server database.
In the explicit mode it is possible to define how the columns of the table should be returned to the query. In the raw mode all the fields of the table are considered as the attributes of the element of the XML data that is returned. The columns that have null values are not included. The returned elements have a row prefix to it.
The nested mode allows formatting to be done at the client side and it is the same as the auto mode except for this difference. The explicit mode is the most powerful mode for returning data. It is possible to define how you want the data and you can even use filters and sorts to get the data in the way you want.
Apart from these there are optional parameters for the SQL query. The optional parameters as the name indicates can either be used or neglected. The optional parameters that can be used are Binary Base64, Elements, and XMLData. With the optional parameters in place the syntax would take the form,
SELECT … FOR XML mode [, BINARY BASE64] [, ELEMENTS] [, XMLDATA]
The Binary Base64 option is used if you want to retrieve data in the binary format from the database. Binary data that is found in the database should be retrieved using this option. The modes that are used to retrieve data in binary format are the raw and the explicit modes.
The Elements option is used to return the data in the table as child elements. The fields of the row become the attributes of the element returned if you are not using the Elements option. Thus for each row you get an element with child elements being the fields of the row.
Auto mode is the only mode in which you can use the Elements option. If you want to define the format that is returned you need an XSD schema for that. The XMLData option allows this. This option adds a schema so that you get the format that you want for your XML data.
Managed classes are available in the .Net framework for interacting with the database. The Managed classes that are useful for this are SqlXmlCommand, SqlXmlParameter, SqlXmlAdapter, and SqlXmlException.
The SqlXmlCommand is used to query the XML templates. These are the XML documents that have the SQLXML queries in them. Processing the queries on the client side is possible with this managed class.
A managed class called the SqlXmlAdapter class is available which can be used to fill the dataset. This is the adapter class for the provider.
Another managed class called the SqlXmlParameter is available which can be used to pass parameters. This class is used along with the SqlXmlCommand managed class.
A class for trapping errors from the SQL Server is available which is called the SqlXmlException managed class.
A simple example of using the managed classes for getting XML output from the SQL Server database is given below. This code uses the XML AUTO mode for generating the XML data.
static string xmlstr = “Provider=SQLOLEDB;Server=(local);database=Orders;”;
public static void SampleSqlXml ()
{
Stream objStr = Console.OpenStandardOutput();
SqlXmlCommand sqlcmd = new SqlXmlCommand(xmlstr);
sqlcmd.Root = “Orders”;
sqlcmd.CommandType = SqlXmlCommandType.Sql;
sqlcmd.CommandText = “SELECT OrderNo, OrderValue FROM Orders FOR XML AUTO”;
strm = sqlcmd.ExecuteToStream(objStr);
objStr.Close();
}
For more information and samples on the managed classes that are used for retrieving data in XML format from SQL Server you can refer to the MSDN documentation.
Since we know that the results of the query are in the form of XML, it is possible to write your own ASP or ASP.Net code to display the values retrieved in XML format in the webpage. You can use the XSL for formatting the output in the way you want in the webpage. This allows the user to see the values in a particular format using the browser of their choice.
Author: Balaji B
Article Source: EzineArticles.com
Provided by: Programmable pressure cooker
An Introduction To XML
Extensible Markup Language (XML ) is a mark up language that provides a format for describing structured data. This facilitates more precise declarations of content and more meaningful search results across multiple platforms. XML thus enables a new generation of web based data viewing and manipulation applications.
Outwardly, XML looks like HTML. XML is a subset of SGML (Standard Generalised Markup
Language) that is optimised for delivery over the web. XML standards are defined by the World Wide Web
Consortium ( W3C ) and they ensure that structured data will be uniform and independent of application or vendors. HTML specifies how to display data in a browser while XML defines the content. XML
documents are extensible, structured and self- validating. In XML, you can define an unlimited set of
tags. XML provides a framework for tagging structured data. An XML element can declare its data
to be a retail price, book title or any other desired data element.
XML provides a means of including metadata in web documents. Metadata is information about information. The display of XML documents is typically accomplished with style sheets such as Extensible Style Language( XSL ) and Cascading Style Sheets (CSS).
XML is only a specification. A document is entitled to be called an XML document only if it adheres to the rules laid down in the XML specification. XML documents are designed for use by XML processors.XML processor has a component called the XML parser that analyses XML markup and determines the structure of the document data.
Author: Leena Vijayakumar
Article Source: EzineArticles.com
How to Perform DTD Comparison on Two SGML Or XML DTD Files
The main purpose of a DTD file is to identify and classify the official building blocks of the XML document. It is commonly used to define the structure of the XML document by creating a list of the lawful elements. The declaration of the DTD can be done in two ways. The first one is to declare it inline in the XML document that you have created. The other way is to declare it as an external reference.
Before you learn how to make DTD comparison, you should know why you have to use this file format. XML provides the users with an application that makes them share data independently. If they use DTD, they are allowed to make use of a common DTD so that they can interchange the data. Here, you can utilize standard DTD so that you can verify the validity of the data that you have received. Another benefit from DTD is that you can employ this to make sure that your own data is legal.
With DTD known as the building blocks of XML, one can conclude that this is an important element in the documents. You can define the elements in the XML document by simply using DTD. Here, the DTD elements that you can create are empty elements along with elements with data, with children or sequences and wrapping. You can also declare one occurrence of the same element or a mixed content. DTD attributes on the other hand can be declared using the ATTLIST declaration. You can build a default attribute value, implied attribute, fixed attribute value or enumerated attribute values.
Now, if you have a problem with the DTD file format that you are working on, it can be caused by some registry failures. To solve this, simply scan windows registry in your computer so that you can repair the conflicts in the XML DTD files. Let us now proceed to DTD comparison. You can easily perform this by adding a new script to your XML document, which is “dtd-compare.py.” This can compare the defined vocabularies in the DTD files. You can see here which among the elements are present or absent.
Comparing SGML or XML DTDs is more complicated. To make it simpler, you can use “dtddiff.” This compares the two DTDs on XML files that are based upon the dumps produced by “dtdparse.” Since the main dtddiff processes include the XML dumps, you do not have to perform a full reparse on the DTD files. What dtddiff does is to make a comparison based on the structure of the files. This means that you will not have to worry about the declaration order because it goes unaffected by this command.
DTD files formalize the markup languages and more importantly, it develops markup language generations by checking them. Nowadays, there are some who do not learn the arcane DTD syntax. They can simply create a script that depends on the existing libraries that parse the DTD files. Dealing with DTDs can be quite complicated but with further researching and educating, you will ultimately understand the deep DTD file format.
Author: Sam Miller
Article Source: EzineArticles.com
Provided by: Guest blogger
MS Word XML Markup Language For Simplicity
The Extensible Markup Language can best be defined as a subset of the Standard Generalized Markup Language. It is called ‘extensible’ because it allows users to add their own elements in it. It has one keyword: simplicity. Understandability is excellent, and this is documents from different system types are converted into XML so that the file can be shared without any hassles. As it grew, it became more specific. Some application languages like XHTML and the like were implemented using this language. It has become so famous that even packages like MS Office has incorporated it in its components. This article focuses on only one of those components: MS Word XML.
Microsoft first introduced the XML capability as a separate package. This was referred to as Office Open XML. Better known as OOXML or OpenXML, this package allowed users to specify XML file formats in word documents, spreadsheets and presentations. The package was later taken over by Ecma International. This was the way in which many Office components were born, including MS Word XML. Ecma, however, has been unsuccessful in obtaining standardization since there aren’t enough votes to support it. Later it was then directly incorporated into all the MS Office components.
It is said that the efficiency and versatility of MS Office has increased greatly after it started incorporating support for XML. More recent versions like Word 2007 have the option to save your document with the extension .xml, directly. While simple files are converted successfully into this format, there have been some recurring problems when saving complex documents in the .xml file format. Good news is that images are stored directly in the documents and we do not need to extract it separately. Though the result isn’t as extensible as it ought to be, people say that it will suffice, for the moment.
What would be the advantages of a word editor, like MS Word, coupled with XML? The first advantage is the fact that files can be preserved better and can be safely transferred between systems of different types. The other benefits that one would get include better security, improved integration, increased compatibility and compactness. These benefits are more pronounced when used in business enterprises.
MS Word XML has also had its fair share of criticism. One of the major drawbacks, according to the customers, is its awful interactivity. While MS Word does give plenty of support, the process of invoking and using that support is tiresome to say the least. Moreover, the document size isn’t as small as one would expect. Apart from this, numerous inconsistencies are also said to exist internally. For reasons like this some people save the word document in its original form and then use a Word to XML converter.
Experts predict the future to be increasingly dependant ont is, so MS Word XML is definitely a start. One has to see how it will be enhanced and what extensible features it will provide.
Author: Dean Forster
Article Source: EzineArticles.com
Provided by: Digital TV, HDTV, Satellite TV
Why Do We Even Need XML Anyway?
To learn about XML (eXtensible Markup Language) we need to first know what markup languages are. Markup languages are designed for the processing, definition, and presentation of documents containing structured information. The language specifies code for formatting, both the layout and style, within a text file or document. HTML is an example of a widely known and much-used markup language.
The differences between XML and HTML are, noting that XML is not a replacement for HTML:
- XML has been designed to transport and store data, with a focus on what data is
- HTML has been designed to display data, with a focus on what data looks like
In other words, HTML is about displaying information, while XML is about carrying information.
Why XML?
In order to appreciate XML, it is important to understand why it was created. The foremost reason being so that data could be exchanged over the web. The only viable markup language alternatives for this purpose, HTML and SGML, are not practical as HTML is bound with a set of semantics that do not allow for arbitrary structure, while SGML, although it does allow for arbitrary structure, is too complex to implement just for a web browser.
A well known example of the use of XML is RSS (Rich Site Summary) feeds, which is a format for delivering regularly changing web content. Many news-related sites, weblogs and other online publishers syndicate their content as an RSS Feed to whoever wants it on a regular, up-to-date basis. In reality, these so-called RSS-feeds are nothing less than XML files.
Another important reason for the development of XML is that it allows for the use of data from more sources and in more ways as it has become a widely accepted standard for exchanging data between any number of computer systems. Why use it? Businesses today thrive on data, and said data can come from a number of sources and in a variety of formats (such as databases, web pages, spreadsheet files, etc.). Data can be extracted from various original sources, stored at a location of your choosing, and accessed whenever required by you, therefore enabling you to get more from that data.
For example, if you are required to create a report on budget data for the past three years, however you have stored that data, if it’s in XML, you can select what you need and import it into a document, worksheet, or database – whatever the situation requires.
XML and Excel
Microsoft Office 2003 Professional was the first Office version that took the XML standard seriously.
It is common knowledge that many businesses use Excel to edit and prepare data. It is easy to use and is widely available, and its tabular format is ideally suited to all kinds of information processing, such as inventory lists, customer records, financial data, statistical data, and much more.
XML is called “Extensible” for a good reason: you can extend it by adapting it to fit almost any requirement. In business, publishing, government, science, academic research – anywhere that information moves from one user to another. And it is built in to Microsoft Excel, and the other applications that make up MS Office.
Excel 2003 training will provide you with a greater understanding of the benefits to business and yourself of making use of XML for data handling and storage.
Author: Rich Talbot
Article Source: EzineArticles.com
Provided by: Netbook, Tablets and Mobile Computing
Understanding the Multifarious Aspect of XML Application
The studio of XML is primarily responsible for the work development and creation of applications of XML but the utilitarian advantage is beyond the boundaries in various other aspects as well. This can be very well understood through a deeper understanding of the different types of functional attributes that are associated with this particular concept.
Therefore the functional benefits associated with the broad applications of XML are as follows:
XML editor helps to make the task of writing of computer programs and authenticating XML documents much simpler and easier in their style.
XML Editor Validation – This application verifies the XML data to make sure that the formulation of the content is done in a proper and suitable manner .at the same time the verification is also performed to make sure that the document is completely legitimate against any related XML Schema. The XML Editor notifies the user about the degree of substantiation accomplished and features any mistakes in the XML Data.
The application and feature of auto complete makes the work of editing and formulating xml documents extremely simple. The XML Editor sharply computes the options of auto complete that are available to frame a connected set of XML Sachems.
The concept of XML Editor Collapsing along with the application of Code folding permits the XML Editor user to make relevant use of a larger working area, during the process of editing and creating XML data, mainly with respect to large data files of XML.
The Syntax Highlighting application of XML editing even allows for the easy data reading of XML.
The application of X Path Query Viewer facilitates the editing applications to highlight the results of an X Path expression as featured areas within the editing applications of XML
The graphical application of the XML schema editor allows to design programs and navigate makes XML Sachems (XSD) in the most simple and easy style. On creating or loading this application it furnishes a graphical representation which is quite simple in terms of easy comprehension. At the same time it prevents the control loss with respect to any form of complications.
XML serves the primary syntax that can be utilized to share suitable and relevant information between diverse kinds of computers, various applications, and different organizations. The data of XML is stored in a very simple format of plain text. As the criteria of storing the data without any sort of dependency on any kind of software or hardware application is extremely feasible therefore the expansion and upgrading facility to the new operating systems, fresh applications or any new browser is easily facilitated without any kind of loss of relevant data in any form.
XML also serves the ideal channel for proper communication between different types of applications. It is not only the aspect of information sharing but many other beneficial applications that make the complete application of XML extremely effective in all the ways.
Author: Michael Antony
Article Source: EzineArticles.com
Provided by: Cellphone news
Why You Need XML to Reuse Learning Content
In his seminal article Education and Training: the Road Ahead, Joe DiDonatos refers to the 20/30/50 model for delivering and teaching content. In this framework, the most effective and long lasting training results are derived from the following mix: 20% classroom training, 30% e-learning and 50% performance support.
Unfortunately, training organizations are far from delivering to learners this ideal blended learning environment. This is due to the overwhelming tendency to create content for a singular purpose (e.g. instructor-led training) and then recreate that same content for another purpose (e.g. e-learning) using a different tool. It is the Achilles heel of the training industry.
Training organizations need to find a more efficient and cost-effective way to meet the customization and performance support demands of learners. And that means embracing XML for content reuse. The good news is that this is not a new concept, adopting a single source XML framework has proven phenomenally successful in other domains such as product documentation and publishing. The benefits reaped by these industries can be easily applied to learning content. Here is how:
Reuse across multiple audiences
XML allows you to break learning content down into granular elements that can be reused and repurposed in many forms and many contexts. At its most basic definition, XML is simply a way of labeling information by identifying its components and structure. This semantic mark-up gives us detailed access to the content. As a result, applications can now process these pieces in different ways, greatly increasing the usefulness and the value of content.
To illustrate, how a piece of machinery works is something that affects multiple job roles at a manufacturing site. On the flip side, how to operate that piece of machinery is specific to the machine operator and how to draw a sample from that machine for testing is unique to the quality associate. XML allows us to tag these information components as shared or audience specific. Applications supporting XML can process the shared content to appear in all e-learning courses for example and filter the audience specific content to appear only in courses taken by employees in a certain job roles. This filtering can apply to almost any variable, be it departments, brands, product lines, geographies, etc.
Reuse across multiple formats
XML represents data in a platform-neutral, open, and extensible manner. In other words, XML is channel-independent and as such, allows you to deliver content real time in a variety of formats to worldwide audiences. Content maintains its quality, integrity and security no matter how it is delivered- via instructor-led training, online courses or mobile performance support applications.
Research compiled by Chapman Alliance and Brandon-Hall, shows the ratio of development hours to course hours is 34:1 for instructor-led training and 33:1 for converting PowerPoint from this instructor-led training to e-learning. In these instances the same learning content is created twice, once for each output format. By contrast, if course content is created in XML, which separates content from presentation, the output format would be a non-factor. In other words, there would be no need to spend 33 meaningless hours to convert existing content.
The trade off is that content development needs to take on a more formalized approach than most authors may be used to, but the productivity gains that can be achieved using XML are enormous.
Real-time customization
XML gives you the ability to create customized training information by assembling on-demand, multiple pieces of learning content into a single document. In other words, it allows you to “slice and dice”?learning content on-the-fly to create new training products and deliver information personalized to individual requirements.
Content customization is something that the majority of training organizations struggle with due to the excessive cost and resources required to create and maintain hundreds of versions of the same content, but tweaked to individual requirements. XML solves this problem by allowing you to break content down into relevant pieces and tag it for different profiles (e.g. use this compliance procedure for learners located in only the US) and different outputs (e.g. use this graphic if outputting to mobile devices).
Using this XML-base approach, customization is no longer manual. Instead, it’s a completely automated, on-demand and self-service process. One that reuses the same content over and over, simply assembling and distributing it based on a learner’s input.
Instant Content Synchronization
In case it hasn’t become clear yet. XML allows you to create content once and reuse it across multiple training products and outputs. This drastically reduces one of the biggest costs associated with content development: maintenance.
With XML, when a change is made to a piece of content, that edit can be automatically propagated to all training products where that content appears. Eliminated is the need to update the content in print documents and then updating it again in e-learning courses and then updating again in performance support applications and so on. XML ensures content integrity and content timeliness. For companies that are highly regulated, this can even dwarf the massive cost savings achieved from not having to maintain multiple versions of learning content.
Author: Dawn Poulos
Article Source: EzineArticles.com
Provided by: Latest trends in mobile phone
Structured Authoring and the Evolution of XML Standards – Two Perspectives on XML
I have been working with XML since it was a glimmer in the eye of Jon Bosak. In fact, before XML was conceived, there was SGML; going from SGML to XML represented a streamlining for the web, but at its core there was not much functional difference; in fact XML is a subset of SGML. The key concept of semantic markup is central to the core value of SGML/XML.
The two main perspectives I have seen are Document-centric XML and Data-centric XML. SGML initially appeared in support of document-centric work: managing all the technical documents or contracts of IBM or Boeing, for example. Charles Goldfarb has maintained that “SGML literally makes the infrastructure of modern society possible” and I think he’s right – hmm, should we blame him for the lengths to which humans have gone to destroy the earth?
The document-centric XML world is really a direct continuation of SGML. When XML came out as a standard in 1998, those of us working with document-centric XML became giddy with excitement, anticipating that the standards being proposed at the time (notably XML itself, XLink, XML Schema, RDF, XSL and pre-cursors to SVG) would finally facilitate tools that made publishing work for organizations that weren’t quite as big as IBM or the Department of Defense. The vision of a semantic web and ubiquitous XML multi-channel publishing, seemed to be growing a foundation in theories gaining critical mass, with apparent support of software companies. It appeared these vendors might actually adopt the standards of the committees they were sitting on. “Throw away Xyvision!” I told my boss at Bertelsmann, “this XSL-FO will completely revolutionize database publishing!”
We were sorely disappointed over the next five years. In the years before 1998 W3C standards seemed magical; concepts from the standards were implemented relatively quickly, without perfection but with steady progress: browser updates would reflect CSS and HTML advances; even Microsoft was shamed into some level of compliance. But the monopolistic tendencies of those on the standards committees, coupled with the academic approach of some of the standards committees, managed to make it less and less likely that a given standard would find a functional implementation.
And there was that other perspective – the data-centric side of things. For many reasons, XML was at the right place at the right time in terms of data management and information exchange. In fact, the very year that XML became a standard, it also became the dominant way that machines (servers) talked to each other around the world. Highly convenient for exchanging info, as firewalls would tend to block anything but text over http, while XML markup would allow any sort of specification for data structures, and validation tools would ensure no info was lost.
In 1998, when you asked a programming candidate “what do you know about XML?” only the document-centric people would know anything. By 2000, everyone doing any serious programming “knew” about XML. Trouble was, they typically knew about “XML” only in the much easier-to-use, irrelevant-to-publishing, sense.
And the standards now had to accommodate two crowds. The work of the W3C XML Schema Working Group, in particular, showed the disconnect. Should a schema be easily human readable? What was the primary purpose of Schema? Goals were not shared by the document- and data-centric sides, and data-centric won out, as they have tended to dominate the XML space ever since that time. RELAX NG came about as an alternative, and if you contrast RELAX NG with W3C Schema, you will see the contrast between the power of a few brilliant individuals aligned in purity of purpose and the impotence of a committee with questionable motives and conflicting goals. Concurrent with a decline in the altruism of committee participants was the huge advance of data-centric XML and the disproportionate representation of that perspective.
Ten years later, we find in the document-centric world that toolsets related to XML in a data sense – parsing, transforming, exchanging info – have made great leaps forward, but we are in many ways still stuck in the 1990s in terms of core authoring and publishing technologies. It is telling that descendants of the three great SGML authoring tools as of 1995 – FrameMaker+SGML, Arbortext Epic, and SoftQuad’s Author/Editor, are, lo and behold, the leading three XML authoring tools in 2009.
There have been some slow-paced advances in document-centric XML standards and tool chains as well, especially the single bright light out there for us, Darwin Information Typing Architecture (DITA) which came out of IBM like XML itself. Yet standards for rendition, XSL-FO and SVG especially, have not advanced along with core proprietary rendition technologies such as InDesign, Flash, or Silverlight, though all of these enjoy nicely copied underpinnings pillaged from the standards. More important, nothing has stepped in to replace the three core authoring tools: the “XML support” of Microsoft Word and Adobe InDesign, for example, do not approach the capabilities of a true XML authoring application. There are a proliferation of XML “editors” but most of the new ones are appropriate for editing a WSDL file or an XML message (the data-centric forms of XML), not a full-fledged document.
Meanwhile, on the data-centric front, XML has simply permeated every aspect of computing. There are XML data types in database systems, XML features in most programming languages, XML configuration files at the heart of most applications, and XML-based Web Services available in countless flavors.
Document-centric XML is simply a deep challenge that will take more time (and probably more of a commercial incentive) to tackle. For the time being, structured authoring managed the XML way is still implemented mainly by very large organizations: such an approach has “trickled down” from organizations the size of IBM to organizations the size of Adobe (which does, in fact, use DITA now), but there are not tool chains yet available that will bring it down much further. The failure of the W3C XML Schema Working Group to provide a functional specification supporting document-centric XML can hardly be underestimated.
As long as content is not easily authored in a semantically rich, structured fashion, the vision of the semantic web will remain an illusion. When and if document-centric XML gets more attention from standards bodies and software vendors, human communications will become far more efficient and effective.
Author: Max Dunn
Article Source: EzineArticles.com
Provided by: Benefits of electric pressure cooker
XML Or Binary Serialization – That is the Question
NET 2.0 and 3.0 offer two very different ways to serialize object data into something else, namely XML and bytes. This article will compare the two methods for you, as well as offer some words of wisdom. XML Serialization saves memory when the size of the data contained in the object being serialized is less than the size of the class definition plus the data contained in the object. This is because Binary Serialization includes the class definition within its serialized results and XML Serialization does not.
Why do I care that XML Serialization doesn’t save class information? Because the serialized XML Data representing the object can be deserialized (from XML back into an object) into any object that you so desire. Given, of course, that the class has a name, and Serialization Attributes exist in the class definition, and they correctly map to the XML Elements that were generated upon the initial XML serialization process.
Because Binary Serialization stores the class information as well as the object data, the deserialization process is type safe. Binary serialization guarantees that what you serialize into a stream of bytes is exactly what comes out of it at the time you so choose to deserialize back into an object. This ensures that the object is reconstructed correctly back into the class that you expect it to be. This is the class that you originally instantiated an object from, as if to give birth to a child. How sad that you then decided to take that child and serialize it into an array of bytes. And thank goodness for Binary Serialization, because you can re-construct your baby without concern, given you have a reference to the assembly in which your baby sleeps.
One caveat with serialization; watch out for dependencies when sending binary byte[] or XML from one service to another. At the destination service, when you want to deserialize the bytes or XML, you will need to have a reference to the assembly that the original class was built into. Watch out for these catch 22 dependencies, and keep things as close to object or byte array as possible inside the destination service, this way you will have no dependency issues.
By the way, dependency is bad, in case you haven’t heard it out on the digital grapevine yet.
The XML serialization method is great for quick and dirty mapping of serializable properties, or mapping to a property which is complex (a class). But be careful, if the class that you are deserializing into is not the original class, and it changes down the road, you could have some very “hard to pinpoint” bugs buzzing around your head and causing you headaches. Overall, the binary serialization method is usually more efficient, saving up to fifty percent in size when dealing with larger objects.
However, if you need to easily read the serialized data, just want to cut some corners in a most un-professional manner, and you are not concerned with bandwidth or performance, XML Serialization is for you. It is simply easier to read XML being sent from point A to point B than it is to read a binary stream, but it is much heavier.
From a practical standpoint, XML is terrific to use for debugging, when you are down in the trenches and on a tight timeline. Use XML Serialization throughout your code so that you can easily log an object and see its contents without clicking through a maze of pluses and minuses.
Use either, or use both methods of serialization when you need them. Ultimately, it will depend on your level of comfort, in tandem with the requirements around response time for your application.
From this point forward, armed with the valuable information that you read here, you will comfortably and appropriately answer the serialization question when it next rears its ugly head.
This post will, some day, be followed up with another explaining XML Serialization attributes and their undeniable, usefulness in XML Serialization.
Author: Tyler J
Article Source: EzineArticles.com
Provided by: WordPress plugin expert
Understanding XML Server
XML Server can be a Web Server that stores the XML files in it and serves them on demand. The XML Server would have processing capabilities with an XML engine and to transform the XML document to other forms. Basically a server which hosts and serves the XML documents is called a XML Server.
There are many commercially available XML Servers in the market. The popular among them are the Tamino Server, the Sonic Server and the FDX XML Server. Though the basic functions of these servers are same the way they are implemented and the features that they support varies.
The Tamino XML Server is from Software AG and is used to publish and exchange all kinds of data especially the XML documents in the native format. It handles open standards. Leveraging on the XML technologies will improve an organizations data access.
In traditional relational databases, data is stored in rows and columns which can be too complex. But in the case of an XML Server such complexity is avoided and any data can be stored which includes even multimedia files and even relational data. These data can be easily retrieved at lightning speed using a Tamino XML Server.
To retrieve data that is requested by any application, XQuery is used in Tamino XML Server. This server implements the XQuery specification draft. Hence queries on the server can be issued using the internet and data can be returned in any format by using XSL style sheets. Thus the customers can manipulate the format of presentation of the data that is presented using style sheets. High speed retrieval of data is possible in XML Server.
The Tamino XML Server is robust, reliable, and scalable. It is used in mission critical environments and there is almost no failure and loss of data. It is reliable in the sense it supports backup of data that can be stored in external devices or remote devices and used in clustered environments. The number of users can be increased and the load on the server can also be increased.
The document structure can take additional elements without changing the entire structure of the data store. These characteristics of the XML Server help it to be used in mission critical environments. Developers can develop XML applications very faster by using Tamino XML Server. It can be easily integrated with application servers.
FDX XML Server is another XML Server available in the market. This product is created by Snapbridge. This server is also used to create and deploy sophisticated XML applications. XSL, XSLT and scripts are supported in this server so that data can be transformed to any format requested by the user or any other application.
Sonic XML Server is another product from Sonic software which is built upon the native XML processing engine. This helps in pipelined processing of XML documents which eliminates the need for generating intermediate xml text file for processing. This improves the speed of the transaction dramatically.
We have seen that an XML Server is any server that gives an XML document as an output so that the other applications can use it for processing. The document can be delivered in any format using XSL and XSLT engines. It is possible for us to write some code in ASP which will serve an XML document to the user when they view that ASP page. We can store this code in a web server and this code can be said to be a very simple XML Server since it serves the user with an XML document. Go through the code given below:
<%
response.ContentType=”text/xml”
response.Write(““)
response.Write(“
response.Write(““)
response.Write(“
response.Write(“
response.Write(“
%>
Save the above code in your web server as book.asp and store it in the same directory where you stored your other web pages. Then view that page in the browser to see an XML document in display. In the above code you may note that the content type for the page is set to text/xml. This is why the output is displayed as XML file. You may develop a little more complex program to retrieve data from a database and generate an XML document from the data retrieved from the database. Thus you can start developing your own XML web server.
Author: Balaji B
Article Source: EzineArticles.com
Provided by: Electric Pressure Cooker