indentation

How do I make xsl transformation indent the output?

北城以北 提交于 2019-11-29 09:32:14
I'm using xalan with the following xsl header: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:redirect="http://xml.apache.org/xalan/redirect" extension-element-prefixes="redirect" xmlns:xalan="http://xml.apache.org/xalan"> <xsl:output method="text" indent="yes" xalan:indent-amount="4"/> And the output is not indented. Anyone with ideas? For indentation you need to use a different namespace: " http://xml.apache.org/xslt " (see this issue ) <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:redirect="http://xml.apache.org

Why don't people indent C++ access specifiers/case statements?

一笑奈何 提交于 2019-11-29 09:06:24
I often see stuff like this: class SomeClass { public: void someMethod(); private: int someMember; }; This seems totally unnatural to me (the same applies to case -statements when using switch ). I expected something like this, when i started using C++ (it's been a long time since then, but i am still wondering): class SomeClass { public: void someMethod(); private: int someMember; }; Is there a funded reason to break (otherwise) consistent indentation rules? Increasing indentation normally reflects entry to a new nested scope, whereas both access specifiers and switch case statements don't

Emacs indent level global override

别说谁变了你拦得住时间么 提交于 2019-11-29 07:53:07
I want to set the indentation mode to tabs only, with a 4 character width for any mode. This seems like a trivial thing, but I have not had success. Every mode seems to have its own variables and options. I've tried doing this for Perl and R without success. Things that have not worked: (setq-default tab-width 4) (setq standard-indent 4) (setq-default r-indent-level 4) (setq perl-indent-level 4) (setq c-basic-offset 4) works for c-mode but nothing else. Am I forgetting something? Did I set the wrong variables? Is there no such option? I work with a variety of languages (R, Perl, sh, C/C++ etc.

Check string indentation?

耗尽温柔 提交于 2019-11-29 07:49:25
I'm building an analyzer for a series of strings. I need to check how much each line is indented (either by tabs or by spaces). Each line is just a string in a text editor. How do I check by how much a string is indented? Or rather, maybe I could check how much whitespace or \t are before a string, but I'm unsure of how. Gizmo To count the number of spaces at the beginning of a string you could do a comparison between the left stripped (whitespace removed) string and the original: a = " indented string" leading_spaces = len(a) - len(a.lstrip()) print(leading_spaces) # >>> 4 Tab indent is

Python IndentationError unindent does not match any outer indentation level

耗尽温柔 提交于 2019-11-29 06:51:16
I'm a beginner in python , I have this error : Error : def on_data(self,data): ^ IdentationError : unindent does not match any outer indentation level I code with notepad++ in windows 8.1 . I don't understand why I have this error, I have paid attention about tabs and space. I want to save data in self.file Here is my code : from tweepy import OAuthHandler from tweepy.streaming import StreamListener from tweepy import Stream import tweepy import time class StdOutListener(StreamListener): def __init__(self,file): self.file = file def on_data(self, data): print data self.file.write(data) return

VS Code indentation for Python

大憨熊 提交于 2019-11-29 06:47:55
How do I enable indentation in VS Code? I'm trying to learn Python (newbie in programming) and need auto-indentation. It worked with the first version I tried, but it doesn't indent after a colon ( : ) anymore. How can I configure it to automatically indent? Danny You can install VSCode python extension which will provide intellisense, auto-completion, code formatting, and debugging. Here is more information on the python extension, here As said there is the python extension which now do it out of the box, but still don't do a great job, and example is when you copy and past a whole block into

Disable auto indent globally in Emacs

牧云@^-^@ 提交于 2019-11-29 06:04:08
How to disable auto indent in Emacs globally or only for some modes? I have a number of packages installed for RubyOnRails (ruby, html, js, css). Let's say I want to disable autoindent for css-mode. You may want to look for variable names containing the word electric . (This is the common Emacs parlance for actions which occur automatically when particular visible characters are typed.) In this instance, M-x apropos-variable RET electric RET shows me that there is a css-electric-keys variable containing a list of "Self inserting keys which should trigger re-indentation." You could use M-x

How to fix the YAML syntax error: did not find expected '-' indicator while parsing a block?

折月煮酒 提交于 2019-11-29 05:37:53
I have some code written in my .travis.yml written for a Python library. Using lint.travis-ci.org , I came to know that there is some indentation problem in my YAML file. Here is the part which the error points to install: - if [[ "${TEST_PY3}" == "false" ]]; then pip install Cython; python setup.py build; # To build networkx-metis mkdir core; # For the installation of networkx core cd core; git clone https://github.com/orkohunter/networkx.git; cd networkx/; git checkout addons; python setup.py install; cd ..; fi Where am I wrong? The error says syntax error: (<unknown>): did not find expected

Emacs - override indentation

末鹿安然 提交于 2019-11-29 05:36:07
问题 I have a multiply nested namespace: namespace first {namespace second {namespace third { // emacs indents three times // I want to intend here } } } so emacs indents to the third position. However I just want a single indentation. Is it possible to accomplish this effect simply? 回答1: Use an an absolute indentation column inside namespace: (defconst my-cc-style '("gnu" (c-offsets-alist . ((innamespace . [4]))))) (c-add-style "my-cc-style" my-cc-style) Then use c-set-style to use your own style

Text indent after the first line in a paragraph

南楼画角 提交于 2019-11-29 04:30:47
问题 - A Reuters reporter in Surkhrod district in Nangarhar province, where villagers said the raids took place, said Afghan police fired at the crowd after some of them started throwing stones at local government buildings. In the above paragraph, I would like to use CSS to make all lines after the first line to automatically indent some space so that each line stays right after the - in the first line. HTML <p> - A Reuters reporter in Surkhrod district in Nangarhar province, where villagers said