Hi i'm trying to insert xml node from one xml document to another xml document.for that i'm trying to follow te below code.I'm unable to proceed b'coz the documentbuilderfactory is not regonized.is ther any namespace I've to add or wht amI missing.
As far as I see,I only searched on Google and found that it's realted to Java?
If yes,you can go directly to http://www.java-forums.org/forum.php and ask your java questions,Microsoft cannot obey the responsibility for another company's products for the problems of policy of laws。
Best reguards!
Marked as answer by srividhyavathi on Dec 09, 2011 07:49 PM
srividhyavat...
Member
92 Points
281 Posts
help on DocumentbuilderFactory
Dec 06, 2011 05:17 PM|LINK
Hi i'm trying to insert xml node from one xml document to another xml document.for that i'm trying to follow te below code.I'm unable to proceed b'coz the documentbuilderfactory is not regonized.is ther any namespace I've to add or wht amI missing.
<div></div>DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder(); Document tournament = builder.parse(new File("b.xml")); Document tournaments = builder.parse(new File("a.xml")); Node tournamentElement = tournament.getFirstChild(); Node ndetournament = tournaments.getDocumentElement(); Node firstDocImportedNode = tournaments.adoptNode(tournamentElement); ndetournament.appendChild(firstDocImportedNode); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.transform(new DOMSource(tournaments), new StreamResult(System.out));Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: help on DocumentbuilderFactory
Dec 08, 2011 01:36 AM|LINK
Hello:)
As far as I see,I only searched on Google and found that it's realted to Java?
If yes,you can go directly to http://www.java-forums.org/forum.php and ask your java questions,Microsoft cannot obey the responsibility for another company's products for the problems of policy of laws。
Best reguards!