lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Strip markup for spell checking?


From: Vadim Zeitlin
Subject: Re: [lmi] Strip markup for spell checking?
Date: Wed, 28 Oct 2015 18:19:53 +0100

On Wed, 28 Oct 2015 15:47:15 +0000 Greg Chicares <address@hidden> wrote:

GC> I'm looking for a way to check spelling in XSL files, excluding markup.

 Hello,

 I don't know of any tools specifically for spell checking XSL, but I think
any tool usable with XML should do and AFAIK many of them exist and aspell
does seem to support this and so does hunspell.

 But I'd just like to say how I do it, which is definitely very low
technological but works well for me: I open the file in Vim and do "set
spell", then use "]s" to go the next spelling error, correct it (usually by
just pressing "1z=" to select the first suggested replacement), press "]s"
again and so on.

 Unfortunately in this particular case, it doesn't work well out of the box
because there are so many field names used inside XSL expressions and Vim
syntax file is not smart enough to use @NoSpell for them. I am tempted to
fix this, but it risks taking me some time as I've never looked at this
syntax file before, so I've decided to not do it right now and only do it
if you'd like to spell check (m)any other XSL files in the same way --
please let me know if you do. In the meanwhile, I've just used a quick
grep+sed (who said I always used Perl for everything?) to create a file
with all the field names used in this file, to which I later added a few
words by marking them as "good for this session" in Vim itself (using "zG").

 After doing this I could spell check the entire file and, in addition to
the typo you found, only found one other one and that one in a comment:

---------------------------------- >8 --------------------------------------
diff --git a/nasd.xsl b/nasd.xsl
index 13bcdee..8cc2040 100644
--- a/nasd.xsl
+++ b/nasd.xsl
@@ -123,7 +123,7 @@
         </xsl:if>
       </fo:layout-master-set>

-      <!-- The data to be diplayed in the pages, cover page first -->
+      <!-- The data to be displayed in the pages, cover page first -->
       <xsl:call-template name="generic-cover"/>

       <!-- Basic Illustration -->
---------------------------------- >8 --------------------------------------

 If you'd like to automate this to ensure that new typos don't get checked
in, I think aspell is still the best solution. But if you just want to
check the file once right now, Vim is IMHO much more convenient (but then I
believe that Vim is the best tool for just about everything, so I would say
that). I attach the list of "good words" I created, just in case it can be
useful.

 Regards,
VZ

Attachment: xsl_good_words
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]