Span, Span, Span, Span, Span, loverly Span.

 

Here is some code. Why won’t it compile?

    private
void transformAtomArraysIntoFrequencies() {

        Nodes atomArrayNodes = xmlInput.query(

                “./*[local-name()=’atomArray’ and @dictRef=’gamessuk:normal_coordinates’]”);

}

 

 

UPDATE

Gillean (see comments) has cracked it.

I cut-and pasted it out of Eclipse, into Word (where I think the quotes were honoured as U+0022 (http://www.fileformat.info/info/unicode/char/22/index.htm). It was then published DIRECTLY by Word to WordPress. One of them corrupted it.

The underlying source in WordPress looks like:

<span style=”color:#7f0055″><strong>void</strong><span style=”color:black”> transformAtomArraysIntoFrequencies() {</span>

                    </span></span></span></span></p><p><span style=”color:black; font-family:Courier New; font-size:10pt”> Nodes atomArrayNodes = <span style=”color:#0000c0″>xmlInput<span style=”color:black”>.query(</span>

            </span></span></p><p><span style=”color:black; font-family:Courier New; font-size:10pt”> <span style=”color:#2a00ff”>”./*[local-name()=’atomArray’ and @dictRef=’gamessuk:normal_coordinates’]”<span style=”color:black”>);

(The quote is still U+0022 at this stage.) Note the emulation of the Vikings in span,span,span,span, span loverly span. What garbage. WordPress is one of the most awful tools I have every used for editing. It corrupts everything. (Ok it’s probably an old version – I am not in control).

Then if we look at the page source of the post we find

 <span style=”color:#2a00ff”>“./*[local-name()=’atomArray’ and @dictRef=’gamessuk:normal_coordinates’]“<span…

 

ARGHH! ARGHH! WordPress has changed the quotes into smart quotes U+8820. ARGHHH. I can’t stop it. Blink, and it reverts. You cannot cut the heads off the hydra. It regrows. Sometimes it multiplies. And you end up with rows of empty Spans.

 

It has beaten me. Which is why I don’t post code any more.

 

(Yes I have tried code formatters and other things in WordPress. No use).

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Span, Span, Span, Span, Span, loverly Span.

  1. Assuming this is really a question (the post is titled ‘test’ 🙂 then I would guess that the double quote marks are the problem? Is this another unicode thing?

  2. Jez Cope says:

    I was sure I’d come across this before, so I did a quick Google which turned up this method:
    http://www.lancebledsoe.com/how-to-turn-off-wordpress-smart-quotes/
    I’ve just tested it out and it seems to work in the latest version of WordPress, though there are reports of it not working in some situations. I hope that helps.
    Jez

  3. Peter Morgan says:

    I have had similar issues with Eclipse on more than one occasion, i have since changed over to PSPad editor which is also free and a lot more reliable.

Leave a Reply

Your email address will not be published. Required fields are marked *