Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

i had some xml file which contain lot of unnecessary information in it. so now i need to extract the required information from that xml. i heard that we need to write some xsd and use C# predefined class and use trasform function ....

what is the difference between xsd and xsl . whether xsd will generate automatically by writting xsl... i dint had any idea.please suggest me the procedure . i am struck up in extracting and generating xml with required information.
Posted

[Answering a follow-up question]
pasupulety wrote:
SQL
difference between xsl and xsd?

First of all, it's best to understand that the questions like "what is the difference between {0} and {1}?" are logically incorrect. What is the difference between apple and Apple? Please see my past answer:
what is the difference between the class and encapsulation in programming[^].

See also this discussion on asking a good question:
How to ask a good question?[^].

Now, you should understand that XSL operated on some really existing XML files. It presents the XML data is some other form, and it can do it with data loss, duplication, etc. This is just a way to transform data. Basically, it is used to create a different representation of XML data, typically in a human-readable form (such as HTML), but not always. Please see:
http://en.wikipedia.org/wiki/XSL[^].

In contrast, XSD does not have to do anything with individual XML files. It really defined a whole class of such files, or, in other words, the set of constraints; and each of possible XMLs may or may not be compliant with it. It defined the metadata defining the class of compliant files. In a way, it defined some semantic language based on XML as on a media. Please see:
http://en.wikipedia.org/wiki/XSD[^],
http://en.wikipedia.org/wiki/Metadata[^].

—SA
 
Share this answer
 
Comments
ProEnggSoft 29-Mar-12 1:29am    
+5
Sergey Alexandrovich Kryukov 29-Mar-12 10:51am    
Thank you.
--SA
XSD is an XML schema document, defining the structure of your XML. They're nice to have, but not generally necessary to get the job done. XSL is stylesheet language, and what you're probably looking for is an XSLT, which transforms one document into another as specified by the transform file. XSLT is pretty simple once you get the hang of it--Michael Kay's books are great, or start here: http://www.w3schools.com/xsl/xsl_intro.asp
 
Share this answer
 
Comments
pasupulety 28-Mar-12 13:55pm    
difference between xsl and xsd?
woopsydoozy 28-Mar-12 14:04pm    
answer's above: xsl changes or manipulates data, xsd defines data's structure
Sergey Alexandrovich Kryukov 28-Mar-12 21:50pm    
Not quite exactly, not quite clear.
Please see my answer.
--SA
Xsl - is used to tranform the xml doc.i.e Adding new nodes and Removing new nodes etc..

xsd - is used to validate xml document.Like datatype, range validation
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900