| Author |
including file paths in XML
|
Yell Srik
Ranch Hand
Joined: Mar 10, 2004
Posts: 61
|
|
Hi, consider the code given below, <?xml version="1.0" encoding="UTF-8"?> <userchoice> <user userID="Joe" pd="Soap" profession="student" level="user"> Sam </user> <user userID="Dude" pd="Dude" profession="programmer" level="user"> Peter </user> <user userID="James" pd="sunny skies" profession="sales" level="admin"> Martin </user> </userchoice> the above example XML file is a file from which data is read by a JSP page. in the above example, i want to know how is it possible to include a entire file instead of a name ie for example, is this right, <user userID="D:\mydocuments\name.txt" pwd="Soap" profession="student" level="user"> Joe </user> if it is wrong, how can represent an entire file path in a XML file. thanks in advance.
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
The XML parser doesn't care what the attribute's value is (whether it's a file path, a random string, or a number) as long as the character's are legal. In short, the example you posted is perfectly valid XML.
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
 |
|
|
subject: including file paths in XML
|
|
|