text-formatting

JSTL/JSP EL (Expression Language) in a non JSP (standalone) context

Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)? I would expect to be able to instantiate a an object of some sort, give it a template along the lines of Dear ${customer.firstName}. You order will be dispatched on ${order.estimatedDispat...

XML Text Format

Does anyone know of a good program where I can paste in xml (getting it from a System.out in my java class) and it will format the xml so it's not a really long line of text? ...

Nice bit of code to format an xml string

hi Anyone got a ready made function that will take an XML string and return a correctly indented string? eg <XML><TAG1>A</TAG1><TAG2><Tag3></Tag3></TAG2></XML> and will return nicely formatted String in return after inserting linebreaks and tabs or spaces? Yes I know the code is easy to write but I'm sure someone else has already w...

What is the WPF XAML Data Binding equivalent of String.Format?

Or, to be more clear, how can I format a block of text (in my case, to be included within a tooltip) such that some portions of the text come from bound values. In plain C# I would use: _toolTip.Text = string.Format("{1:#0}% up, {2:#0}% down", Environment.NewLine, percentageOne, percentage2); However the WPF XAML markup for a Tex...

.NET Make xml more readable

Is there any way to take an xml string in .net and make it easyer to read? what i mean is can i convert this: <element1><element2>some data</element2></element1> to this: <element1> <element2> some data </element2> </element1> is there any built in class for this? as sql server 2005 seems to remove all formatting on...

Creating columns of text with a variable width font.

I'm trying to create coloumns of text for a C# app that will be running on MSN Messenger. I'm having trouple getting everything to line up. Here's an example of the output that I want: 1) Pizza Hut 123 Fake St. 2) Domino's Pizza 123 Fake St. 3) The Che...

Utility code to DataSet/DataReader table to console in Tabular format, table dimensions set at runtime.

Hello, I am essentially trying to replicate the same features as SQL Management Studio's Results To Text, to prettify my DataSet/DataReader object into a string based table. I am looking for a free (GNU or BSD/MIT licensed or equivalent) utility code if existing which will let me print out data in a tabular format. I am appending to ...

[Java] use of delimiter function from scanner for "abc-def"

Hi! I'm currently trying to filter a text-file which contains words that are separated with a "-". I want to count the words. scanner.useDelimiter(("[.,:;()?!\" \t\n\r]+")); The problem which occurs simply is: words that contain a "-" will get separated and counted for being two words. So just escaping with \- isn't the solution of c...

Use a custom thousand separator in C#

Hi, I'm trying not to use the ',' char as a thousand separator when displaying a string, but to use a space instead. I guess I need to define a custom culture, but I don't seem to get it right. Any pointers? eg: display 1000000 as 1 000 000 instead of 1,000,000 (no, String.Replace() is not the solution I'd like to use :P) ...

Wiki-like formatting in Rails

I forgotten the name of this library. But it's sort of like Wiki how you type certain characters in front of your text, and then it'll make the text bold/italic/underline. I'm not asking for the way Wiki is formatted but I'm aware there is something similar built into Rails. It's at the tip of my tongue. Thanks. ...

C# Read text formatting?

Dear All, I want to be able to read text from a Silverlight TextBlock (TextBlock Control) (Silverlight & C#) and check what formatting (as in: bold, italic, font size, etc...) has been applied to it, so I can store it in an XML file. Is it possible to find out what formatting has been applied to a piece of text with C# and Silverlight ...

RichTextBox Text Positioning

Hello, I'm building a simple application, but I need to know how to use a RichTextBox and position the text on it, like: center, right and left. But how I can do this? ...

How to permit HTML to break at specified points?

I know about non-breaking spaces but I've got the opposite problem and Google doesn't even find anyone else asking the question. I have a piece of text: <option A>/<option B>/<option C> (the number of options is variable) that I want to break only at the slashes. Keeping it from breaking elsewhere is trivial--replace the spaces with n...

How to create Bold data in MySQL database text field?

Is it possible to create bold text in a MySQL database text table field? We are putting our articles in our database and I want to create bold titles and subtitles. Is this possible? Thanks ...

PyQt lineEdit with colors

Hi fellows! I'm trying to format a Qt lineEdit text with colors. def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.lineEdit.setText("here be colors") I searched a lot but only found customized drawing widgets with monstrous amounts of code. I...

Converting all uppercase letters to init caps.

I was wondering if there was any way using only CSS, (and this CAN be browser specific CSS) to convert all uppercase text to words that are only initially capitalized for example: I YELL WITH MY KEYBOARD would be converted to: I Yell With My Keyboard EDIT: I realized I wasn't clear enough in my question, the text was entered capitali...

Displaying paragraphs in HTML

Hi all, I'm writing a web application which needs to bring the stored paragraphs into the front web. The text come from excel work sheet and contains control characters like indent. I want to show the text in the exactly manner as it was in excel. How can I do that then? Thanks in advance. ...

Paste from MS Word document to a Web Form

What is the most common way people preserve basic formatting elements like bold emphasis and italics when copying to a textarea from an MS Word document. I noticed that Gmail does this well and StackOverflow does not. Are there common frameworks that do this? ...

What elisp or macro magic can make this text transformation?

I have a set of SQL statements formatted like so: INSERT INTO reports.workload (workload_id,event_time,event_type_id,agent_id) VALUES (-42000,'2010-02-23 07:30:38.941436',1,NULL); Right now, the VALUES tuple is aligned at the start with the column name tuple. However, what I want is to have the tuple's el...

How to create HTML text from C# application?

I have C# application that must store some information into MS SQL that would be later sent to email with DB Mail. Within C# application I have a class with several properties and I need to use it to generate email text. So what I would like is set up a template with placeholders for variables. I need to create text as HTML and plain t...