Attribut internalSubset DOM XML
Définition et utilisation
L'attribut internalSubset peut retourner une chaîne de caractères contenant l'DTD interne (sans crochets界定),sinon il retourne null.
Syntaxe :
documentObject.doctype.internalSubset
Exemple
Dans tous les exemples, nous utiliserons les fichiers XML note_internal_dtd.xmlet les fonctions JavaScript loadXMLDoc()。
Le fragment de code suivant peut afficher l'DTD interne sous forme de chaîne :
xmlDoc=loadXMLDoc("note_internal_dtd.xml");
document.write(xmlDoc.doctype.internalSubset
);
Sortie :
<!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> <!ENTITY writer "Bill Gates"> <!ENTITY copyright "Copyright codew3c.com">