1
Ich benutze com.ximpleware und ich versuche, eine XML so zu analysieren:com.ximpleware Parse XML - XPath - Syntaxfehler nach oder am Ende ==>
<S2SCTScf:SCTScfBlkCredTrf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:S2SCTScf="urn:S2SCTScf:xsd:$SCTScfBlkCredTrf" xsi:schemaLocation="urn:S2SCTScf:xsd:$SCTScfBlkCredTrf file:///T:/CommonData%201/CBS/CBS%20Payments%20Team/Testing/XSD/SCT/SCTScfBlkCredTrf.xsd">
<CdtTrfTxInf>
<PmtId>
<EndToEndId>171766 12856615</EndToEndId>
<TxId>6022064LAS99</TxId>
</PmtId>
..............
</CdtTrfTxInf>
..............
</S2SCTScf:SCTScfBlkCredTrf>
und den Java-Code:
VTDGen vg = new VTDGen();
if (vg.parseFile("aaa.xml",true)){
VTDNav vn = vg.getNav();
AutoPilot ap = new AutoPilot(vn);
ap.bind(vn);
str = "/S2SCTScf:SCTScfBlkCredTrf/CdtTrfTxInf";
ap.selectXPath(str);
System.out.println(ap.evalXPath());
}
wirft mir einen Fehler:
Syntax error after or around the end of ==>
Exception during navigation com.ximpleware.XPathParseException: No URL found for prefix:S2SCTScf
Jede Idee, was soll ich meine XML nicht in der Lage sein zu ändern? Danke!
MIG, wenn Sie es mit VTD-XML-Tag, wäre es viel einfacher für mich, dir zu helfen –