Validate XHTML frameset - xhtml

I am trying to validate my XHTML Frameset page but I get the following errors from the W3C Markup Validation Service:
Missing "charset" attribute for "text/xml" document.
Line 1, Column 41: parsing XML declaration: '?>' expected
I have the following heading in my file:
<?xml version = "1.0" encoding = "utf-8" charset=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">

I changed the heading as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
I added the following meta tag in between the head tags:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
No more errors or warnings.

Related

(n) documents DTD into an Xhtml document + pass validator W3c?

I need yes or yes XHTML 1.1 strict, no html5.
That is the code of my doc.xhtml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html SYSTEM "prueba.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es">
<head><meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Galaxy</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
</head><body><div>
<nav>
<esphere>
<planet>Jupiter!</planet>
</esphere>
</nav>
</div>
</body></html>
That is the code of my DTD:
<!ENTITY % InlPhras.class "| esphere | nav | planet ">
<!ELEMENT esphere ANY>
<!ELEMENT nav ANY>
<!ELEMENT planet ANY>
<!ENTITY % html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
%html;
The combination of this two files, (the two codes together) run fine in validator W3C, but really this is a correct method to add elements to XHTML 1.1 strict?
How I can define best the element planet?
(by example weight, radio, gravity...)
Aditionally, if I begin the page without DIV element, then validator fail.
Why?
Why is a requeriment begin the document XHTML with DIV ?

Thymeleaf + Spring-Boot - why can't I access static resources?

My project tree looks like this:
I can access the templates now, but can't load static resources such as CSS, images, and JS.
I have a common.html fragment where I declare all my static resources, for instance:
<link rel="stylesheet" th:href="#{/css/app.css}"/>
A header fragment where I include common.html like so:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head th:include="fragments/common :: commonFragment" lang="en"></head>
// page body
</html>
A default.html file for layout:
<!DOCTYPE html>
<html lang="en"
xmlns:th="http://www.thymeleaf.org"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head th:include="fragments/common :: commonFragment" lang="en">
<meta charset="utf-8"/>
<meta name="robots" content="noindex, nofollow"/>
<title>Touch</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="content-dataType" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<link rel="shortcut icon" th:href="#{/static/images/favicon.ico}" type="image/x-icon" />
</head>
<body>
<div th:id="defaultFragment" th:fragment="defaultFragment" class="container">
<div id="header" th:replace="fragments/header :: headerFragment" />
<div layout:fragment="content" />
</div>
</body>
</html>
Also, on my application.properties file, I have these entries:
#SPRING RESOURCE HANDLING
spring.resources.static-locations=classpath:/resources/
#THYMELEAF
spring.thymeleaf.cache = true
spring.thymeleaf.check-template = true
spring.thymeleaf.check-template-location = true
spring.thymeleaf.content-type=text/html
spring.thymeleaf.enabled=true
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.mode=HTML5
spring.thymeleaf.prefix=classpath:templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.template-resolver-order=1
But I keep getting the same No mapping found message.
32190 [http-nio-8081-exec-2] WARN o.s.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/central/css/app.css] in DispatcherServlet with name 'dispatcherServlet'
What am I not seeing here?
I solved this problem with the following code:
spring.resources.static-locations=classpath:templates/
Use the spring.resources.static-locations in your properties to define the static resources locations (making them directly publicly available):
spring.resources.static-locations=classpath:/your/static/resources/here/like/central/css/
you can provide comma separated values i.e. taken from the documentation:
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/ # Locations of static resources.
I'm using Spring Boot 2.2 and not getting any of my static content. I discovered two solutions that worked for me:
Option #1 - Stop using #EnableWebMvc annotation
This annotation disables some automatic configuration, including the part that automatically serves static content from commonly-used locations like /src/main/resources/static. If you don't really need #EnableWebMvc, then just remove it from your #Configuration class.
Option #2 - Implement WebMvcConfigurer in your #EnableWebMvc annotated class and implementaddResourceHandlers()
Do something like this:
#EnableWebMvc
#Configuration
public class SpringMVCConfiguration implements WebMvcConfigurer {
#Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/js/**").addResourceLocations("classpath:/static/js/");
registry.addResourceHandler("/css/**").addResourceLocations("classpath:/static/css/");
registry.addResourceHandler("/vendor/**").addResourceLocations("classpath:/static/vendor/");
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
}
}
Just remember that your code is now in charge of managing all static resource paths.
try to add mapping of your static resources in link
<link rel="stylesheet" th:href="#{/css/app.css}"
href="../../../css/app.css" />

