Home | Login | Blog | Forum | Download | RSS Feed | Ajax | Hello-World | J2EE | BPM | EJB | FileNet | Hibernate | ORM | IBM | ILOG | Interview | FAQs |

Java | Apache | JVM | Others | BRMS | Oracle | Pega | SOA | Sun-Certification | Web-Service | websphere | XML |
 

JAVA DEVELOPER SITE - COMPLETE JAVA TUTORIALS

Difference between XSD and XSLT.


Share
 
 

Useful Java Links


       


Lets Start with the definitions first:

XML: XML is nothing but a NODED string.

XSLT is a declarative programming language, you write an XSLT stylesheet to transform XML to HTML or XML or plain text.

XSD is a schema language, you use it to define the possible structure and contents of an XML format. A validating parser can then check whether an XML instance document conforms to an XSD schema or a set of schemas.

Consider the below code to know more about the format of XML, XSD and XSLT.

Below is an example of a XML file: (person.xml)

<Persons xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Person>
        <FirstName id="1">Kavita</FirstName>
        <LastName>Khandhadia</LastName>
    </Person>
    <Person>
        <FirstName id="2">Nishant</FirstName>
        <LastName>Khandhadia</LastName>
    </Person>
</Persons>

The above XML has been derived from the below schema file ( XSD File)

 Now for above example there can be an XSD file like this.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="Persons">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Person"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Person">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="FirstName"/>
        <xs:element ref="LastName"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="FirstName">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:NCName">
          <xs:attribute name="id" use="required" type="xs:integer"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="LastName" type="xs:NCName"/>
</xs:schema>

Now supppose in some case, instead of above person.xml, u want customer.xml which
 takes data from person.xml but has totally different structure ..may be like this.


<?xml version='1.0' ?>
<Cusotmers>
    <Customer>Kavita</Customer>
    <Customer>Nishant</Customer>
</Cusotmers>

In such cases we use XSLT file. to transform person.xml to customer.xml(Above) - We use XSLT.

 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
    <Cusotmers>
    <xsl:for-each select="Persons/Person">    
        <Customer><xsl:value-of select="FirstName"/></Customer>
        </xsl:for-each>
    </Cusotmers>
</xsl:template>

</xsl:stylesheet>

In this way, we have




Download Latest Java/J2EE eBooks, SCJP Dumps, SCWCD Dumps, Pega Tutorial, IBM WebSphere BPM tutorials and many more


If you need any urgent assistance on what-is-the-difference-between-xml-xsd-and-xslt, kindly email your requirement to us at : info@javagenious.com or Contact-an-Expert. Our experts will try their best to solve your problem.

You can also subscribe to our newsletters on what-is-the-difference-between-xml-xsd-and-xslt, to receive updates on what-is-the-difference-between-xml-xsd-and-xslt,via email.Enter you email below:

Enter your email address:

Delivered by FeedBurner



Keyword Tags: what-is-the-difference-between-xml-xsd-and-xslt tutorial,what-is-the-difference-between-xml-xsd-and-xslt in java,Concepts of what-is-the-difference-between-xml-xsd-and-xslt,Java,J2EE,Interview Questions,what-is-the-difference-between-xml-xsd-and-xslt Examples


Comments:


Post Your Comment:

*

Yes, I would like to recieve email notifications on my reply.

Popular Posts:

 
Popular Downloads

SCJP 1.6 Dumps
JSP Interview Questions
Struts Interview Questions
Hibernate Interview Questions
SCWCD Dumps
SCBCD Dumps

Java/J2EE Tutorial
JMS Tutorials
seam richfaces tutorial
richfaces live demo
jquery example demo
JQuery Tutorial and Source Code
JSF Tutorial
XSL Tutorial
J2EE JMS
CORBA Applications
Java CERTIFICATION
SCJP 1.5
SCJP 1.6
SCWCD 1.5
SCBCD
Mis
Ajax autosuggest autocomplete from database
Struts forms and validation with webflow
Java Apache POI Examples
JDBC Tutorial
Oracle 9i & 10g
MYSQL Tutorial
php Tutorial
JQuery Examples
Upload Java File
JAXB Examples
PL-SQL Tutorial
Dojo AJAX
EJB Examples
Java IDE
Eclipse
NetBeans
IBM Rational Weblogic Workshop
Downloads
SCJP 1.6 Dumps
SCJP 1.5 DUMP
SCJP Material
SCWCD
Java Security
SCBCD Dumps
External Links
SUN Java
JOracle
IBM
PHP Certification
Technical Interview Questions
Amazon Interview Questions
Google Interview Questions
Microsoft Interview Questions
IBM Interview Questions
Yahoo Interview Questions
All Tutorials
php mysql tutorial
SCJP 1.5/1.6
SCWCD 1.5/1.6
Polymorphism
Thread Tutorial
Generics & Exceptions
Spring Struts Hibernate
Java Collections
MAP
SET
LIST
VECTOR
Advanced Java
Stateless Session Bean
Introduction to EJB
Stateful Session Bean
Java Design Patterns
HOME | FORUM | ABOUT | BLOGS | CONTACT-US