PHP DOM: Mevcut DOMDocument değişikliği dokumantipi

0 Cevap php

Bir DOMDocument oluştururken DOMImplementation::createDocument() , you can specify a doctype as the third argument in the constructor. This doctype then gets "tied" to the document and you can retrieve it later with $document->doctype.

Ancak, bu (kodlama ve sürümü aksine!) Salt okunur bir niteliktir.

Varolan DOMDocument nesnenin doctype özelliğini değiştirmek için herhangi bir yolu var mı?

Aklıma tek çözüm yeni doctype ile yeni bir DOMDocument oluşturabilir ve içe sonra eski birinden içeriği karşısında kopyalamak için.

0 Cevap