Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

parsing xml with java

Hi,
Can anyone show me example of parsing XML with jerichohtml parser?
Now I can print all tags with:
private static String getSth(StreamedSource source) {
            Iterator i = source.iterator();
		while (i.hasNext()){
                    
                    System.out.println(i.next());

                }
		

		return null;
	}

Open in new window

0
static86
Asked:
static86
  • 2
  • 2
1 Solution
 
static86Author Commented:
thanks,
I've tired displaySegments(source.getAllTags(StartTagType.XML_DECLARATION)); which prints first line but still I don't know how to display what is inside given tag.
Lines:
displaySegments(source.getAllStartTags("TagNameHere")); returns nothing:/
displaySegments(source.getAllTags());  gives me list of tags.
I just need to display value of given tag.
0
 
objectsCommented:
whats the data look like?

why use jericho btw?  Have you tried support already providded by java
http://helpdesk.objects.com.au/java/how-to-load-xml-document-from-url
0
 
CEHJCommented:
Are you using this parser because you have server-side tags?
0
 
static86Author Commented:
thanks,i used sax parsers instead.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now