- From: Martijn Pieters <mj@digicool.com>
- Date: Thu, 22 Mar 2001 09:19:22 +0100
- To: Dylan Schiemann <dylans@yahoo.com>
- Cc: Jeff Yates <pbwiz@pbwizard.com>, www-DOM@w3.org
On Wed, Mar 21, 2001 at 07:16:07PM -0800, Dylan Schiemann wrote: > --- Jeff Yates <pbwiz@pbwizard.com> wrote: > > At the beginning of every XML document there is a > > <?xml version="1.0" ?> > > tag. Is there a way to get this version number from > > within DOM? I know at > > this time there is only one version number, but in > > the future there may be > > more. > > I would think that it would be an attribute of that > node. So > document.childNodes[index].getAttribute("version") > would do the trick, assuming a correct implementation. A correct implementation does not model the <?xml version="1.0"?> tag; it is not a Processing Instruction (even though some DOM implementations have modelled the XML declaration as a PI Node). Besides, a PI doesn't have attributes. This isn't available in DOM level 2 at all. DOM level 3 does give access to the information given in the XML declaration through attributes of the Document Interface: Document.version Document.encoding Document.standalone -- Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ ---------------------------------------------
Received on Thursday, 22 March 2001 03:19:30 UTC