By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,847 Members | 2,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,847 IT Pros & Developers. It's quick & easy.

XML Node, HTML Node

P: n/a
hi guys,

how can distinguish between XML Node and HTML Node, using attributes or
method ..

thanks .

Jan 9 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
alhalayqa wrote:
how can distinguish between XML Node and HTML Node, using attributes or
method ..
In the XML DOM nodes do not have an id property or a className property
while in the HTML DOM nodes do have those properties.
On the other hand there are specializations of the XML DOM like the SVG
DOM where id or className are properties too. Thus if you parse XML with
namespaces with browsers like Mozilla or Opera the parser recognizes
namespaces like the XHTML 1 namespace or the SVG namespace and you get
XHTML elements or SVG elements having id and className properties.

What exactly is it that you want to achieve?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 9 '08 #2

P: n/a
well,
I am try to overwrite the setAttribute, getAttribute properties for only HTML
Nodes(only Element Nodes) and not for the XML Nodes. since the two properties
are defined for both XML,HTML Nodes, I just want to handle those for HTML
Node and return the default case for Non HTML Nodes.

thanks,
Martin Honnen wrote:
>how can distinguish between XML Node and HTML Node, using attributes or
method ..

In the XML DOM nodes do not have an id property or a className property
while in the HTML DOM nodes do have those properties.
On the other hand there are specializations of the XML DOM like the SVG
DOM where id or className are properties too. Thus if you parse XML with
namespaces with browsers like Mozilla or Opera the parser recognizes
namespaces like the XHTML 1 namespace or the SVG namespace and you get
XHTML elements or SVG elements having id and className properties.

What exactly is it that you want to achieve?
Jan 9 '08 #3

P: n/a
alhalayqa wrote:
I am try to overwrite the setAttribute, getAttribute properties for only HTML
Nodes(only Element Nodes) and not for the XML Nodes.
Bad idea. The owner objects are host objects.
[Top post]
Please don't do that. http://jibbering.com/faq/
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Jan 9 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.