Re: XML in XHTML



wrote:

> My problem is that javascript is understanding the nodes in my xml
> document as html elements.
>
><xml>
> <book>
> <title>Lord of the Rings</title>
> </book>
></xml>
>
> If I parse this, the title element cannot be extracted and the page
> title(in the browser) becomes "Lord of the Rings".
> Is there a way to exclude this xml node from the xhtml rules?

I take it you have embedded this as an 'xml data island' inside your HTML.
The <xml> tag inside HTML is a Microsoft extension and although other
browsers give the appearance of supporting it (since unknown tags generally
just end up inside the DOM as/is) they don't actually recognise the
contents as anything other than more HTML tags to parse.

For most tags this still works fine, but not for tags such as <title> or
<style> which browsers such as Mozilla/Firefox will move from the document
body to the head in a desparate attempt to correct your HTML for you.

The solutions include using tag names which don't conflict with HTML tag
names, putting all your tags in a different namespace, or loading the xml
separately (which is best if there it is more than just a few tags).
.



Relevant Pages

  • Re: word webpages
    ... The ther are som tags with no closing tags DreamWeaver would remove what ever was causing these problems. ... Just create a simple document and save as HTML Make sure it has some type of formatting. ... XML all versions ...
    (microsoft.public.mac.office.word)
  • Re: Getting NASM from C
    ... > format we were going to edit it in... ... all XML is? ... HTML is a specific "subset" of XML for displaying ... it's a text file with "tags" inside ...
    (alt.lang.asm)
  • Re: parsing in python
    ... > a text from an oracle database that contains different tags that have to ... > texts in Python? ... > to increase the readability of the generated HTML source. ... parse text strings in Python. ...
    (comp.lang.python)
  • Re: [ANN] HTMLTemplate 1.0.0
    ... >>develops the XML elements for the layout. ... to implement) and EZT templates and ... ... > code-up your own tags and sprinkle them throughout your HTML. ...
    (comp.lang.python)
  • Re: Parsing DOM with Javascript
    ... >>My problem is that i need an algorithm parse parse HTML. ... implies simply parsing HTML tags. ... an array element. ...
    (comp.lang.javascript)