I try to see a web page with a xform in xampp-server
<?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:xf="http://www.w3.org/2002/xhtml">
<head>
There is a model of the form
<xf:model>
<xf:instance>
<person>
<fname />
<lname />
</person>
</xf:instance>
<xf:submission id="form1" method="get" action="submit.asp" />
</xf:model>
and there is the real form
<xf:input ref="fname"><xf:label>First Name</xf:label></xf:input><br />
<xf:input ref="lname"><xf:label>Last Name</xf:label></xf:input><br />
<xf:submit submission="form1"><xf:label>Submit</xf:label></xf:submit>
</body>
</html>
How to see the web page instead of xml-code with error message "This XML file does not appear to have any style information associated with it. The document tree is shown below." in browser? Thank you!
Sadly none of the major browsers support XForms directly. In order to see the XForms running in your browser, you'll need an XForms processor.
In your XAMPP server, the best choice is XSLTForms.
Download it from http://sourceforge.net/projects/xsltforms/ and unpack the files in a folder named xsltforms under the same folder where your page resides.
The next step is to modify your XForms to use the processor. Include the following processing instruction just behind the declaration at the top of the page:
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl" ?>
XSLTForms uses an XSL transformation to convert your XForms into an HTML5 form usable by your browser, with a little help of Javascript to handle the XForms behavior.
You can find more information in the XSLTForms website and the wikibook.
Related
I have an Oracle ADF / WebLogic project built by someone else with JDeveloper 11 (and the integrated WL server).
The problem is that the HTML DTD is outputted as:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
and I want to change it to HTML5 mode, and I don't know how (I'm a front-end developer):
<!doctype html>
The pages start with this:
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1">
....
Has anyone done this in JDev 11? I couldn't find the answer anywhere. Some people say that JDev 12 does it, but I'm not sure if I can import and build the project in v12 without a lot of changes.
Indeed, JDeveloper 12c uses HTML5, so an upgrade it will help.
I am not aware of any way of changing the doc type in ADF, but you can hack it by altering html response using Servlet Filter:
http://docs.oracle.com/javaee/5/tutorial/doc/bnagb.html
I started learning the basics of HTML and I have studied differences between XHTML and HTML. I have noticed XHTML is much stricter. Consider below markup
<?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/TR/xhtml1" xml:lang="en" lang="en">
<head>
<title>Every document must have a title</title>
</head>
<body>
<b><p>hey</b></p><br>
</body>
</html>
I have not properly nested the tags and <br> is not properly closed in XHTML but it does not raise any parsing error and when I have saved the file as test.xhtml then it raised parsing error. So how to actually create XHTML files and also how to use XHTML in HTML5? and could anyone explain me that files saved with .xhtml are XHTML files and with .html are treated as HTML files?
Iam using google chrome. I understand the differences but unable to view practically in the browser. Could anyone help me figuring this out.
Most web browsers have XML and HTML parsers. These use different rules.
In general, the rules they follow are:
If the document has one of various XML content-types and the document in in the XHTML name space: Use the XML parser
If the document has a text/html content-type then use the HTML parser
If the document is loaded from a local file and has a .xhtml file extension, then treat it as having the content-type application/xhtml+xml
If the document is loaded from a local file and has a .html file extension, then treat it as having the content-type text/html
My pages are written and declared as XHTML 1.0 Strict. The first lines goes like this:
<?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">
<head>
Which I belive is correct for a XHTML 1.0 Strict but nevertheless IE11 gives this warning:
HTML1406: Invalid tag start: "<?". Question marks should not start tags. File: default.aspx, Line: 1, Column: 2
Anyone know if this is somthing I should worry about?
The problem is that although you have created a file with an XHTML doctype you have served it using a text/html media type.
So IE11 (and other browsers) treat the file as an HTML file and parse it with their HTML parser. An XML declaration in an HTML file is invalid, and that's what the browser is telling you. If you had served the file with an application/xhtml+xml media type, the browser would have treated the file as XHTML and used its XML parser to parse it. Then the XML declaration would be handled correctly according the XML rules and IE11 would not give you that warning message.
There's no real problem here. The HTML parser will treat the declaration as a bogus comment and just carry on regardless.
For more information you should read Sending XHTML as text/html Considered Harmful and/or HTML 4, HTML 5, XHTML, MIME types - the definitive resource
If you got here because you're working on an old(er) ASP.NET Web Forms app/site... try turning on Compatibility View... that worked for me
Is there a viewer or plugin of any kind that would allow an .epub document to be viewable on a web page? A Google search turned up tons of installable epub viewing desktop software but I couldn't seem to find anything for embedding this format on a web page. Perhaps you folks have some insight into this?
epub files are just HTML/XML and CSS, so you could easily open the epub container (it's a zip), then parse the XML inside using a language like PHP.
It shouldn't be too difficult to do that.
The format looks like:
--ZIP Container--
mimetype
META-INF/
container.xml
OPS/
book.opf
chapter1.xhtml
ch1-pic.png
css/
style.css
myfont.otf
Here's an example of the content you might find in chapter1:
<?xml version="1.0" encoding="UTF-8" ?>
<!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="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>Pride and Prejudice</title>
<link rel="stylesheet" href="css/main.css" type="text/css" />
</head>
<body>
...
</body>
</html>
I'd suggest that this should in most cases be done with Javascript using a library like one of these How to read epub files using javascript
Following site i have build always load in quirks mode which then rise the box model bug for older IE.
site
I have added the document type as xhtml1-strict.dtd and there is no white spaces or BOM characters. When i change the document mode to IE7 or IE8 standers from developer tools it shows the site correctly.
I have try to change the quirks mode loading in many ways but couldnt success. If you guys also dont know how to change to quirks mode loading i would appriciate if any hack to the alligment issue i am getting can be posted.
Thank You.
View source and your first line of code is:
<?xml version="1.0" encoding="UTF-8"?>
You need DOCTYPE to be the very first line.
Edit: You've removed the <?xml...>, but you still have an issue. Line 1 is blank but line 2 contains an invisible character - U+FEFF - the unicode BOM. You'll need to remove that.
Are you using Server-Side Includes or some other server technology that could be joining two files or otherwise adding to the response?
Your page starts exactly like this:
<?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">
Lose everything before the DTD (including the blank lines before the xml declaration, which don't show correctly), and it should parse in standards mode.
Another solution is to use the X-UA-Compatible response header, like this:
X-UA-Compatible: IE=8
(or IE=7, or IE=9)
Finally, please do read the MSDN documentation on document compatibility -- it's the definitive resource on the subject.
Update:
Since you are using PHP, and you have a spurious Unicode BOM in your source, it's almost certain that one or more of your PHP source files include a BOM. You need to save them without a BOM and without any other characters before the <?php tag.
To make sure you got them all, write a short program that opens up PHP files and reads the first byte. If it's not '<', then something is probably wrong.
Alternatively, you can use the X-UA-Compatible header as I mention above.
If a doctype that triggers strict mode is preceded by an xml prolog, the page shows in quirks mode.
It looks like the code output does.
<?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" dir="ltr" lang="en" xml:lang="en">
<head>