Saturday, 17 January 2015

XML DTDs Compared to XML Schema

XML is great for holding and communicating data between diverse systems along with browsers, it is completely platform independent this also makes it well suited for storing and transporting data across the internet.

By the use of an example concerning how adaptable and extremely versatile XML is, you are able to connect with web services by using say a Microsoft .net framework using a UNIX system written in C. However, in order for it to work you require a blueprint that will explain to both systems, the construction of the xml data or document, typically this is by way of some kind of schema or dtd.

The schema or dtd will probably specify the composition or layout of the xml file so that it can easily be read or parsed with the receiving system, eventually xml is a meta language so can not accomplish this specific function on it's own.

There's two main advantages to this, the first is that this means that your data will make it beyond the parsing phase as the construction has already been agreed and that helps you to get rid of any data that is not supposed to be there. The second thing is, it’s simpler for developers to understand what can be obtained as the protocol standard is documented.


About DTD, Document Type Definition

DTD is short for document type definition and as previously stated, the a means of telling other systems design and makeup of the xml file, in order for the acquiring system knows what to expect and thus it can easily interrogate the acquired xml data to verify that what is received is actually what is expected.

For example, the dtd will specify the elements which are being contained in the document and the attributes of the elements, as well as the ordering and nesting of those elements.

The dtd is called in or bundled by a development expression known as “declared”, the dtd is declared using what known as a DOCTYPE declaration beneath the XML declaration inside the xml document.

The dtd can be included inline or externally, inline as the name signifies is inside the xml document itself, in contrast to an external is outside of the xml document.

You will find advantages and drawbacks to both methods however inline is better should your documents are going to be saved and made use of offline.


About XML Schemas

Xml schemas are an advancement around the dtd method and for that reason widely thought to be a greater and a lot more potent method, in actual fact schemas also are xml files with their own DTD and do the job by referencing the XML Schema Namespace

XML Schemas supply a group of basic types, they include most basic computer programming types such as integer, byte, string and floating point numbers, but they also expand into Internet data types which include ISO country and language codes (en-GB for example).

The author of an XML Schema then uses these core types, along with various operators and modifiers, to create complex types of their own. These complex types are then used to define an element in the XML Document.

Tuesday, 23 December 2014

The features as well as benefits of XHTML

XHTML represents Extensible HyperText Markup Language, and its in fact an evolution based upon normal HTML, it’s purpose was also intended as a path in the direction of inevitable XML migration hence the X component.

For this reason XHTML will be displayed as a hybrid of HTML and XML.

Part of the XML family of mark-up languages XHTML docs are well formed because of the mark-up rules and tag rules and so can also be parsed by XML parsers, which is in contrast to HTML which was at all times part of the Standard Generalized Markup Language (SGML).

Before examining the benefits associated with XHTML, its worth quickly explaining the intention of SGML, HTML and XML.

SGML is a language for describing markup languages, specially those employed in electronic document exchange, document management, and document publishing. HTML is an illustration of a language defined in SGML.

HTML is an SGML (Standard Generalized Markup Language) application conforming to International Standard ISO 8879. HTML is generally regarded as the common publishing vocabulary of the World Wide Web, HTML tags hold semantic meaning and are predefined.

XML is the shorthand name for EXtensible Markup Language. XML is a markup language just like HTML and was meant to identify information. XML tags usually are not predefined. You will need to define your own tags based on your needs.

In terms of syntax, it’s very much like HTML and pretty much all valid HTML elements are also valid in XHTML, however there are numerous particular points to note to ensure your HTML document is absolutely XHTML certified, these points also apply when generating new XHTML documents.

•    You must compose a DOCTYPE declaration at the beginning of the XHTML document.
•    You should generate all XHTML tags and attributes in lower case only.
•    You have to quote every one of the attribute values.
•    Attribute minimization is not allowed.
•    The id attribute swaps with the name attribute.
•    The language attribute of the script tag is deprecated.

So right now let’s explore the characteristics of XHTML before we look at the actual positive aspects.

Firstly, XHTML is an recognized and official W3C standard which means that all internet browsers will be compliant, and has built-in support for XHTML, this can be of serious appeal to web developers.

A valid XHTML document, mainly because it utilises XML syntax and markup, needs to have 1 of 3 DTD’s, this ensures that all the XML data comprised within the XHTML is valid and also conforms to the proper logic and type as outlined in the DTD such as adequately closed and nested xml tags.

