Hi everybody,

I'm trying to compose XML documents for SEPA transactions via BaseX.
I would like to check certain data against the corresponding schema before 
putting them into the document, e.g. BIC identifiers.

In the xsd, there's a simpleType definition for BICs:
                <xs:simpleType name="BICIdentifier">
                               <xs:restriction base="xs:string">
                                               <xs:pattern 
value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
                               </xs:restriction>
                </xs:simpleType>

I hoped it would be as simple as

declare default element namespace 
"urn:iso:std:iso:20022:tech:xsd:pain.001.003.03";
let $node := <BIC>GEN0DEM1MPW</BIC>
return if(string($node) instance of BICIdentifier) then (true() (: process... 
:)) else (false() (: report error :))

But, as I learned now, BaseX doesn't support import of schemas. Thus, I receive 
the error message "Unknown type: 
Q{urn:iso:std:iso:20022:tech:xsd:pain.001.003.03 }BICIdentifier".

Is there some workaround (other than rebuilding regular expressions from schema 
to xquery)?

Best regards,
Ulrike.

Reply via email to