OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
XSTL => 2 Namespaces in XHTML => XHTML invalid
This page's ID:
22901
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Hy, i'm having a serious problem with XSLT, it produces two namespaces, so that my XHTML-File is invalid. XML-Dokument: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="personen.xsl"?> <personen xmlns="http://localhost/personen" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://localhost/personen personen.xsd"> <person id="1"> <name>flo</name> <alter>20</alter> </person> <person id="2"> <name>doris</name> <alter>14</alter> </person> <person id="3"> <name>bernd</name> <alter>23</alter> </person> </personen> XSL-Dokument <?xml version='1.0' encoding="UTF-8"?> <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:data="http://localhost/personen" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" default-validation="strict"> <xsl:output method="xhtml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no" doctype-public="-//W3C/DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" standalone="no" media-type="text/xhtml"/> <xsl:template match="/" > <html> <head> <title>Personen</title> <link rel="stylesheet" type="text/css" href="personen.css" /> </head> <body> <table> <tr> <th>ID</th> <th>Name</th> <th>Alter</th> </tr> <xsl:for-each select="data:personen/data:person"> <tr> <td><xsl:value-of select="@id"/></td> <td><xsl:value-of select="data:name"/></td> <td><xsl:value-of select="data:alter"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> XSLT Processes without any Errors, but the final XHTML-Dokument is invalid => see Explanation <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:data="http://localhost/personen"> <head> <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/> <title>Personen</title> <link rel="stylesheet" type="text/css" href="personen.css" /> </head> <body> <table> <tr> <th>ID</th> <th>Name</th> <th>Alter</th> </tr> <tr> <td>1</td> <td>flo</td> <td>20</td> </tr> <tr> <td>2</td> <td>doris</td> <td>14</td> </tr> <tr> <td>3</td> <td>bernd</td> <td>23</td> </tr> </table> </body> </html> HERE IS MY PROBLEM: This XHTML-Dokument is (refering to W3C Recommendation) invaild, because it contains a second namespace. This is because i have to insert the data-namespace in the XSL-Document, because i want to access the data from the XML-Document. But - i think this rule is called ***NAMESPACE FIXUP*** says, that all the namespaces on the Elements of the XSL-Document have to be transfered / added to the result-document (XHTML) ... CAN ANYBODY HELP ME - i have to get rid of the data-namespace, so that the XHTML-document is valid !!!! PLEASE, help me thanks, flo
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »