Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Ho can I print child from XML file

843834Apr 9 2008 — edited Apr 9 2008
I'm trying to print the child of one parent..it's not working I don't have no clue...bello is the code and the XML
DocumentBuilderFactory aronXml = DocumentBuilderFactory.newInstance();
DocumentBuilder aronText = aronXml.newDocumentBuilder();
Document aronDoc = aronText.parse (new File("XML/"+"laPartieWord.xml"));

 NodeList tagSolution = aronDoc.getElementsByTagName("solution");

/* HOW TO GET CHILD OF SOLUTION*/
Here is the XML file
<?xml version="1.0"?>

<aaron1 lettres="DEORSU" 
xmlns="com.ingenioquebec.dyna01.dictionnaire"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="com.ingenioquebec.dyna01.dictionnaire laPartieWord.xsd">

	<solution>
		<mot3 mot="DOS"/>
		<mot3 mot="DOS"/>
		<mot4 mot="DUSF"/>
		<mot4 mot="DUVF"/>	
		<mot6 mot="NTISRO"/>	
	</solution>
	
	
	<dictionnaire>
		<mot3 mot="DES"/>
		<mot3 mot="DES"/>
		<mot4 mot="DECV"/>
		<mot4 mot="CLAY"/>
	</dictionnaire>
	
</aaron1 >	
	
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2008
Added on Apr 9 2008
1 comment
93 views