Anyone knows why xml.Parse.fromString() won't prop...
# suitescript
w
Anyone knows why xml.Parse.fromString() won't properly parse the xml when the first tag is a <Document xmlns="urn:iso...etc..." xsi:schemaLocation="urn:iso...etc">? If I remove the attributes xmlns, xmlns:xsi xsi:schemaLocation from the Document-tag it gets properly parsed.
Found in SA that you need to change the XPath when the xml has a namespace. But I can't get it to work either.
I want to select all Stmt-nodes in below camt.053:
Copy code
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02 camt.053.001.02.xsd" xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>">
	<BkToCstmrStmt>
		<GrpHdr>
			<MsgId>XXXXXX</MsgId>
		</GrpHdr>
		<Stmt>
			<Acct>
				<Id>
					<IBAN>XXXXXXXXXXXXXXXXXXXXX</IBAN>
				</Id>
		</Stmt>
		<Stmt>
		...
		</Stmt>
		<Stmt>
		...
		</Stmt>
	</BkToCstmrStmt>
</Document>
This worked:
/*/*/*[name()='Stmt']