Jump to content

XML import in an other XML


srini_w3

Recommended Posts

You're going to have to specify one of your XML elements as one that imports another file, then you start parsing the next file when you find one of those elements.Are you using Java or Javascript?

Link to comment
Share on other sites

I am using java code to parse. Can you please paste some sample xml files for importing a xml in another xmlThanks
There's no actual sample I can give that will actually work because you have to implement it yourself. I'm not sure why you would "import" XMl into another XML file, because it would result in two XML declarations.Here's a little example of how you could do it:
<?xml version="1.0" encoding="UTF-8" ?><root>  <element1>Value</element>  <customImportNode url="file.xml" /></root>

This isn't Java, it's just some example code that would be applied to any language.

function parseFile(filename) {	// Load the file by the filename argument	// Some parsing instructions	if(node.nodeName == "customImportNode") {		parseFile(node.getAttribute("file");	}}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...