WML expected whitespace error - whitespace

I am transforming an XML file to WML using XSLT. Everything is fine until I try to open the WML in M3Gate. It gives the error "Bad WML syntax. 'Fatal Error. Ln 1, Col 38 Expected whitespace'."
Here is the offending code. However, I've tried moving things around and it gives the same error.
<?xml version="1.0" encoding="UTF-16"?>
<wml>
<card id=...>
Is this some obscure problem I'm missing? I've compared it with a WML I've made previously and the first line is exactly the same.
It works perfectly in Opera Web Browser.

Silly me. Opera Browser ignores the fact that there is no DOCTYPE declaration, however M3Gate generates this obscure error message. Add the following to your code, beneath the xsl:stylsheet element
<xsl:output method="xml" doctype-system="http://www.wapforum.org/DTD/wml_1.1.xml"
doctype-public="-//WAPFORUM//DTD WML 1.1//EN"/>

Related

Error in parsing StoryBoard in Xamarin.iOS

I am developing an application in Xamarin.iOS. But after three days of work, Xamarin cannot render the Main.StoryBoard and gives the following error:
There was an error in Parsing the XML in this document
and a long list of logs.
Any idea how to revert to or something like this
#Xhulio ran into this before. Try opening it with Xcode first to see if it works. If not you can try opening the storyboard with an XML editor (I used Notepadd++ with an XML plugin), then identify and correct the invalid XML. If you are using source control you can try comparing your changes to identify the issue. Hope this helps.

Firefox add-on builder and Jquery Mobile

I am trying everything under my power here to insert jquerymobile.1.0.1 into an extension I have build for firefox.
I can install, link to any other script and everything seems to work just fine, but have had an assortment of errors getting jquerymobile to work.
I've tried uploading through the add-on builder
I've tried remotely linking the file
I've tried copying and pasting the file into other code.. nothing works.
I've coded this extension for safari, chrome and opera without issue, but Firefox chokes the second I link to/include jquerymobile in my code returning this error:
Timestamp: 12-04-27 12:10:33 PM
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHistory.replaceState]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://jid0-d4zlaxz3cfuahkcdoecsmya637m-at-jetpack/idesireit/data/js/jquery.mobile-1.0.1.min.js :: :: line 72" data: no]
and also an error about "unallowed unicode" which I didn't get the chance to copy or paste, but I haven't seen that one in a few saves...
I've read that the above error can be caused by cross domain functions, but all my cross domain functions are in another js file, and they are all working just fine ( judging by those I can navigate to with jquerymobile acting as it is right now )
I'm a novice - if my error is based on my stupidity, please go lightly :O
I went ahead and created an all new extension,
included nothing but the popup, and in that pop up, called jquery and jquery.mobile.
I got this error instantly again.
I'm just going to go ahead and use the alternative UI I'm using on the dashboard widget, I've wasted too much time on this.
The bug is in the addonsdk, not in JQ Mobile. Any attempt to access or manipulate the window.history object in a panel will raise this error.

Can't deploy extension (firefox)

I am closely following the tutorial here as I attempt to create a Firefox extension. I have the following tree for my extension:
backtosearch
+-chrome
+-content
backtosearch.xul
+-chrome.manifest
+-install.rdf
I have created a testing profile for FF called "Extension Testing" and have added a file to the profile extensions folder "backtosearch#my.name" containing absolute path to the extension folder. I have reloaded the browser chrome using the extension development extension and restarted the browser - but I see no new button.
I have simplified the tutorial (as I only require one button), and my .xul contains only that. My chrome.manifest file contains:
content backtosearch chrome/content/
overlay chrome://browser/content/browser.xul chrome://backtosearch/content/backtosearch.xul
The extension is not showing under view -> toolbars or tools -> addons
Thanks for any help
install.rdf
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<!-- Required Items -->
<em:id>backtosearch#dylan.lloyd</em:id>
<em:name>Back To Search</em:name>
<em:version>1.0</em:version>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>3.5.*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Optional Items -->
<em:creator>Dylan Lloyd</em:creator>
<em:description>Adds options to return to your last search immediately.</em:description>
<em:homepageURL>http://www.getyourkeywords.com/</em:homepageURL>
</Description>
</RDF>
backtosearch#dylan.lloyd
C:\Users\Dylan\Desktop\backtosearch\
Hey I found out in moziila own documentation the mistake on this hello world.
You can read on:
https://github.com/oschrenk/firefox-extension
I had written
<RDF xmlns="http://www.w3.org/1999/02/22-RDF-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-RDF#">
<Description about="urn:mozilla:install-manifest">
as the root element, but it needs to be all lowercase
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
Just update the install.rdf =)
From your description it's not clear what the problem is. The most likely cause, as sdwilsh noted is that the Extension didn't get registered. If this is the case, the extension will not appear in Tools -> Addons.
You can try to set extensions.logging.enable pref to true to help debugging. Maybe try installing a helloworld extension first?
Possible causes:
You didn't use the correct name for the "link" file (must match the extension ID).
The "link" file contents is invalid (the path format is OS-native). In your case the path should end with "backtosearch"
Incorrect install.rdf. You can check it at least to be valid XML by opening it in Firefox (possibly renaming to .xml first) -- if the yellow screen opens, its invalid.
Installed in the wrong profile or didn't really restart Firefox.
If the extension is registered, try opening chrome://backtosearch/content/backtosearch.xul in Firefox (by copying that to the Location bar) -- if any errors appear, you should fix them. If the file loads successfully (may be empty), there's a problem with your overlay's contents, which is hard to debug without seeing it. Perhaps start with an overlay that's known to work?
Try running it through Mozilla's Add-On Validation page. It might just tell you what the error is. If it is a javascript error, it will tell you for sure.
Now, I had the same problem - when I loaded my addon, my toolbar didn't appear, and even though the addon showed in "Tools > Addons", when I clicked on the "options" button, everything froze.
Turned out, there were several errors.
The optionsurl in my install.rdf had "cchrome" instead of "chrome".
In my main .js file, I forgot a ";" at the end of a line with a var
assignment.
In my xul file, I did not leave a space: label="string"tooltip="string" between the two property assignments.
I had a hanging </toolbarbutton> from where I copied one line to the next. This is what really caused the problem. In the code file, the line was very long, and I never saw that part!
The combination was total failure, even though it passed fine in the Mozilla Validator.
The Validator, in my opinion should have caught the cchrome thing. It would have caught the javascript error.
Anyway, I tell you that in case such might be YOUR problem.

