Topic: Validating OFX XML using the schema?
Has anyone ever validated an OFX 2.1.1 XML file that conforms to the PDF specification using the schema? It doesn't seem possible to me.
The schema, as written, uses a localized (hidden) namespace for most elements, such as SIGNONMSGSRSV1. However, the OFX element is globally declared, so it can't be localized. Therefore the only way I can find to get an OFX file to validate is to add a namespace directive and use it only on the OFX tags:
<ofx:OFX xmlns:ofx="http://ofx.net/types/2003/04"> <SIGNONMSGSRSV1> ... </SIGNONMSGSRSV1> </ofx:OFX>
This clearly contradicts the OFX 2.1.1 PDF specification. However, I've tried two different validators (xmllint from libxml2 and the online validator at http://www.w3.org/2001/03/webdata/xsv ) and both give errors when bare <OFX> tags are used. For example, when validating the example statement on page 317 of the specification, xmllint gives:
$ xmllint --noout --schema OFX2_Protocol.xsd /tmp/statement_example.xml /tmp/statement_example.xml:1: element OFX: Schemas validity error : Element 'OFX': No matching global declaration available for the validation root. /tmp/statement_example.xml fails to validate
Is the schema wrong, is the specification wrong, or am I missing something? Any insights would be appreciated.