我有一个名为MainFolder的文件夹,我希望将文件夹转换为XML表示,以便将文件夹中的每个文件编辑为单个文本文件。是否可以生成文件夹结构的XML表示,如此处所示,<file>
标记内的文件和folder
标记内的文件夹?
<folder name = "MainFolder">
<file name = "README.txt">
This is a text file inside a folder called MainFolder. This is the content
of README.txt.
</file>
<folder name = "Java samples">
<file name = "HelloWorld.java">
public class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World!");
}
}
</file>
</folder>
</folder>