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

I have a .XSD file, i want to convert it in to HTML file and save that file some where for further use. can any body tell me how to do this. I am new to VC++/MFC if possible with code explain me.

Thanks in Adavnce
Posted

The elements of an xml schema forms a tree of nodes, based on an object model.

For the .Net platform this object model is realised in the System.Xml.Schema Namespace[^].

You will need to transform the various objects into an html representation suitable for the object type - and as there is a lot of them, it's definitely not a trivial exercise.

Regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Mar-11 17:22pm    
Good and useful, my 5. I still think that my explanation point our the most principal thing: a conceptual mismatch in indefinite character of the problem, please see.
--SA
Espen Harlinn 16-Mar-11 17:29pm    
While definitely not the best way to present his question - you'll find the question midway through http://forums.asp.net/t/1400134.aspx - that's why he asks you "please go through this" :)
Sergey Alexandrovich Kryukov 16-Mar-11 18:11pm    
Sorry to disagree: I saw it and still think it is still makes no sense, unless someone explains the value of it which may be there but left completely without any rationale.
--SA
Espen Harlinn 16-Mar-11 18:19pm    
I'm not sure what sense it makes but here goes:

I want to display the xsd's "hiberarchy" rather than the "rules" in this way:

start from the root element, for each of the child element & attribute:

1.if the element's attribute't type or child element is xsd's built-in type such as int,string,bool, the attribute will be

displyed as a text input(for int & string) html or radiobutton(for bool).

2.if the element's child element's type is complex type, do step 1 until all element's type is xsd's built-in type.

I want to implement this logic in a class's method so that whenever a xsd as the method's parameter is passed in, the method

return a html segment that displys the hiberarchy of the xsd.
Sergey Alexandrovich Kryukov 16-Mar-11 19:05pm    
My response is below (sorry, a bit misplaced)
--SA
Not that it is impossible; it makes no certain sense. In other words, you Question does not define any sense in which such "conversion" (what an improper term!) should be done.

XSD (XML Schema Definition) is a way to describe the meta-data schema. For example, it can be used to describe HTML standard (strictly speaking, only XHTML). HTML represent data which should be written in a way compliant with (X)HTML standard. In other words, one single XSD is supposed to describe a whole big set of different XMLs (theoretically, infinite but countable set). We came to conceptual mismatch.

However, any meta-data is a sort of data, and XSD is not an exclusion, it is itself is written in XML, and any XML can be rendered as some mark-up, which is possible to be implemented as HTML and rendered the way one can read and understand XSD as a schema. Warning: this is just an example of naive "conversion" which is no way the only solution serving any particular purpose (except showing the XSD in a human-readable way); the "real" purpose is unknown to me; and your Question suggests that you don't clearly understand it yourself.

Replace all '<', '>' and '&' characters by HTML character entities &lt;, &gt; and &amp;, respectively and sandwich the contents of the XSD file in <pre></pre> tags. That's it.

—SA
 
Share this answer
 
v2
Comments
savita_Bgm 16-Mar-11 2:09am    
http://forums.asp.net/t/1400134.aspx please go through this, this is exactly same as my problem
Sergey Alexandrovich Kryukov 16-Mar-11 3:21am    
This article does not explain what I have just explained, they just say, use XSLT. Well, just use it, big deal! The problem is not the tool, the problem is that you don't know what should be in your result, or don't answer. Not even a sample of manually written XSD and HTML. This is the only issue. You reference does not add a bit to it.
Honestly, do you have any idea on what should be your result?
--SA

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