XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
praveen apSubject: JAVA and XML
Author: praveen ap
Date: 10 Nov 2008 06:22 AM
Hi,

I have a really big XML to handle (around 5000 lines).

Basically I need to read it and pass the data to UI.

It has a lot of tags and most of them have attributes.

The problem is I need to pass tag names, attribute names etc... to get the data.

If it were a small XML, i could have done it by passing the tag names and attributes names.

Now, I want to know if i can just do something like get the root tag , get its name, check if it has children, if yes then get the tag names and text. Check if the tags have attributes. If yes, get their name and values, and so on. I can then put the tag names, tag values , attribute names, attribute values and the text values in a collection class along with the tags heirarchy wrt the root tag(0 for root, 1 for root's children, 2 for its grandchildren...) and pass it to the UI.

Is there a way to do this?

Thanks in advance
Praveen

Posttop
Alberto MassariSubject: JAVA and XML
Author: Alberto Massari
Date: 10 Nov 2008 09:46 AM
If you need such a tight integration with Java code, you should use a SAX parser to read the XML file, and process the callbacks to populate the collection.

Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.