Regarding the XSLT language code, the template for quote eventually
calls the utility template named l10n.language, which uses the current
element (<quote>) as the context and scans ancestor-or-self for the
closest xml:lang attribute to determine the language, and falling back
to the default language of English. So, yes, putting xml:lang on the
quote element would work.
Bob Stayton
Sagehill Enterprises
b...@sagehill.net
On 11/30/2017 6:39 PM, Robert Nagle wrote:
Thanks to you and Ron for your ideas about how to deal with this issue.
Wow, I didn't even know that the quote element even existed. Both
solutions are interesting:
richard: I notice that QUOTE will surround the sentence with span tags
and then presumably insert the language-appropriate version of quotes.
Where does Docbook XSLT figure out the appropriate language? It looks
like the default language is English, but if I have a passage where the
language is different and uses different quotation marks, would the
attribute xml:lang be sufficient?
Robert
On Thu, Nov 30, 2017 at 6:50 PM, Richard Hamilton <hamil...@xmlpress.net
<mailto:hamil...@xmlpress.net>> wrote:
Hi Robert,
I avoid the issue entirely by using the DocBook <quote> element.
The <quote> element gives you language appropriate quotation marks,
and it will also handle quotes within quotes, which is a nice touch.
I don’t know of any automated smart quote processing in the DocBook
stylesheets (in fact, I’m nearly certain there isn’t any, beyond
processing <quote>).
If you have existing text with curly or straight quotes in the
source, converting them can be a bit tricky. I use emacs macros to
replace quoted text with <quote>…</quote>, and that works
surprisingly well. I match on the opening quote, capture everything
until the ending quote, then replace with <quote>captured
text</quote>. You need to be careful, since misplaced quotes can
cause some strange results, and you need to handle both curly and
straight opening and closing quotes, but generally it works well.
I think you can do something similar in Oxygen, but I haven’t done
it myself. Check out this page and look for the discussion about
“capturing groups":
https://www.oxygenxml.com/doc/versions/18/ug-editor/topics/find-replace-dialog.html
<https://www.oxygenxml.com/doc/versions/18/ug-editor/topics/find-replace-dialog.html>
I hope that helps.
Best regards,
Dick Hamilton
-------
XML Press
XML for Technical Communicators
http://xmlpress.net
hamil...@xmlpress.net <mailto:hamil...@xmlpress.net>
> On Nov 30, 2017, at 16:13, Robert Nagle
<idiotprogram...@gmail.com <mailto:idiotprogram...@gmail.com>> wrote:
>
> Up to now I've avoided dealing with the issue of smart quotes
(curly quotes) by simply dealing with straight quotes in my docbook
source.
>
> About 75% of my source comes from MS Word, and I then find some
way to paste or convert into Docbook XML.
>
> Another 25% comes from .txt or from content I actually edit in
Docbook.
>
> When I paste from MS Word to HTML, I often would get encoding
errors. Even when I didn't get encoding errors, the conversion would
be inconsistent or difficult to proof.
>
> Personally I could care less about smart quotes vs. curly quotes,
and honestly I believe that the reading system should be handling
the conversion from straight to curly quotes, but if the work
involved in getting curly quotes was minimal enough, I'd consider
doing it.
>
> I was wondering whether anyone here has created best practices
to make sure curly quotes are consistently implemented. (Does
Docbook have anything to do with it?). I use Oxygen, but I don't see
any option in Author mode to use only curly quotes.
>
> I usually just paste .txt files into a docbook file in Author
mode of Oxygen. I don't really know of an easy way to do
search/replace without requiring a lot of quality control. Does
anyone have any ideas?
>
> Thanks for your input.
>
> Robert Nagle
>
>
>
>
>
> --
> Robert Nagle
> 22118 FINCASTLE DR KATY TX 77450-1727
> (Cell) 832-251-7522 <tel:832-251-7522>; (Skype) idiotprogrammer;
Carbon Neutral Since Jan 2010
>
--
Robert Nagle
22118 FINCASTLE DR KATY TX 77450-1727
(Cell) 832-251-7522; (Skype) idiotprogrammer; Carbon Neutral Since Jan 2010
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org