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

1 dom.validate.dtd

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

Exceptions

file [...] not found

The name of the file has not been specified.

Example

Validate a XML document against a DTD.

Copy
<xsql-script name='dom_validate_dtd_sample1'>
    <body>
        <set name='m_errors'>
            <dom.validate.dtd>
                <file.open name='movie.xml' temp='false' />
                <file.open name='movie.dtd' temp='false' />
            </dom.validate.dtd>
        </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>