I use Voodoopad to create my help docs, as described here. Basically I have a Run Script build phase which tells Voodoopad to export my document as html. The Voodoopad doc is set to run hiutil to create the help index when it exports.
After noticing that many of my help anchors weren't working, I traced it back to hiutil. When I run hiutil on the html exported from Voodoopad, I get a bunch of errors:
Zach-iMac:Desktop zach$ hiutil -a --create Help/ --file Help/Help.helpindex -1 -vvv
index.html -- Parse error: The operation couldn’t be completed. (NSXMLParserErrorDomain error 76.)
index.html -- Parse error: Error 76, Description: (null), Line: 14, Column: 8
index.html -- Finished parsing
These errors are repeated for every single file. Line 14, column 8 is the closing of the head tag. The first part of every file is basically the same:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="AppleTitle" content="VideoBuffet Help">
<meta name="AppleIcon" content="appicon16.png">
<title>Index</title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1138.23">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'}
</style>
</head>
<body>
This exact HTML used to work just fine with hiutil. Since the last time I've run this I upgraded to Mountain Lion and Xcode 4.5.
Is anyone else using hiutil, and is it working for you?
If you use this prologue at the top of your HTML file:
<!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">
and run your HTML through a validator like http://validator.w3.org/#validate_by_upload+with_options
and fix all the problems until the validator returns success, it should work with hiutil 1.3. It did for me anyway.
See also http://lists.apple.com/archives/apple-help-authoring/2012/Sep/msg00018.html
It's not a proper answer, but my workaround is to use the version of hiutil that shipped with Lion (1.2) to build my help index.
I'm not very happy with this, but it will do for now. If anyone has this issue, and wants to learn how to do it, you can read my blog post about it.
Update: posted rdar://12326432
Update: I've heard from Apple this is a duplicate of bug #11981648 (which is still open at this moment).
Related
I'm sorry, but I am not very good with programming. I am trying to fix this irritating bug on my school's website through a userscript. I have tested the RegEx on several pages, at least that works. I need to make the userscript remove the parts I don't want to see. This is a snippet from the source of the website, I have marked what needs to be removed with '//'.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
//<html><head>
//<title>404 Not Found</title>
//</head><body>
//<h1>Not Found</h1>
//<p>The requested URL /get.php was not found on this server.</p>
//</body></html>
<!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" xml:lang="en-gb" lang="en-gb" >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
This is my userscript that does not work. I know it reflects my skills as a programmer, please don't hate.
var REGEX = /<HTML>(.*?)([^\n]*?\n+?)+?<\/BODY><\/HTML>/ig;
document.body.innerHTML=document.body.innerHTML.replace(REGEX, '');
This markup is obviously invalid, but the browser (at least Chrome and Firefox) will merge these two <html> sections together with its best guess. So interacting with document.body is probably not what you want.
Doing something like this will visually fix the issue:
document.querySelector('h1').remove() // remove first h1 "Not Found"
document.querySelector('p').remove() // remove first p "The requested..."
First off, I would like to add that I have looked through many posts before this, none matching my exact situation.
Problem:
"Lounge.html" is the 'index' html file shown below
"test.css" is the external .css file I am trying to link to, also show below
"Lounge.html" and "test.css" are both in the same folder; the root folder
All "img" and "a" elements are in working order
When I run "Lounge.html" in either Microsoft Edge, or Internet Explorer, the style is not applied to my page.
I would appreciate some help with getting this external link working.
Regards,
AA
h1, h2 {
font-family: sans-serif;
color: gray;
}
h1 {
border-bottom: 1px solid black;
}
p {
font-family: sans-serif;
color: maroon;
}
<!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="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Head First Lounge</title>
<link type="text/css" rel="stylesheet" href="test.css" />
</head>
<body>
<h1>Welcome to the New and Improved Head First Lounge</h1>
<p><img src="images/drinks.gif" alt="Drinks" /></p>
<p>
Join us any evening for refreshing
elixirs,
conversation and maybe a game or two of
<em>Dance Dance Revolution</em>.
Wireless access is always provided;
BYOWS (Bring Your Own Web Server).
</p>
<h2>Directions</h2>
<p>
You'll find us right in the center
of downtown Webville. If you need help finding
us, check out our
detailed directions.
Come join us!
</p>
</body>
</html>
This may be the problem of browser cache. Clear the cache and check it again. Simple way to clear cache is add some radom string after adding ? to the url. Example
http://example.com/test.html?somerandomtext
To fix this issue, if "fix" is what you would like to call it, I simply uploaded both files (html, css) to a web hosting server. The 'index' html file was immediately affected by the external stylesheet, unlike my attempt at local methodology.
Try updating the browsers.
For IE : If you are still getting the error, insert
<meta http-equiv="X-UA-Compatible" content="IE=edge">
in your <head> section and try loading it.
Hope this will help!
I'm looking for an html 5 document in xml format that is considered valid by these tools:
eclipse juno html validator
w3c validator http://validator.w3.org
http://html5.validator.nu/
firefox html validator https://addons.mozilla.org/fr/firefox/addon/html-validator/
Can anyone provide me such a document if it exists or explain me which validator aren't conform to the standard. The best I've found is the following document:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
dir="ltr">
<head>
<meta name="description"
content="application/xhtml+xml; charset=UTF-8" />
<title>Get an object</title>
</head>
<body>
<section>This is a section</section>
</body>
Note that document contains a section element which is only valid in html 5. This document isn't valid for eclipse and firefox.
Regards,
Mickaël
Answer:
Thanks for your useful link igo: http://docs.webplatform.org/wiki/html/tutorials
I learnt that even if using xhtml syntax is highly recommended, including the xml header line may cause problems to some browsers. So I removed it and the following code is validated by all validators above, eclipse validates it as html5 using xml constraints.
<!DOCTYPE html>
<html lang="en"
dir="ltr">
<head>
<meta name="description"
content="application/xhtml+xml"/>
<meta charset="UTF-8"/>
<title>Get an object</title>
</head>
<body>
<section>This is a section</section>
</body>
</html>
check the documentation on new launched web from W3C at https://www.w3.org/QA/2002/04/valid-dtd-list.html
I have a warning on the line including the javascript file.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title></title>
<script type="text/javascript" src="scripts/jquery.js"></script>
</head>
<body>
The warning is "Multiple annotations found at this
line:
- Undefined attribute name (src).
- Undefined attribute name
(type)."
I can't see where the problem is!
It's the doc type. Eclipse is going to validate the DOM against the DTD. If unknown entities are not clearly defined in the DTD, then Eclipse will raise warnings.
In the absence of an explicit doctype, you should check if the Property dialog for the file has a page for deciding what doctype to use as a default. HTML5 was only very recently added: http://dev.eclipse.org/mhonarc/lists/wtp-dev/msg07790.html .
Instead of <!DOCTYPE html>, using this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I am using DreamWeaver to code xHtml docs. in the program the code is valid but when I upload it in the inspect element I see double <head> tags and when I right-click to see the source file it seems o.k.
Is it because I'm using dreamweaver? what can be wrong?
the first error is : "Extra <html> encountered. Migrating attributes back to the original <html> element and ignoring the tag." - in line 3
The code:
<!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" />
<meta name="keywords" content="the content of my doc" />
<meta name="description" content="this is an example document" />
<link rel="alternate" type="application/rss+xml" title="rss feeds" href="linkto/xml/feeds.xml" />
<!-- scripts -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<title>The Title</title>
</head>
<body>
<!-- content -->
</body>
</html>
Thank you very much.
No problem in Chromium 5.0.307.9 (Developer Build 39052) under Linux. I can't test it in Safari now.
EDIT: Proposed test case had nothing to do with this problem, neither could see any extra <head> tags. However, I looked at the Developer Tools of Safari and Chrome under Windows and Firebug in Firefox and all three rendered the DOM incorrectly. Just have a look at this picture and see that the first <link> tag has jumped into the body.
This problem also has nothing to do with Javascript because when turning off Javascript the result is the same, even more clear when comparing with the source code. Strange I didn't notice this under Linux.
The Developer Tools of the WebKit browsers give an even clearer picture (also notice the jQuery error message). I suspect the Unicode Byte-Order Mark (BOM) at the beginning of the file causing the problem: as you can see the BOM is moved to the <body> of the document, perhaps dragging several elements in the <head> with it. But also the unclosed <link> elements, as shown by the W3C validator, might give some issues, although browsers usually handle this without any problems. First get rid of the BOM in your file and see if the problem persists.
And I see another error: those tags beginning with <meta ... are called meta tags, not "meat tags". ;-)
You should have a title element what you write between
the <title></title> tags will been displayed in top bar of your browser
Just make sure your
</head>
tag has the slash in the actual file you're working on. That's an easy typo.
To remove BOM from your document, you can use this php function:
function removeBOM($str=""){
if(substr($str, 0,3) == pack("CCC",0xef,0xbb,0xbf)) {
$str=substr($str, 3);
}
return $str;}