Finally, XHTML files may also be backward suitable for non XHTML compliant internet explorer due to stricter syntax rules.

This affords the benefits that follow;

Internet pages are more inclined to render perfectly around a number of browsers such as new and old web browsers.

It's also easier to preserve, edit, convert and format your file as the need comes up, in the future.

As a result of consistent and perfectly structured format of XHTML, your online pages may be parsed and processed effortlessly.

XHTML specifies quality standard to your internet sites and if you go along with that, then your web pages are counted as quality web pages. The W3C confirms those pages using their quality seal of approval.

Sunday, 16 November 2014

XML DTDs Versus XML Schema

XML, short for eXtensible Markup Language, is a markup language that helps you communicate files between diverse systems, web browsers and also software without blunders or compatibility problems.

For instance, XML permits you to manage to send out data between unix along with windows type systems for example web services based upon Microsoft’s .net architecture. But it’s imperative that you stress that XML is a mark-up language rather than a programming language, so XML isn't going to by itself function commands, it's just a meta language which transmits data in a methodized file format.

Additionally the exchange to work the data has to be in a composition that's agreed by both devices ie the sender as well as the recipient, otherwise the exchange won't work as well as the recipient system will return a mistake as a result of invalid data, typically this is regarded as a parsing error.

There are a selection of ways for which you can indicate the structure of your XML data, the 2 main options are an XML Schema or a DTD file.

A DTD, Document Type Definition, is a set of markup declarations that comprise a document type for an SGML-family markup language (SGML, XML, HTML). A Document Type Definition (DTD) describes the legal constructing blocks of an XML document.

It describes the document composition with a listing of legal elements and attributes. DTD is also the original standard, outlined within the W3C's XML standard. The DTD standard is all but obsolete currently, replaced by the W3C's XSD standard.

The DTD is asserted in a DOCTYPE declaration under the XML declaration contained within an XML document:

The actual body of the DTD itself incorporates definitions concerning elements and their attributes.

One other technique is referred to as an XML Schema, that is a more robust approach to determine your xml document framework.

An XML schema definition language is generally an instrument for creating schemas. A schema really is a file suitable for denoting the structure, content and semantics related with an XML document. Many schema definition languages are available for use. The DTD (or Document Type Definition) language appeared to be quite popular with the XML community although has mainly been obsolete by XSD (or XML Schema Definition) language.

XSD is usually recommended and also conserved via the web standards body, W3C. As opposed to DTD, XSD is definitely itself coded in XML (that is why, extensible), contains support for data-types as well as namespaces and is usually far more extensive.

An XML schema describes the elements along with attributes which go into the XML doc, their data-types and default values (if any). It describes which elements are child elements, the order and also the volume of them. Moreover it identifies whether or not an element is empty or could include written text. An XML file isn't required to possess a schema declaration however, when one is supplied it will probably be utilized to validate the XML document against the above requirements.

Saturday, 25 October 2014

XML and the future of technical writing

XML had been originally released to address some of the constraints with HTML in moving and storing data on web pages and also over the web. However as the technology grew to become more widely adopted and used, other ways to use XML emerged, due to the flexibility and versatility.

In particular, XML has flourished in publishing and in technical documents and technical writing, this is because XML tags aren't semantic as opposed to HTML tags are, this means you may produce your own tags for whatever objective you like, this really is ideal in technical writing.

So not only is XML increasingly being extensively implemented within technical writing however it looks set for being the future of technical writing as well as documentation online.

There are a variety of essential reasons over the above which are driving this particular future.

The most significant is the demand to publish once without the need to publish many times for many different devices, platforms, formats and the like. This is certainly one of XML’s key strengths since it is not fixed or tied to any platform, browser, device etc, what this means is XML is certain to be readable on nearly anything.

On top of this, you may connect CSS style sheets in your XML data to style up your documents or content any way you like, this offers a lot more flexibility for web publishers along with coders as well, which means you can actually show your content precisely how you desire it to appear across pretty much any viewing configuration ie Mac or PC, tablet or laptop, or mobile phone, or Android or Apple or IE9 or Firefox, this is certainly hugely powerful, and simply no other solution comes anywhere near delivering these kinds of compatibility and versatility.

