1
SAXパーサーでパス式を指定できますか?私はいくつかの同じ名前タグを持つXMLファイルを持っていますが、それらは異なる要素にあります。それらを区別する方法はありますか?SAXパーサーを使用すると、どのようにXMLファイルをJavaで解析するのですか?
<report id="322077">
<update>
<when>1136117311</when>
<what>[email protected]</what>
</update>
<update>
<when>1136117422</when>
<what>[email protected]</what>
</update>
</report>
<report id="322074">
<update>
<when>1136117311</when>
<what>[email protected]</what>
</update>
<update>
<when>1136117422</when>
<what>[email protected]</what>
</update>
</report>
<report id="322076">
<update>
<when>1136117311</when>
<what>[email protected]</what>
</update>
<update>
<when>1136117422</when>
<what>[email protected]</what>
</update>
</report>
http://stackoverflow.com/questions/1863250/is-there-any-xpath-processor-for-sax-model – rpfun12
を参照してください、それはあなたが使用することを必須となります。ここではXMLですSAXパーサ?構造体をナビゲートするのは、まずDOMに読み込む方が簡単です。次に、ノードの検索と処理に利用できるユーティリティー・メソッドがたくさんあります。 – sprinter
SAXパーサーを使用することは必須ではありません。どのように私はDOMでそれを行うことができます – sudo