I would parse the xml with javascript and create a xhtml DOM equivalent,
then hide the original xml.

So you would parse your wigets xml and create the following DOM structure

<div class = "widgets">
  <div class = "tab" style = "left:0px;">Tab 1</div>
  <div class = "tab" style = "left:0px;">Tab 2</div>
</div>

then, if something changes in one, add the change to the other.

Or, another option would be to use xslt to transform the xml into xhtml.
Basically, you want to be working with xhtml not xml.



On Mon, May 16, 2011 at 10:18 AM, Jarek Foksa <[email protected]> wrote:

> All browsers are ignoring inline styles if they were applied to
> elements that belong to custom XML namespace. For example, in the code
> below "left: 0px" and "left: 50px" styles won't be applied to tab
> elements:
>
>    <widgets xmlns="http://my-custom-namespace.org/";>
>      <tab style="left: 0px">Tab 1</tab>
>      <tab style="left: 50px">Tab 2</tab>
>    </widgets>
>
> What would be the best way to work around this limitation?
>
> I was thinking about watching "style" property in each element, when
> it's added or altered I could dynamically generate corresponding rules
> in external stylesheet. For the code above, the generated rules would
> look like this:
>
> tab[style="left: 0px"] {
>  left: 0px;
> }
> tab[style="left: 50px"] {
>  left: 50px;
> }
>
> But watching hundreds of elements is going to have some negative
> performance implications. Do you have any better ideas how to
> implement this?
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to