mirror of
https://github.com/php/doc-ja.git
synced 2026-03-29 18:42:19 +02:00
102 lines
2.6 KiB
XML
102 lines
2.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 3eaa74fd7d5a3a6829fb12de89235970c8155dcf Maintainer: takagi Status: ready -->
|
|
<refentry xml:id="domdocument.validate" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>DOMDocument::validate</refname>
|
|
<refpurpose>
|
|
DTD に基づいてドキュメントを検証する
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool</type><methodname>DOMDocument::validate</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
DTD に基づいてドキュメントを検証します。
|
|
</para>
|
|
<para>
|
|
DTD による検証を行うには、<classname>DOMDocument</classname> の
|
|
<literal>validateOnParse</literal> プロパティを使用することも可能です。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
ドキュメントに DTD が添付されていない場合は、このメソッドは &false; を返します。
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>DTD による検証の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$dom = new DOMDocument;
|
|
$dom->load('book.xml');
|
|
if ($dom->validate()) {
|
|
echo "このドキュメントは正常です!\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
XML ファイルの読み込み時に検証することも可能です。
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$dom = new DOMDocument;
|
|
$dom->validateOnParse = true;
|
|
$dom->load('book.xml');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>DOMDocument::schemaValidate</methodname></member>
|
|
<member><methodname>DOMDocument::schemaValidateSource</methodname></member>
|
|
<member><methodname>DOMDocument::relaxNGValidate</methodname></member>
|
|
<member><methodname>DOMDocument::relaxNGValidateSource</methodname></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|