xsl-list
[Top] [All Lists]

xslt for xsd (schema)

2005-10-10 17:50:02
I am trying to write an xslt code that will flatten my schema document. A simple example:

Schema document

<xs:element name="product1">
<xs:complexType>
<xs:sequence>
<xs:choice>

<xs:element name="amount" type="Amount"/>
<xs:element name="dimension" type="Dimension"/>

</xs:choice>
</xs:sequence>
</xs:complexType>
</element>

<xs:element name="Amount" type="xs:double"/>
<xs:element name="Dimension>
<xs:attribute name="length" type="xs:double"/>
<xs:attribute name="width" type="xs:double" use= "optional"/>
</xs:element>

I want to go through all the nodes and generate a text file of all the information (name, data type, enumeration, Path information) for all the attributes and elements under product1 to the lowest node, so that I don't have to refer to my schema document everytime I want to write an XML document for product1.

Sample output wanted

Name, vnml_type, data_type, vnml_path
amount,element,double,product1/amount
length,attribute,double,product1/Dimension
width,attribute,double,product1/Dimension

Has anybody done it before. Any suggestions or are there any software or freeware available to do this. Thanks in advance.

Vikash

_________________________________________________________________
Don?t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>