Sorry that i didn't describe what i want to do clearly.
No, what I want to do isn't replacing all < with < and > with >.
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.
what's more, I want the method to be something like "intelligent XSD parser" so that not only you can pass in a Customer xsd, you can also pass in a Product xsd, a Country xsd or other xsd, the method will return a corresponding html. So the following example is really just an example,
For example,firstly convert the following xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Address" type="xs:string"/>
<xs:element name="Orders" type="Orders"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Orders">
<xs:sequence>
<xs:element name="Order" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="OrderID" type="xs:int"/>
<xs:element name="ShipCountry" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
to the following HTML:
<div>
<p>Name:<input type="text" id="name" /></p>
<p>Address:<input type="text" id="address" /></p>
</div>
<table style="width: 100%;">
<tr>
<td>
OrderID
</td>
<td>
ShipCountry
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
What really matters most is the chance to communicate with you, my friends, rather than marking my post as answer, though I would be really appreciated if you do so.
ASP.NET 3.5 MCTS