0

I am learning XML and I am trying to create a XML file for a test input. The XML file must provide a test name and a list of files to be tested. I am not sure which XML structure is better suited for this among the two:

<?xml version="1.0"?> <test> <name>Test987575454</name> <file>File1.cpp</file> <file>File2.cpp</file> <file>File3.h</file> </test> 

or

<?xml version="1.0"?> <test name="Test987575454"> <file>File1.cpp</file> <file>File2.cpp</file> <file>File3.h</file> </test> 
1
  • It doesn't matter... I like 2th way (values in attributtes) because it's shorter. Commented Jan 28, 2012 at 8:57

1 Answer 1

1

It depends on your requirement, i'e what type of XML parser you will use. Generally your first example is a good way to structure a XML file.

Sign up to request clarification or add additional context in comments.

1 Comment

Well I am using some C++ code to parse the XML. Thanks for the clarification I too was biased for the first structure.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.