tags:

views:

62

answers:

2

I decided to use pure XML+CSS instead of (X)HTML for my webpage. I use and with no problems. However I can't specify webpage's title.

Document looks like this:

<?xml version="1.0" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<html:html xmlns:html="http://www.w3.org/1999/xhtml"&gt;
<html:head>
<html:title>FooBar</html:title>
</html:head>
<site>

<header>foo</header>

<article>
<title>foo</title>
<p>foo bar <html:a href="#">foobar</html:a></p>
</article>

</site>
</html:html>

But it doesn't work.

Update: it works on Chrome and Internet Explorer. Doesn't work on Firefox.

+2  A: 

Why don't you leave xhtml as it is and use another namespace with an alias for your custom tags?

Edit

I mean something like:-

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:a="urn:mycrop.com:mystuff">
<head>
<title>FooBar</title>
</head>
<a:site>

<a:header>foo</a:header>

<a:article>
<a:title>foo</a:title>
<p>foo bar <a href="#">foobar</a></p>
</a:article>

</a:site>
</html>

Of course this will fail if the browser strictly expects XHTML but that was true of your originally anyway.

From your comments elsewhere in this question it looks like you've gone for XSLT as a stylesheet anyway. That being the case you needn't bother with including any of the HTML stuff anyway, just have the source XML contain the data you want to display.

AnthonyWJones
Could you explain it a bit? Currently it looks like this:<?xml version="1.0" ?><?xml-stylesheet type="text/css" href="style.css"?><html:html xmlns:html="http://www.w3.org/1999/xhtml"><html:head><html:title>FooBar</html:title></html:head><site><header>foo</header><article><title>foo</title><p>foo bar <html:a href="#">foobar</html:a></p></article></site></html:html>
Developer
Please don't post code in comments it doesn't format usefully. If you have more details to add simply edit your question.
AnthonyWJones
Sorry. First-timer.
Developer
@Developer AnthonyWJones probably meant something along the lines of using regular XHTML extended by `<myNameSpace:article>` etc. I.e. going "the other way round."
jensgram
have a look at how e.g. mathml is embedded in xhtml http://www.w3.org/TR/xhtml1/#well-formed
Josef
A: 

OK, I used XSLT to do this. Works like a charm on every browser.

Developer
**How** did you achieve your aims using xslt? The purpose of a posted question is to help others with the same problem, as well as yourself. If you could post your solution it would be appreciated.
David Thomas
In fact "Looks like a Firefox bug to me" must be right. I tested few web browsers and every one except FF used html:title as page's title.I used XSLT because XML+CSS occured to be insufficient to my needs. Its completely different method.
Developer