[previous was a missfire, this post is complete]

Unless I'm missing the point, to get "Test1" from 
xsd:element name="Test1"
you would call:

   String url = element.attributeValue("name");

To see which element you are in, you would call:

    element.getQName();

Laramie

--- "Krishnan, Archana (Cognizant)" <[EMAIL PROTECTED]> wrote:
>       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
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to