Validate a XML document against a XSD (XML Schema Definition). The content of the XSD file can be obtained from a dictionary database indicating the database and the code of the object or pass it as argument to the function.

1 dom.validate.xsd

<dom.validate.xsd
    dict='dict'
    code='code'
    encoding='encoding'
>
    <xml /> !
    <xsd /> ?
</dom.validate.xsd>

Exceptions

file [...] not found

The name of the file has not been specified.

Example

Validate a XML document against a schema.

Copy
<xsql-script name='dom_validate_xsd_sample1'>
    <body>
        <set name='m_errors'>
            <dom.validate.xsd>
                <file.open name='movie.xml' temp='false' />
                <file.open name='movie.xsd' temp='false' />
            </dom.validate.xsd>
        </set>
        <iterator name='m_error'>
            <in>
                <m_errors />
            </in>
            <do>
                <println>Validate error at</println>
                <print><string.ht />line....:</print>
                <println><exception.getMethod name='getLineNumber'><m_error/></exception.getMethod></println>
                <print><string.ht />column..:</print>
                <println><exception.getMethod name='getColumnNumber'><m_error/></exception.getMethod></println>
                <print><string.ht />message.:</print>
                <println><exception.getMethod name='getMessage'><m_error/></exception.getMethod></println>
                <print><string.ht />systemId:</print>
                <println><exception.getMethod name='getSystemId'><m_error/></exception.getMethod></println>
            </do>
        </iterator>
    </body>
</xsql-script>