Data Island Woes

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Data Island Woes

Leon Bezuidenhout
Hi,

I am bust converting the javascript in a legacy IE app to work on Mozilla.
The App uses a lot of data islands in conjunction with AJAX. I change the
data island content by doing the following during run time.

dataisland.innerHTML =  whatever

This approach has been working really well. Untill I got XML with a caption
node in it. I attached a mockup of the code so you can see the problem. Is
there any workaround?

First prize for me would have been to rewrite the app, but it's not my call
and my manager reckons this is very doable.

Thanks


begin 666 modal.htm
M/"%$3T-465!%(&AT;6P@4%5"3$E#("(M+R]7,T,O+T141"!82%1-3" Q+C @
M5')A;G-I=&EO;F%L+R]%3B(@(FAT=' Z+R]W=W<N=S,N;W)G+U12+WAH=&UL
M,2]$5$0O>&AT;6PQ+71R86YS:71I;VYA;"YD=&0B/@T*/&AT;6P@>&UL;G,]
M(FAT=' Z+R]W=W<N=S,N;W)G+S$Y.3DO>&AT;6PB(#X-"CQH96%D/@T*(" @
M(#QT:71L93Y5;G1I=&QE9"!086=E/"]T:71L93X-"CPO:&5A9#X-"CQB;V1Y
M/@T*/%AM;"!S='EL93TB9&ES<&QA>3IN;VYE(B!I9#UT97-T/@T*(" @(#QR
M;V]T/@T*(" @(" @(" \4W5R;F%M93Y->4YA;65E964\+U-U<FYA;64^#0H@
M(" @(" @(#Q.86UE/DUY1FER<W1.86UE965E/"].86UE/@T*(" @(#PO<F]O
M=#X-"B \+UAM;#X-"CPO8F]D>3X-"CPO:'1M;#X-"CQS8W)I<'0@;&%N9W5A
M9V4]2F%V85-C<FEP=#X-"B @("!D;V-U;65N="YG971%;&5M96YT0GE)9"@B
M=&5S="(I+G1E>'1#;VYT96YT(#T@(CQR;V]T/CQT97-T/CPO=&5S=#X\0V%P
M=&EO;CY32$E4/"]#87!T:6]N/CPO<F]O=#XB.PT*(" @(&%L97)T*&1O8W5M
M96YT+F=E=$5L96UE;G1">4ED*")T97-T(BDN:6YN97)(5$U,*3L-"CPO<V-R
$:7!T/@``
`
end

_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Data Island Woes

Boris Zbarsky
Leon Bezuidenhout wrote:
> This approach has been working really well. Untill I got XML with a caption
> node in it. I attached a mockup of the code so you can see the problem. Is
> there any workaround?

Yes.  Two workarounds, at least:

1)  Don't name stuff in a tag-soup document with names that get parsed in
     special ways in HTML.
2)  Use an XHTML document, not a tag-soup one (by sending the XHTML MIME type).

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Data Island Woes

Leon Bezuidenhout
I'm not very clued up on this sort of thing

Do I do this by adding a !DocType at the top of my page?


"Boris Zbarsky" <[hidden email]> wrote in message
news:[hidden email]...

> Leon Bezuidenhout wrote:
>> This approach has been working really well. Untill I got XML with a
>> caption node in it. I attached a mockup of the code so you can see the
>> problem. Is there any workaround?
>
> Yes.  Two workarounds, at least:
>
> 1)  Don't name stuff in a tag-soup document with names that get parsed in
>     special ways in HTML.
> 2)  Use an XHTML document, not a tag-soup one (by sending the XHTML MIME
> type).
>
> -Boris


_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Data Island Woes

Boris Zbarsky
Leon Bezuidenhout wrote:
> I'm not very clued up on this sort of thing
>
> Do I do this by adding a !DocType at the top of my page?

No.  You already have a doctype.  If you're asking about how you "use an XHTML
document", you do it by making your web server send the page with an XHTML MIME
type, like I said in my mail.

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Data Island Woes

Leon Bezuidenhout
Hi,

OK, I tried it, but my Caption tags are still stripped from my data islands

Thanks,
Leon

"Boris Zbarsky" <[hidden email]> wrote in message
news:[hidden email]...

> Leon Bezuidenhout wrote:
>> I'm not very clued up on this sort of thing
>>
>> Do I do this by adding a !DocType at the top of my page?
>
> No.  You already have a doctype.  If you're asking about how you "use an
> XHTML document", you do it by making your web server send the page with an
> XHTML MIME type, like I said in my mail.
>
> -Boris


_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Data Island Woes I HAVE THE ANSWER :o)

Leon Bezuidenhout
In reply to this post by Boris Zbarsky
Previously I was doing the following

oDataIsland.innerHTML = sXML;

but if sXML hada  caption tag, it was stripped.

The solution as follows, parse the frikkin XML first :o)

var objDOMParser = new DOMParser();

var oXML =
objDOMParser.parseFromString("<root><Caption>TESTER</Caption></root>",
"application/xhtml+xml");

oX.appendChild(oXML.documentElement);

Works a charm :o)


_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Data Island Woes I HAVE THE ANSWER :o)

Boris Zbarsky
Leon Bezuidenhout wrote:
> Previously I was doing the following
>
> oDataIsland.innerHTML = sXML;

Which of course parsed it as HTML... which is not what you want.

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml