Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 608265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:26:40+00:00 2026-05-13T17:26:40+00:00

I’m developing an application that uses ubiquity-xforms. Previously I had been serving the pages

  • 0

I’m developing an application that uses ubiquity-xforms. Previously I had been serving the pages up as text/html with the XHTML 1.0 doctype.

If I switched the mime-type to application/xhtml+xml, I would see a pretty big performance improvement, because the javascript could use the get____NS() functions, instead of what it’s doing now (slowly iterating through the entire DOM tree every time it needs to select an element).

But when I tried this, a bunch of my CSS stopped working. I noticed that when I inspected the elements, either in Firebug or in the WebKit Nightly Web Inspector, the point of failure were ‘.classname’ and ‘#id’ css selectors on elements in the XFORMS namespace. I also noticed that in the listed DOM properties for those elements they were lacking both ‘id’ and ‘className’ attributes.

My question is, is there a way that I can get the UA to recognize these as classes and ids?

Things I’ve tried, to no avail:

  1. specifying the “id” attributes as ID in an inline doctype’s ATTLIST
  2. trying every doctype I could, or no doctype at all
  3. qualifying the id and class name attributes in the xhtml namespace (ie. xhtml:id)

Here’s some sample xhtml. Doesn’t work in either Firefox 3.5 or Safari 4 / WebKit Nightly

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xf="http://www.w3.org/2002/xforms">
<head>
    <style type="text/css">
    /* <![CDATA[ */
    #test {
        background-color: red;
    }
    .testing {
        color: blue;
    }
    /* ]]> */
    </style>
</head>
<body>
    <xf:group id="test" class="testing">Test</xf:group>
</body>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:26:40+00:00Added an answer on May 13, 2026 at 5:26 pm

    Frankie,

    porneL’s answer is right — in XHTML mode you have to use different CSS rules, because there is nothing ‘special’ about @id an @class.

    Even armed with this knowledge, your problems aren’t over though. 🙂

    The temptation might be to just put HTML and XHTML CSS selectors together, and apply them to the same rule:

    @namespace xf url(http://www.w3.org/2002/xforms);
    
    xf\:input.surname, xf|input[class~="surname"] {
      color: green;
    }
    

    However, a further problem is that IE will ignore the entire rule, because it doesn’t like the XHTML syntax. So littered through Ubiquity XForms you’ll see things like this:

    @namespace xf url(http://www.w3.org/2002/xforms);
    
    xforms\:hint.active, xf\:hint.active {
      display: inline;
    }
    
    xf|hint[class~="active"] {
      display: inline;
    }
    

    As you can see we’ve had to repeat the styling with different selectors. (This is something we’re hoping to address with a function that will abstract out the style-setting task. Then you’ll only have to write one rule.)

    Note a couple of extra things:

    • that the HTML rules are using ‘:’ as a literal character (hence the ‘\’ to escape), and know nothing of namespaces;
    • the XHTML CSS rules use the ‘~=’ operator, which means that the attribute must contain the value specified, rather than be exactly equal to it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 319k
  • Answers 319k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Taken from the documentation on Cache Configuration: The following attributes… May 14, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer A table is a collection of columns and rows. You… May 14, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer Assuming you're wanting to use a class to handle all… May 14, 2026 at 12:10 am

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.