私はこの種のXMLを持っています:
<?xml version="1.0" encoding="UTF-8"?>
<documentAnswer xmlns="http://schemas.pkh.hr/doc/2013/documents/rda_30" domainName="rda" domainVersion="3.0">
<answerTimestamp>2013-08-21T13:35:25.894</answerTimestamp>
<correct>
<docId>RDA2_29F81D27-1409BE49E2E-7FF8</docId>
<attachments>
<attachment>
<format>application/pdf</foraat>
<generatedType>StampanNaBlanko</generatedType>
<encodedPdf>JVBERiYKJSVFT0YK</encodedPdf>
</attachment>
</attachments>
</correct>
これらの添付タグは、1 つ以上にすることができます。Javaで添付タグのNodeIteratorを取得しようとしています
XPathAPI.selectNodeIterator(node, "/documentAnswer/correct/attachments/attachment")
そして繰り返しますが、私は成功していません。問題は xpath にあり、名前空間に関連していると推測していますが、解決方法がわかりません。この種の xpath を試してみましたが、成功しませんでした:
XPathAPI.selectNodeIterator(node, "/rda:documentAnswer/correct/attachments/attachment", "rda", " http://schemas.pkh.hr/doc/2013/documents/rda_30 ")