aspose file tools*
The moose likes XML and Related Technologies and the fly likes getChildren method returns 0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "getChildren method returns 0" Watch "getChildren method returns 0" New topic
Author

getChildren method returns 0

Sara Bony
Greenhorn

Joined: May 18, 2012
Posts: 18
Hi Dear All
For an xml file which its root has 25 children, getChildren method return list.size= 0 !!
java code:

XML file:


Any idea?

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
I don't know JDOM, but "id" and "runtime" are attributes of a <job> Element, not children so even if you got the Elements it would not work like you expect.

Bill
Sara Bony
Greenhorn

Joined: May 18, 2012
Posts: 18
William Brogden wrote:..., but "id" and "runtime" are attributes of a <job> Element, not children

Thanks a lot ,
i correct that.



But why getChildren method doen,t return 25 for list.size?

g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 544
    
    3
[0]
File xmlFile = new File("g:\\*");

Don't see how this might be proper with a wildcard like that? But you probably have a right file properly put there in your code.

[1]
But why getChildren method doen,t return 25 for list.size?

Your xml has rootNode in a default namespace and that jobs have that namespace inherited, you have to take that structure into account.

Sara Bony
Greenhorn

Joined: May 18, 2012
Posts: 18
g tsuji wrote:

...
[1]
But why getChildren method doen,t return 25 for list.size?

Your xml has rootNode in a default namespace and that jobs have that namespace inherited, you have to take that structure into account.


Thanks.
It works now.
 
 
subject: getChildren method returns 0