Hi,

I?m created an extension to modify the DTD in a page. But I?m having some
dificultes.

I?m get it, using this code:

var DOM = dw.getDocumentDOM();
var Document = DOM.documentElement.outerHTML;
var insert = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';
DOM.source.replaceRange(0, Document..indexOf('<html>'), insert);

of course, that is a piece of my code.

The code above function perfect. But only when a page doesn?t have a DTD in it.

With the page contain the DTD the code above, don?t function.

To change the DTD in a page I need to have something like it:

DOM.source.replaceRange(0, Document..indexOf('<html
xmlns="http://www.w3.org/1999/xhtml">'), insert);

Exist some comand to DW identify if this attribute
(xmlns="http://www.w3.org/1999/xhtml") exist or somethink like it?

I could place a checkbox to user check, with the page has or not a DTD, but it
dont will be good for the user.

Some idea?