symfony "<?php" tag in every rendered page

I was looking at my symfony code, and in every rendered page I have the "?php" tag before the normal html heading (and I dont know why, of course)
<?php<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
My controller is very simple:
<?php
namespace PUC\PanolBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage;
class HomeController extends Controller
{
public function indexAction()
{
$session = new Session(new PhpBridgeSessionStorage());
$session->start();
$lessons=array('CA01','MA02');
$session->set('user','Drak');
$session->set('lessons',$lessons);
return $this->render('PUCPanolBundle:html:index.html.twig');
}
}
And my index.html.twig starts like this:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% block title %}Titulo{% endblock %}</title>
<link href="{{ asset('css/bootstrap.min.css')}}" rel="stylesheet">
<link href="{{ asset('css/estilos.css')}}" rel="stylesheet">
<link href="{{ asset('css/jquery-ui.css')}}" rel="stylesheet">
{% block css %}{% endblock %}
<script src="{{ asset('js/jquery-1.11.1.js')}}"></script>
<script src="{{ asset('js/jquery-regional-es.js')}}"></script>
<script src="{{ asset('js/jquery-ui.js')}}"></script>
<script src="{{ asset('js/bootstrap.min.js')}}"></script>
Any thoughts?
Thanks!
UPDATE
Clearing cache also throws php tag:
lamp#ubuntu:/var/www/html/symfony$ php app/console cache:clear
Clearing the cache for the dev environment with debug true
<?phplamp#ubuntu:/var/www/html/symfony$
And Im having thoughts about re-installing symfony :P
SOLVED
After re-installing symfony this annoying php tag was still there. Since it was a clear installation, my project files were definitely the problem. At the end, I previously had declare an empty Controller that I haven't used yet, with only a ... (yes, you guessed right) php tag inside of it.
Thanks to all for the help :)

Adding to cookie file via Button using Classic ASP

I'm making a website for pictures and am trying to use cookies for the shoppingcart.
Is it possible to add data to a cookie via a buttonclick?
This is my code:
<?
Response.Cookies ("MYCOOKIE").Expires = DateTime.Now.AddDays(5)
Response.Cookies ("MYCOOKIE")[("BgColor")] = "Kibbeling 26 : Sea Warrior's Strike Back "
Response.Cookies ("MYCOOKIE")("Date") = DateTime.Now
Dim MyCookie
Dim MyCookie2
MyCookie = Request.Cookies ("MYCOOKIE")("BgColor")
MyCookie2 = Request.Cookies ("MYCOOKIE")("Date")
Response.Write(MyCookie)
Response.Write(MyCookie2)
%>
<!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" >
<head runat="server">
<title>Cookies</title>
</head>
<body runat="server" id="BodyTag">
</body>
</html>

No such file directory exists?

<!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">
I am using this .inc file to link my php page to MySQL however my browsers says the following message as :
Warning: require_once(../FinalApplicationDWP/Public_html/dbstuff.inc): failed to open stream: No such file or directory in /home/cs12jkk/public_html/functions.inc on line 6
and
Fatal error: require_once(): Failed opening required '../FinalApplicationDWP/Public_html/dbstuff.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cs12jkk/public_html/functions.inc on line 6
My filies are saved on in a file on my desktop FinalApplicationDWP>public_html> then all the files
<?php
require_once ("..dbstuff.inc");
require_once ("validation.inc");
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
It is not finding the file in the require_once lines.
For starters try:
require_once ("../dbstuff.inc");
Notice the extra /
Other than that check the file paths, make sure they are in the correct place.
try changing your code to::
<?php
require_once("file:///jordanking48$/Users/jordanking48/Desktop/FinalApplicationDWP/public_html/dbstuff.inc");
require_once ("validation.inc");
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
and make sure that you gice the right path for the files changing <"..dbstuff.inc"> to <"../dbstuff.inc">

Resources