XML Node, HTML Node

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alhalayqa

    XML Node, HTML Node

    hi guys,

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

    thanks .

  • Martin Honnen

    #2
    Re: XML Node, HTML Node

    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

    Comment

    • alhalayqa

      #3
      Re: XML Node, HTML Node

      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?
      >

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: XML Node, HTML Node

        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

        Comment

        Working...