nevow's loaders.xmlfile returning XML

Hi, I am a bit confused about loaders.xmlfile() method and what it is donig to my XML templates. It seems to be HTMLifying my XML by doing things like stripping the / out of <br />. I am trying to develop some pages where I have inline SVG in the code. My static XHTML files work fine but the code returned from nevow does not work. How can I get nevow to return XHTML and not HTML? How can I put the HTML namespace into my returned XHTM? Regards, Abdul-Wahid

On Sat, 28 Jun 2008 13:15:44 +0300, Abdul-Wahid Paterson <abdulwahid@gmail.com> wrote:
Hi,
I am a bit confused about loaders.xmlfile() method and what it is donig to my XML templates. It seems to be HTMLifying my XML by doing things like stripping the / out of <br />.
Can you provide an example of this? That's not something xmlfile is supposed to do, nor something I've ever seen it do. Jean-Paul

I am a bit confused about loaders.xmlfile() method and what it is donig to my XML templates. It seems to be HTMLifying my XML by doing things like stripping the / out of <br />.
Can you provide an example of this? That's not something xmlfile is supposed to do, nor something I've ever seen it do.
Actually, my mistake. It is not nevow doing this. It is firefox. When I view source the /'s are there but when I save the source from file save the /'s have disappeared. Strange. Anyway, perhaps I am barking up the wrong tree. What I am trying to do is put inline SVG into my XHTML. When I saved the source of the XHTML I found there were XML errors. Some of those appear now to have been introduced by firefox when I saved the source of the page. However, there is something from nevow that I don't understand. I have a template that says something like this at the top. <html xmlns:nevow="http://nevow.com/ns/nevow/0.1"> <head> <title>Firewall</title> <link href="/css/main.css" type="text/css" rel="stylesheet" /> <script src="/js/core-functions.js" type="text/javascript"></script> </head> <body> <div class="topbar"> << CUT >> The output XHTML is like this.... <html><head><title>Athuentication</title></head><body><html> <head> <title>Firewall</title> <link href="/css/main.css" type="text/css" rel="stylesheet" /> <script src="/js/core-functions.js" type="text/javascript"></script> </head> <body> << CUT >> Why it it putting the extra HTML tags in? How can I get the xmlns in the <html> tag. Why is it putting <title> twice? Bit confused about what this function is doing. Thanks, Abdul-Wahid

On Sat, 28 Jun 2008 14:56:37 +0300, Abdul-Wahid Paterson <abdulwahid@gmail.com> wrote:
[snip]
Anyway, perhaps I am barking up the wrong tree. What I am trying to do is put inline SVG into my XHTML. When I saved the source of the XHTML I found there were XML errors. Some of those appear now to have been introduced by firefox when I saved the source of the page.
However, there is something from nevow that I don't understand. I have a template that says something like this at the top.
<html xmlns:nevow="http://nevow.com/ns/nevow/0.1"> <head> <title>Firewall</title>
<link href="/css/main.css" type="text/css" rel="stylesheet" /> <script src="/js/core-functions.js" type="text/javascript"></script> </head>
<body>
<div class="topbar">
<< CUT >>
The output XHTML is like this....
<html><head><title>Athuentication</title></head><body><html> <head> <title>Firewall</title>
<link href="/css/main.css" type="text/css" rel="stylesheet" /> <script src="/js/core-functions.js" type="text/javascript"></script> </head>
<body>
<< CUT >>
Why it it putting the extra HTML tags in? How can I get the xmlns in the <html> tag. Why is it putting <title> twice?
Bit confused about what this function is doing.
My guess is that you either have two templates that have html tags or that you are loading one template with an html tag twice and then putting one inside the other. Nevow won't stop you from doing this, even though in most cases, the result isn't very sensible. Jean-Paul

Hi,
My guess is that you either have two templates that have html tags or that you are loading one template with an html tag twice and then putting one inside the other. Nevow won't stop you from doing this, even though in most cases, the result isn't very sensible.
Yes you are right. I found the problem was in the code that someone else wrote and committed to CVS. They had put something in the authentication system that was also including HTML. BTW, where can I find some good documenation on nevow.guard so I can fix the authentication system? I looked at the code the other developer wrote but was a bit confused about how guard is working and couldn't find anything use by googling. Regards, AW

Hi,
My guess is that you either have two templates that have html tags or that you are loading one template with an html tag twice and then putting one inside the other. Nevow won't stop you from doing this, even though in most cases, the result isn't very sensible.
Yes you are right. I found the problem was in the code that someone else wrote and committed to CVS. They had put something in the authentication system that was also including HTML.
Further to this, I have still seem to have a problem with the XHTML generated. When I load the page through firefox it does not render my inline SVG. However, when I save the page as something .xml and load the same page into firefox it does render the SVG. Is this something to do with the Content-Type not being set to application/xhtml+ xml ? If so, how can I set it? AW
participants (2)
-
Abdul-Wahid Paterson
-
Jean-Paul Calderone