Will Firefox do XSLT on external entities?

What I'm trying to do is take an XML document, let's say http://example.org/data.xml and show it with an XSL stylesheet applied.
(I cannot modify the document itself and add a directive)
So there are a couple of utility XML files like this:
wrapper.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wrapper [
<!ENTITY content SYSTEM "http://example.org/data.xml">
]>
<?xml-stylesheet type="text/xsl" href="unwrap.xsl" ?>
<wrapper>
&content;
</wrapper>
unwrap.xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="stylesheet.xsl"/>
<xsl:template match="/wrapper/node()[1]">
<xsl:apply-imports/>
</xsl:template>
</xsl:stylesheet>
So to summarize: stylesheet.xsl is written for http://example.org/data.xml, the browser is pointed to wrapper.xml and the user should see the transformed http://example.org/data.xml.
This is one of those rare cases where things work as expected in IE (and Chrome) but not Firefox.
AFAIK Firefox supports external XML entities, but it seems like they are invisible in XSL code. I found this article from 2006, it describes this problem in Firefox 1.5 (I'm using 3.5.3)
Is there any workaround for this?
That XML looks familiar ;)
Currently, FireFox will not load external DTD's and entity references, because of security and Denial of Service concerns. For example: http://en.wikipedia.org/wiki/Billion_laughs
There is an open Mozilla bug describing the reasons why and lengthy debate about whether or not to make it something that is configurable: https://bugzilla.mozilla.org/show_bug.cgi?id=22942
There does appear to be one workaround to loading DTDs, but I'm guessing that probably isn't a viable solution for you.
Firefox will load local DTD files
if you put them in this directory for Windows:
C:\Program Files\Mozilla Firefox\res\dtd\...
The directory for Linux:
/**mileage may vary**/MozillaFirefox/lib/res/dtd/
One idea to get around using the entity reference:
If you can control the content of the wrapper.xml, then you could fetch the contents of http://example.org/data.xml (server side) and echo it out as the full contents of the wrapper file, with the addition of the Stylesheet Processing Instruction(assuming you have some dynamic server-side capabilities).

IE8 won't load JavaScript file in "Compatibility View."

Here's my JS insert:
<script type="text/javascript" src="include/profile.js"></script>
In IE8 with "Compatibility View," the file never loads. The first line in the file is a simple alert() call, so that I know it loaded. Change the browser to Standards View, and it loads fine.
Also, if I add:
<meta http-equiv="X-UA-Compatible" content="IE=100" >
It forces to Standards View and it loads fine.
Any idea why this would be the case? I've not been able to test against IE7, but I know the JS file also does not load in IE6.
Right now the tag is in the section of the file.
It would seem that IE8, Safari, Firefox, et al will tolerate certain JavaScript syntax errors. IE7 and IE6 (and IE8 in 'compatibility view') will not, and they will also not throw a parse error or any other kind of clue.
Pasting my code into http://www.jslint.com/ revealed a couple of syntax errors that weren't affecting the code's operation in other browsers. So boo on me.
Okay. Had the same problem on IE8 and safari 5 on windows and finally got this working. This one is really beauty...
I had a function with a parameter named 'class' which was causing the issue. Renaming to clsname fixed the problem. Apparently FF and chrome were lenient about this.
Turn on script debugging and see if you are getting a javascript error in compatibility mode. The presence of an error would keep the javascript from executing even if it is loaded. You might also want to use the developer tools in IE8 to debug the javascript and/or verify if the file is loaded or not.
just spent couple of hours on this - IE7 & 8 suffers from "return" identificator
I had:
m["return"] = 123;
var x = m.return; // SILENT ERROR!
Obviously, renamaing identificator solves this

Resources