Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recursive inclusion

Status
Not open for further replies.

ThomasOatman

Programmer
Joined
Nov 28, 2005
Messages
3
Location
US
I would like to create a hierarchical (nested) tree of xml files – one includes another, includes another.
Something like so:
AllTests
Suite1
TestCase1
TestCase2
Suite2
TestCase3
TestCase4

Using the ENTITY tag I am able to include Suite1 and Suite2 into the AllTests.xml. But then I get an error inside Suite1 on the DOCTYPE tag so it can’t include a file on its own.

I am very new at XML but I’ve been searching a lot – the only way I find to even include one XML into another is with the external entity. Is there another way? Does it support the nested inclusion I am trying to accomplish?


What I’ve done so far is just create my own <include file=”testcase1.xml” /> and have the app open the sub-xml and do another parse. But I was hoping to just have the parser (TinyXML/Xerces) do all the inclusion and spit out one object tree for the whole mess.

-thomas
 
You cannot do this with XML on its own. You'll need to use DOM or XSL.

Jon

"I don't regret this, but I both rue and lament it.
 
Thank you for the reply.

Any more details on how to get started or the syntax in the xml file?

I am actually using the Xerces DOM api (just starting). I was thinking to use the callback and when I see an include element to kick off another (recursive) parse and replace the include element node with a document node for the nested file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top