Another factor to consider, that is tightly connected to the first, as it originates from the benefit of being able to publish just once, is the cost saving related to having the ability to just publish once. For sizeable publishers with dedicated specialists teams for print and web, the financial savings may very well be considerable.

No longer will they need to double up on employees and resources to have one team to write in print and yet another to create online on websites, the same content material can be used for both, attainable due to flexibility of XML.

Your able to use just about any plain text editor including notepad or even a specific XML editor to generate your XML files, to create XML documents for publishing you can use Adobe FrameMaker and have it set to structured mode.

Adobe describe their FrameMaker software as “ a complete solution for authoring, enriching, managing, and publishing technical documentation. Author with best-in-class XML/DITA and DTD support. Manage content using out-of-the-box integration with leading content management systems and Dropbox. Collaborate with PDF-based reviews, even on mobile devices. Easily publish to multiple channels, formats, and screens natively from within FrameMaker 12 at no extra cost, without any plug-ins.”

As superb as Adobe FrameMaker is, a dedicated XML Editor can offer superb adaptability for working with xml with superior editors offering xml schema editors and even validation for your xml and schema, this enables you to produce xml code more quickly along with minimum blunders.

Wednesday, 17 September 2014

Encrypting XML Data

If you utilize xml and have xml data you need to understand that must be quite possible to have xml encrypted, actually the W3C, the body given the task of handling and also developing the xml standard have a standard for xml encryption.

The process involves encrypting an xml as well as child elements and after that swapping out the original content with the subsequent encrypted xml, whilst ensuring that the documents remains to be valid and well formed from an xml perspective.

With regards to the encryption itself, you will have three choices, symmetric encryption, a mixture of asymmetric and symmetric encryption and thirdly, X.509 Certificate encryption.

The 1st way, symmetric encryption is where you operate the same key to encrypt and decrypt the xml, the key should be stored securely and loaded during the time of use as the key is not kept with the file, care is required to be taken that the key is not jeopardized.

Accomplishing this itself involves replacing the xm content (elements) with an encrypted tag i.e. <EncryptedData>, this will likely contain the encrypted elements.

The second option, utilizing a combination symmetric and asymmetric conversion, the symmetric key is employed to encrypt the xml data while an asymmetric key is employed to encrypt the symmetric key itself. The asymmetric key works with a public and private key, a public key to encrypt the key as well as a private key to decrypt the key. Both symmetric and asymmetric keys are held and saved in the xml record itself.

Doing this itself is rather simple assuming you have a basic programming background and includes creating a CspParameters object and indicating the name of the key container then creating a symmetric key making use of the RSACryptoServiceProvider class.

The third method is make use of X.509 certificates through third party vendors for example VeriSign therefore called X.509 Certificate Encryption, the procedure works as follows.

The xml data is encrypting using two keys. A test X.509 certificate is created by using a Certificate creation tool (Makecert.exe) and this created certificate is stashed into a “certificate store”. The certificate will then be programmatically recovered and used to encrypt an XML element making use of the standard Encypt method ie <EncryptedData> element. Internally, the Encrypt method produces a separate session key and makes use of it to encrypt the XML document. This procedure encrypts the session key and saves it in addition to the encrypted XML inside of a new <EncryptedData> element.

Regardless which process you decide on, it’s imperative that you point out that your encrypted data can be held in two different methods, alternative one you are able to switch your entire element with all the encrypted clement <EncryptedData>, or alternative two only the data in the element is substituted with <EncryptedData>.

Even though on face value their may well not seem like a tremendous amount of difference between the two, nothing might be further from the truth, while using the first approach might be a costly blunder if for example you wanted to encrypt data and read the child elements later on, in such a case option 2 would be better as you may still read the attributes for example.

Whenever using xml feel free to use just about any text editor for instance notepad, nonetheless commercial and free xml editors can be found which help you to generate semantically correct xml whilst providing a great many superior benefits for the more regular xml developers. A extensive listing of xml editors can be found at http://www.xml-editor.info

Sunday, 17 August 2014

Using XML with DOM, Good and bad points

XML is actually a meta markup language containing its own set of tags, permitting richly arranged documents to be transmitted and presented over the web. Just before this web developers had the usage of HTML and SGML to showcase website content on the internet, however both SGML and HTML had a variety of constraints which made them inappropriate and in reality limited with regards to lots of the then promising technologies and calls for of the net, like displaying rich and dynamic data.

