Undefined attribute name (xmlns) - html

Here is the beginning of my HTML page :
1. <?xml version="1.0" encoding="utf-8" ?>
2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3. <html xmlns="http://www.w3.org/1999/xhtml" lang="fr">
4. (...)
5. </html>
Whether there is the <?xml ... ?> part or not, Eclipse returns me a warning event on the line 3
Undefined attribute name (xmlns).
This xmlns attribute is required for correct validation, and so I don't understand why Eclipse returns a warning.
Furthermore, I'm using Eclipse Indigo 3.7.2 with the last PHP Developer Tool from the Eclipse database.
Anybody knows how to remove this warning, or find a way to skip this ?
Thanks for reading and helping.

There is bug filed for similar case here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=313859
<?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">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr">
<head>
<title>Title of the document</title>
</head>
<body>
<div>The content of the document.</div>
</body>
</html>
Should validated. Validates fine in Eclipse Juno and here: http://validator.w3.org.

Related

Why connectors in primefaces flowchart componant not appeared?

I am trying to use flowchart component in primefaces to view process flow but the connectors not appeared with me i used same code in the demo in this link
[primefaces demo]
https://www.primefaces.org/showcase/ui/data/diagram/flowchart.xhtml
i just copy and paste same demo code but the result is like that
[result with no connectors]
https://i.stack.imgur.com/WwIgo.png
my question what is missing to get the same result in the demo??
You've already found out that the showcase has a small pitfall builtin as it does'nt show the complete xhtml-page. A minimal empty page with the common namespaces is something like
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
</h:body>
</html>
h:head is important as Primefaces automagically injects the dependencies (stylesheets, scripts) here.

XSL to XHTML Strict with DOCTYPE - META tag validation issue

XSL Sample
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="html"/>
<xsl:template match="/Report">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
The problem: I need to define the DOC TYPE
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
in the XSL but it's not letting me put it in there, says invalid style sheet.
I tried:
<xsl:text disable-output-escaping='yes'><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"></xsl:text>
but is it the proper way to do this? Online Validators don't even see that line which when rendered by html is supposed to be valid.
What's the proper way of adding DOCTYPE?
should my xmlns:xsl="http://www.w3.org/1999/XSL/Transform" still be transform there or?
I have an XML data file with XSL style sheet that i transform into an html. I want to add the above to make it XHTML Strict Compliant. Any advice would be appreciated. Thank you!
Expected Output
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> Strict DTD XHTML Example </title>
</head>
<body>
<p>
Please Choose a Day:
<br />
<br />
<select name="day">
<option selected="selected">Monday</option>
<option>Tuesday</option>
<option>Wednesday</option>
</select>
</p>
</body>
</html>
Generated XHTML
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OWASP ZAP Vulnerability Report</title>
</head>
<body>
</body>
</html>
Issues Using: https://validator.w3.org/
The issue seems to be caused by the META tag in the head element but i don't understand why.
So how do i stop my XSL from adding the META tag?
SOLUTION
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template match="/Report">
<xsl:text disable-output-escaping='yes'><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Change the xsl:output method from html to xml. But back to the other question, is there a better way to declare DOCTYPE?
Use the attributes of xsl:output, https://www.w3.org/TR/xslt#output, i.e.doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd", then the XSLT processor on serializing adds the DOCTYPE.

Problems with Primefaces editor calendar galleria etc

I've just started using primefaces 3.5 and I'm dealing with a weird problem.
1. editor doesn't show up on the page
2. galleria only shows the images in a list
3.popups don't work at all
4. calendar appears as a text field
does anybody know what could have caused this problem? I'm not getting any errors and other stuff like p:media work just fine.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>First JSF</title>
</head>
<p:editor></p:editor>
</html>
I think you have to add below line in your JSF page
<f:view contentType="text/html"/>
OK, Finally I solved the problem.
Just simply used <h:head> instead of <head> tag that I'd used before.

Can I add more xmlns attribute?

Usually my page is defined as :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it">
but using a Facebook Plugin, it says :
Add an XML namespace to the <html> tag of your document. This is necessary for XFBML to work in earlier versions of Internet Explorer.
<html xmlns:fb="http://ogp.me/ns/fb#">
So I wrote :
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" xml:lang="it">
Is this correct? Or html document need only 1 xmlns?
As long as you do not specify the DTD as XHTML Strict, multiple xmlns attributes are allowed. So it's ok.
As you're using XHTML 1.1 it shouldn't cause any problems: http://www.w3.org/TR/xhtml11/conformance.html

writing HTML back to file

Header for my input file looks like:
<?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">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
After doing certain changes in document using lxml.html parser, i need to save the changes in a file. while doing so Header of the file changes to:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml version="1.0" encoding="UTF-8"??>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xml:lang="en">
i am not sure why is this happening, may be its too silly but i am stuck here. please help!!
Maybe parser caters to the IE6's Quirks mode triggering?