hi,
im trying to get information out of an xml file and i have to use DOM. i havnt found any tutorials on the net that are any good.
if any of ye know of any good ones that would be appreciated.
this is the structure of the file.
in the above xml file:
many Roles
one role name
many config details
one config name
one permissions
many permission names
ive set up a documnetBuilderFactory.
ive set up a Document object that stores the various elements of the xml file.
im using eclipse to debug it and the the object contains all the information i need.
the problem im having is i cant find any way to gather this information.
i can find the information by using
ive set up a few loops that will find the ROLENAME's.
the problem im having using this method is that i cant get the children specifically to the role name e.g. SuperAdministrator and find the config details and the permissions specific to that rola name.
thanks for your help
im trying to get information out of an xml file and i have to use DOM. i havnt found any tutorials on the net that are any good.
if any of ye know of any good ones that would be appreciated.
this is the structure of the file.
Code:
<?xml version='1.0' encoding='UTF-8'?>
<ROLEDEFINITIONS>
<ROLE>
<ROLENAME>SuperAdministrator</ROLENAME>
<CONFIGDETAILS>
<CONFIGNAME>Administrator</CONFIGNAME>
<PERMISSIONS>
<PERMISSIONNAME>Create</PERMISSIONNAME>
<PERMISSIONNAME>Modify</PERMISSIONNAME>
<PERMISSIONNAME>Delete</PERMISSIONNAME>
<PERMISSIONNAME>Details</PERMISSIONNAME>
<PERMISSIONNAME>List</PERMISSIONNAME>
</PERMISSIONS>
</CONFIGDETAILS>
<CONFIGDETAILS>
<CONFIGNAME>Designer</CONFIGNAME>
<PERMISSIONS>
<PERMISSIONNAME>Create</PERMISSIONNAME>
<PERMISSIONNAME>Modify</PERMISSIONNAME>
<PERMISSIONNAME>Delete</PERMISSIONNAME>
<PERMISSIONNAME>Details</PERMISSIONNAME>
<PERMISSIONNAME>List</PERMISSIONNAME>
</PERMISSIONS>
</CONFIGDETAILS>
</ROLE>
<ROLE>
<ROLENAME>SuperDesigner</ROLENAME>
<CONFIGDETAILS>
<CONFIGNAME>Designer</CONFIGNAME>
<PERMISSIONS>
<PERMISSIONNAME>Create</PERMISSIONNAME>
<PERMISSIONNAME>Modify</PERMISSIONNAME>
<PERMISSIONNAME>Delete</PERMISSIONNAME>
<PERMISSIONNAME>Details</PERMISSIONNAME>
<PERMISSIONNAME>List</PERMISSIONNAME>
</PERMISSIONS>
</CONFIGDETAILS>
</ROLE>
<ROLE>
<ROLENAME>SuperUser</ROLENAME>
<CONFIGDETAILS>
<CONFIGNAME>Administrator</CONFIGNAME>
<PERMISSIONS>
<PERMISSIONNAME>Modify</PERMISSIONNAME>
<PERMISSIONNAME>Details</PERMISSIONNAME>
<PERMISSIONNAME>List</PERMISSIONNAME>
</PERMISSIONS>
</CONFIGDETAILS>
<CONFIGDETAILS>
<CONFIGNAME>Designer</CONFIGNAME>
<PERMISSIONS>
<PERMISSIONNAME>Modify</PERMISSIONNAME>
<PERMISSIONNAME>Details</PERMISSIONNAME>
<PERMISSIONNAME>List</PERMISSIONNAME>
</PERMISSIONS>
</CONFIGDETAILS>
</ROLE>
</ROLEDEFINITIONS>
in the above xml file:
many Roles
one role name
many config details
one config name
one permissions
many permission names
ive set up a documnetBuilderFactory.
ive set up a Document object that stores the various elements of the xml file.
im using eclipse to debug it and the the object contains all the information i need.
the problem im having is i cant find any way to gather this information.
i can find the information by using
Code:
String strRoleNameTAG = "ROLENAME";
NodeList ndLstRole = doc.getElementsByTagName(strRoleTAG);
ive set up a few loops that will find the ROLENAME's.
the problem im having using this method is that i cant get the children specifically to the role name e.g. SuperAdministrator and find the config details and the permissions specific to that rola name.
thanks for your help