473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XML Node, HTML Node

hi guys,

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

thanks .

Jan 9 '08 #1
3 1592
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Robert Mark Bram | last post by:
Hi All! In the code below, I am reading in an xhtml document and attempting to use selectNodes to find a <p id="rmb"> node.. But the result is: 2 - */* 0 - */p Can anyone suggest what I...
6
by: Kabeer | last post by:
Hi All, In my .h file I give definition as typedef struct node { struct node *next; /* Points at the next node in the list */ struct node *previous; /* Points at the previous node in...
8
by: J Peterman | last post by:
Im having a nightmare trying to understand these nodes and linked lists. I've posted my code for my node.h, node.cpp, linkedlist.h and linkedlist.cpp files in separates replies. Can someone...
1
by: chris yoker | last post by:
hiya, I succesfully return a "nodeList" thru the "xmlDoc.SelectNodes" method. This nodeList is taken from a repetitive, uniform xml doc. I can successfully append a child node at the correct...
4
by: Lukasz Indyk | last post by:
hello;) i have a piece of html code, and want to replace every image on my page with this code. now i do it by replacing IMG node with SPAN node, and then setting innerHTML property of SPAN node...
8
by: Ryan Stewart | last post by:
Putting the following code in a page seems to make it go into an infinite loop unless you give it a very simple node to work with. Either that or it's very very slow. I'm somewhat new to this,...
5
by: Patient Guy | last post by:
In my reading of the Strict and Transitional DTD for HTML 4.0, the table row (TR) elements are contained within table section elements: THEAD, TFOOT, and TBODY. The table section elements are...
2
by: bissatch | last post by:
Hi, I am currently writing a simple PHP program that uses an XML file to output rows for a 'Whats New' page. Once written, I will only require updating the XML file and any pages that use the...
16
by: Joel Byrd | last post by:
I am having this ridiculous problem of trying to set the innerHTML of a div node. It works in all other browsers, but internet explorer is giving me an "Unknown runtime error". This is actually...
0
by: HP17 | last post by:
Hi all, I am a bit desperate already trying to display a XML file using XSLT. I create a table and use <xsl:for-each> to extract every element node. This is working fine. What I want now is so...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.