*
The moose likes XML and Related Technologies and the fly likes XML extract unknown Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML extract unknown Tag" Watch "XML extract unknown Tag" New topic
Author

XML extract unknown Tag

Gorge Stephens
Greenhorn

Joined: Feb 14, 2011
Posts: 2
Hello all,

I quite a beginner with XML and I don't understand how to retrieve an unknown tag. Below is a small sample.

I am able to pull out most of the information that I need however I don't have any idea how to pull out the tag names that I won't know ahead of time.

In the sample below I want to get "fields" and "tos" extracted with the data (old and new) but I won't know their names to put in the xsl. Is this possible to do?

Thanks for any help.

George


Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

It isn't going to be possible to do something which you can't describe. That's a basic rule of programming.

It's quite possible you will be able to do what needs to be done, but first you have to describe what needs to be done. I don't see any such description in your post. So, your first step is to describe the requirements. If the element names are unpredictable then that's the way it is, and you'll have to get a description of the requirements which doesn't use element names.
Gorge Stephens
Greenhorn

Joined: Feb 14, 2011
Posts: 2
Thanks for taking the time to reply. I think I get your meaning here.

Best regards,

George
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

That's good. You can do lots of things with XSLT. If you run into problems when you start implementing your proposed solution, the Ranch is here to help you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML extract unknown Tag
 
Similar Threads
problem calling static method using OGNL
Mapping to an xml typed column (PostgreSQL) on an EJB3 entity in JBoss 5.1
MultiDimenaional Array sort
how to implement dynamic rows paging when user clicks next or previous links
CODE: Dynamic Sorting on Multiple Indexes