Re: Esoteric XHTML question about href



Grant Robertson wrote:

I don't know much about XHTML. I am trying to design an XML standard
where content authors can use HTML or XHTML for the content within an
element.

That isn't possible - unless the HTML is going to be entered in CDATA
sections or encoding with character references.

Within the above mentioned XHTML content I want authors to be able to
insert an href to refer to a graphic without knowing what file type that
graphic will be.

href="http://www.example.com/foo/someImage";

.... and then the server can deliver up whatever you like.

I want them to be able to point instead to a separate
list of alternative files and the first file in the list will be
displayed if possible. If the browser can't display that first file then
it will try the next until it finds one it can display.

<object data="foo.gif" type="image/gif">
<object data="foo.jpeg" type="image/jpeg">
<object data="foo.png" type="image/png">
<object data="foo.svg" type="image/svg+xml">
<p>Alternative content.</p>
</object>
</object>
</object>
</object>

.... has been fine since HTML 4.0 ... shame about the browser support though.

2)The alternatives aren't listed in the original content. They are
listed in a separate file that can be modified without changing the
original content at all.

Can this be done in XHTML at all?

Not with pure HTML.

Can it be done with no server-side code?

Possibly with some JavaScript voodoo, but I wouldn't like to go down that
route.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
.



Relevant Pages

  • Re: Problem with render page to html
    ... I read on Nokia site that your phone supports XHTML not HTML 4.0 ... But if I change the config to render to "wml11", it can display ...
    (microsoft.public.dotnet.framework.aspnet.mobile)
  • Re: What if you dont have a thead/tbody/tfoot?
    ... use their HTML parser to do it, treating the contents of your page as HTML ... depends on IE's error correction to display properly in the first place. ... IE uses its HTML parser to display it. ... So even if your XHTML page validates, you're still relying on IE's HTML ...
    (alt.html)
  • Re: Language settings meta tag and doctype
    ... Either revert to HTML, or switch entirely to XHTML - in the second case you'll have to do some tricks to support IE. ... IE knows how to display XHTML pages, ...
    (alt.internet.search-engines)
  • Re: Web-design in Fedora
    ... The most prolific browser will not display XHTML served as ... XHTML, it'll only do so if it pretends to be HTML. ...
    (Fedora)
  • Esoteric XHTML question about href
    ... I don't know much about XHTML. ... I am trying to design an XML standard ... If the browser can't display that first file then ... it will try the next until it finds one it can display. ...
    (alt.html)