XML is a bit more suitable simply because its much more accommodating than HTML or SGML, hence the X, which symbolizes Extensible, for this reason XML is needed for displaying rich data since its more suitable than its nearest alternatives.

In fact XML contains a number of advantages for web designers and developers alike, these kinds of positive aspects include firstly and most clear of all, content owners can produce their own custom docs a result of the flexibility of being able to make custom tags. XML tags do not carry semantic meaning so programmers can create their own tags. This isn’t likely with XML or SGML.

Secondly, the other big advantage, as mentioned already, is the fact content like hyperlinks can be displayed in a much richer format due to the sophisticated features and functionality of XML in comparison with HTML.

XML offers much more superior facilities in the manner content is presented in web browsers not to mention terrific developments in functionality in particular in relation to dynamic content.

The main reason for this boils down to compression powers, XML is organized very well which makes it quite simple to compress, this amount of order and structure just isn't present in ordinary text and so XML offers a faster browsing experience.

Together with the good points already mentioned, its also correct to mention several of the disadvantages of XML, which although not substantial, its vital that you mention for sake of completeness.

The most obvious and well known of such weaknesses is that XML could be rather large and verbose from a programming viewpoint, and that's why in the subject of web services JSON is becoming incredibly popular to the detriment of XML.

However this doesn't have to be a major issue, it all depends on what you intend to employ XML and ways in which you want to work with it. Another point to note is that there exists nonetheless a lot of disparity in terms of criteria and interoperability etc. Because of the many different technologies and also the rapidly changing nature of XML there are still gaps between XML related technologies including XSL and XSLT.

In relation to working with DOM. Microsoft have provided an MSXML parser which lets you load and parse your XML files, this takes a lot of the pain away from working with XML. The parser functions by showing your XML file as a DOM (Document Object Model), this lets you gather specifics of the xml file, to govern it also to navigate through the file, elements, attributes etc.

To summarize, there are a number of strengths and weaknesses to XML and employing DOM parsers is a fantastic way to parse XML files, you can also use XML tools, which save you time whenever using XML.



Friday, 18 July 2014

Making use of XML, XSLT and also ASP

XML is a markup language which was initially considered by a group of programmers working for IBM back in the 1980’s, however back then it had been known as SGML, later as the digital era began it evolved into XML.

The goal of XML was to allow for documents and data to be transported over the internet and available, to do this and much more, programmers realised that much more functionality was needed.

What was required was the capacity to transform XML documents into different outputs like HTML, PDF etc, so that it could offer more functionality and flexibility than it could possibly deliver back then.

The programmers were acutely aware that applications which could work with XML would ultimately also need to display or structure that information or data in different formats that could not be specified in the XML document itself.

The thing that was called for was a answer that might accept the XML data and change it into other formats, like HTML as well as further developments into other forms of XML so that it may very well be applied to any platform or with any other programming language.

The builders developed a method called XSLT (Extensible Stylesheet Language Transformation), XSLT has been widely successful permitting non XML related technologies such as ASP, HTML and a lot more to work with XML language.

With the web getting increasingly mobile and cross device, it has enabled XML to be utilized by a wide range of devices across various platforms and browsers, and from mobiles, to laptops, to tablets to PC’s and more.

There's also additional benefits, by way of example with XSLT, you can now also transform the structure of XML documents, that is ideal when the data will not fit with the applications data structure requirement, with XSLT you simply transform the structure of the XML document to correspond with the requirement of the application.

So how does XSLT work what is the process for changing XML documents? Well you'll find two primary pieces, the first component is that you must parse your xml file, using a parsing engine.

Parsing is where the XML document is loaded into a tree structure. The second element is where the tree structure will be further optimised for XSLT processing and is influenced by the processor type, ie whether it’s a SAX or DOM processor.

It’s also important to observe that in order to process XML files, XSLT relies on templates so that it may make specific structures, on this matter, the W3C states;

A stylesheet contains a set of template rules. A template rule has two parts: a pattern which is matched against nodes in the source tree and a template which can be instantiated to form part of the result tree. This allows a stylesheet to be applicable to a wide class of documents that have similar source tree structures.

The benefit of making use of templates is the fact its adaptable and also efficient and also a excellent means of processing different XML structures. There certainly are a wide variety of free and commercial xml tools that can also process your xml files that also feature built-in SAX or DOM processors and can accomplish XSLT transformations.