Wednesday, March 14, 2012

Understanding XML Schema - XSD

XML Schema - An XML schema describes the structure of an XML document.
XML schema language also referred as XML schema definition(XSD).
XSD is XML based alternative of DTD(Data Type Definition).

Basics
1. Defines elements of document.
2. Defines attributes of document.
3. Defines which elements are child elements.
4. Defines no. of child elements and order of child elements.
5. Defines an element is empty or can have text.
6. Defines data types for elements and attributes.
7. Defines Default and fixed values for elements and attributes.
8. W3C recommendation.

XSDs are successor of DTDs because
1. XSDs are richer, more powerful and extensible in future.
2. Written in XML.
3. Support data types.
4. Support namespaces.

Why XSDs are recommended
1. XML format - Platform independent.
2. Extensible - Own data types can be created based on standard data types, other schemas can be referenced in a schema, a document can have references of multiple schemas.
3. Support data types - Can be define allowable contents, makes data type conversion easy.
4. Secure data communication - Both ends having data structure.

Example

Simple XML document

<?xml version="1.0"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

Friday, March 2, 2012

Understanding XPath

XPath is a language to find information in an XML document.



* XPath is a syntax for defining parts of an XML document
* XPath uses path expressions to navigate in XML documents
* XPath contains a library of standard functions
* XPath is a major element in XSLT
* XPath is a W3C recommendation

Understanding XSLT

XSLT(eXtensible style sheet language transformations) is a language to transform a XML document into XHTML document or other XML document.

CSS = Style sheet for HTML document
XSL = Style sheet for XML document

When we open XML document in any browser it opens as it is in text form. Because XML has user defined tags (not predefined) and browser don't know how to display that.
We can create XSLT for any XML document so with the help of XSLT browser understand how to display given XML.

* XSLT stands for XSL Transformations
* XSLT is the most important part of XSL
* XSLT transforms an XML document into another XML document
* XSLT uses XPath to navigate in XML documents
* XSLT is a W3C Recommendation

Thursday, March 1, 2012

Understanding XML

XML is hardware and software independent tool to store and transport data.
XML stands for eXtensible markup language.
XML is a W3c consortium recommendation.
XML is a markup language much like HTML.
XML designed to store and carry data not to display data.
XML designed to be self-descriptive.
XML tags are not predefined, you must define your own tags.

Example
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Lucky</to>
<from>Mukesh</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

FACTS about XML

1. XML is designed to store and transport data and HTML designed for displaying data.
2. XML doesn't do anything its just designed for structure, store and transport data.

CI/CD - Safe DB Changes/Migrations

Safe DB Migrations means updating your database schema without breaking the running application and without downtime . In real systems (A...