Thanks Guys, but I would be unable to use XSLT. I know it sounds
strange but I still need to try to use XSD to create an XML. I have a doubt,
in the XSD below, i used the element iterator method as in the sample code,
I want to retrieve the name of the elements which is "Test1" and "Test2" ,
but am unable to find the function, I see getMethods for QName but not for
Element, maybe I missed it. The Attribute has attibute.getValue(), whats the
equivalent for Element? And James can I parse an XSD File with any parser
say SAX or DOM since it is in the form of XML?

XSD:   
      
      <xsd:element name="Test1">
                <xsd:complexType>
                        <xsd:attribute name="date" type="xsd:dateTime"
use="required"/>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="Test2">
                <xsd:complexType>
                        <xsd:attribute name="date" type="xsd:dateTime"
use="required"/>
                </xsd:complexType>
        </xsd:element>

CODE:
                                 // iterate through child elements of root
                                 for ( Iterator i = root1.elementIterator();
i.hasNext(); ) {
                                     Element element = (Element) i.next();
                                     System.out.println("Element Name");
                                     String url = element.WHAT_FUNCTION();
                                                 System.out.println(url);

                                     // do something
                                 }

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 11:58 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Re: [dom4j-dev] Extracting Information from XMLSchemas


Hi James,
Hi Krishnan,

I use a XSLT Stylesheet to generate a Document XML instance. Maybe you can
achive something similar using dom4j fine rule API.

:-)

Bye
Toby

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.If you are not 
the intended recipient, please contact the sender by reply e-mail and destroy all 
copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

                Visit us at http://www.cognizant.com

Reply via email to