mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 01:42:09 +01:00
198 lines
3.7 KiB
XML
198 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 715a125af5a86f0e6d6d5aa6cfa9c45257a433ac Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="tidynode.ishtml" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>tidyNode::isHtml</refname>
|
|
<refpurpose>
|
|
Indique si le nœud est une nœud d'élément
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool</type><methodname>tidyNode::isHtml</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Indique si le nœud courant est un nœud d'élément,
|
|
mais pas le nœud racine du document.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne &true; si le nœud est un nœud d'élément, mais pas le nœud racine
|
|
du document, &false; sinon.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>7.3.24, 7.4.12</entry>
|
|
<entry>
|
|
Cette fonction a été corrigée pour avoir un comportement raisonnable.
|
|
Auparavant, la plupart des nœuds était rapporté comme étant un nœud
|
|
HTML.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Extrait du code HTML depuis un document mixte</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$html = <<< HTML
|
|
<html><head>
|
|
<?php echo '<title>title</title>'; ?>
|
|
<#
|
|
/* code JSTE */
|
|
alert('Hello World');
|
|
#>
|
|
</head>
|
|
<body>
|
|
|
|
<?php
|
|
// code PHP
|
|
echo 'hello world!';
|
|
?>
|
|
|
|
<%
|
|
/* code ASP */
|
|
response.write("Hello World!")
|
|
%>
|
|
|
|
<!-- Comments -->
|
|
Hello World
|
|
</body></html>
|
|
Outside HTML
|
|
HTML;
|
|
|
|
|
|
$tidy = tidy_parse_string($html);
|
|
$num = 0;
|
|
|
|
get_nodes($tidy->html());
|
|
|
|
function get_nodes($node) {
|
|
// Vérifie si le nœud courant est du type demandé
|
|
if($node->{isHtml()) {
|
|
echo "\n\n# Noeud Html #" . ++$GLOBALS['num'] . "\n";
|
|
echo $node->value;
|
|
}
|
|
|
|
// Vérifie si le nœud courant a des enfants
|
|
if($node->hasChildren()) {
|
|
foreach($node->child as $child) {
|
|
get_nodes($child);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
# Noeud html #1
|
|
<html>
|
|
<head>
|
|
<?php echo '<title>title</title>'; ?><#
|
|
/* code JSTE */
|
|
alert('Hello World');
|
|
#>
|
|
<title></title>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
// code PHP
|
|
echo 'hello world!';
|
|
?><%
|
|
/* code ASP */
|
|
response.write("Hello World!")
|
|
%><!-- Comments -->
|
|
Hello WorldOutside HTML
|
|
</body>
|
|
</html>
|
|
|
|
# Noeud html #2
|
|
<head>
|
|
<?php echo '<title>title</title>'; ?><#
|
|
/* code JSTE */
|
|
alert('Hello World');
|
|
#>
|
|
<title></title>
|
|
</head>
|
|
|
|
|
|
# Noeud html #3
|
|
<title></title>
|
|
|
|
|
|
# Noeud html #4
|
|
<body>
|
|
<?php
|
|
// code PHP
|
|
echo 'hello world!';
|
|
?><%
|
|
/* code ASP */
|
|
response.write("Hello World!")
|
|
%><!-- Comments -->
|
|
Hello WorldOutside HTML
|
|
</body>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|