Re: XML in XHTML
- From: Duncan Booth <duncan.booth@xxxxxxxxxxxxxxx>
- Date: 1 Dec 2005 08:53:49 GMT
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).
.
- Follow-Ups:
- Re: XML in XHTML
- From: John W. Kennedy
- Re: XML in XHTML
- References:
- XML in XHTML
- From: interfaced
- XML in XHTML
- Prev by Date: Re: Dynamic DIV and P creation offsets the P
- Next by Date: Re: Dynamic DIV and P creation offsets the P
- Previous by thread: Re: XML in XHTML
- Next by thread: Re: XML in XHTML
- Index(es):
Relevant Pages
|