こんにちは私はJavaで小さなクラスを作成してxmlファイルを文字列として読み取りましたが、私の質問は次のとおりではありません:文字列を追加してPhysical_Order_List_Arrayタグの間にあるものだけを出力する方法
ここにJavaクラスがあります:
public static String getFileContent(String fileName)
{
BufferedReader br = null;
StringBuilder sb = new StringBuilder();
try {
br = new BufferedReader(new FileReader(fileName));
try {
String s;
while((s = br.readLine()) != null)
{
sb.append(s);
sb.append("\n");
}
}
finally {
br.close();
}
}
catch (Exception ex) {
ex.printStackTrace();
}
return sb.toString();
}
これは非常に大きなxmlファイルの一部です:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
.....
.....
.....some content
....here is what I only need
<Physical_Order_List_Array>
....now I need to get this portion of the code, append string to only output what is beetween these tags, including these tags as well
</Physical_Order_List_Array>
.....
.....
.....
ご回答ありがとうございます