views:

328

answers:

3

I know namespace are used to describe, like doctype, but is there a way or a trick to transform inner namespace html with an xsl using xsd ?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:sample="sample-uri">
    <head >
     <title>Enter the title of your XHTML document here</title>
    </head>
    <body >
     <p sample:node="retrieve-transformation">Enter the body text of your XHTML document here</p>

</html>

In other words i want to know if i can process xsl transformation to an xhtml page whithout using javascript.

+2  A: 

No, you cannot perform an XSL transformation without using some kind of scripting technology. I would suggest you do it serverside to save the client the trouble; and to avoid various issues if the transformation for some reason does not succeed on the client or runs slow.

driis
+3  A: 

In XHTML (i.e. application/xhtml+xml—not text/html!), you can trigger an XSLT program without JavaScript using the xml-stylesheet processing instruction.

hsivonen
+2  A: 

modern browsers support xslt out of the box.

take a look at eu.wowarmory.com they use it extensively. if the server detects a user agent that does not support xslt, it is rendered at the server side, and a quite verbose html is rendered there and sent to the browser.

this makes a nice abstraction if you plan to provide a xml webservice similar to the web site.

Andreas Petersson