What is the difference between   and  ? - html

I have written one XSLT to transform xml to html. If input xml node contains only space then it inserts the space using following code.
<xsl:text> </xsl:text>
There is another numeric character which also does same thing as shown below.
<xsl:text> </xsl:text>
Is there any difference between these characters? Are there any examples where one of these will work and other will not?
Which one is recommended to add space?
Thanks,
Sambhaji

  is a non-breaking space ( ).
  is just the same, but in hexadecimal (in HTML entities, the x character shows that a hexadecimal number is coming). There is basically no difference, A0 and 160 are the same numbers in a different base.
You should decide whether you really need a non-breaking space, or a simple space would suffice.

It's the same. It's a numeric character reference.
A0 is the same number as 160. The first is in base 16 (hexadecimal) and the second is in base 10 (decimal, everyday base).

Related

Can you create a pattern for HTML input fields with a minimum number of letters of a certain type?

I want to create a pattern for an HTML input field that needs to have at least 10 numbers in it and may also have spaces and a plus sign on top of that, but it's not required.
It's important that numbers and spaces can be mixed though. Also, the whole field can only have 17 characters all in all.
I'm not sure if it's even possible. I started doing something like that:
pattern="[0-9+\s]{10,17}*"
But like this, it's not guaranteed that there are at least 10 numbers.
Thanks in advance! Hope the question doesn't exist already, I looked but couldn't find it.
You can use
pattern="(?:[+\s]*\d){10,17}[+\s]*"
The regex matches
(?:[+\s]*\d){10,17} - ten to seveteen occurrences of zero or more + or whitespaces and then a digit
[+\s]* - zero or more + or whitespaces.
Note the pattern is anchored by default (it is wrapped with ^(?: and )$), so nothing else is allowed.

What are the exponent characters (in non-formatted text)? How can I create these exponent characters?

I´m searching for a list of exponents like ¹²³ and so on and the same with letters. Note these still remain superscripted even in plain text.
Does something like these exist? If not, how can I create those?
(I need them for a website-project)
Unicode versions of superscripted/subscripted characters exist for all ten digits but not for all letters. They remain superscripted/subscripted in a plain-text environment without the need of format tags such as <sup>/<sub>.
However (as of v14), not all letters have Unicode superscripts. Furthermore, they are scattered along different Unicode ranges, and are in fact used mainly for phonetic transcription. Additionally, they are used for compatibility purposes especially if the text does not support markup superscripts and subscripts.
Exponent characters:
These are mostly used for mathematical and referencing usage.
- ⁰ [U+2070]
- ¹ [U+00B9, Latin-1 Supplement]
- ² [U+00B2, Latin-1 Supplement]
- ³ [U+00B3, Latin-1 Supplement]
- ⁴ [U+2074]
- ⁵ [U+2075]
- ⁶ [U+2076]
- ⁷ [U+2077]
- ⁸ [U+2078]
- ⁹ [U+2079]
- ⁺ [U+207A]
- ⁻ [U+207B]
- ⁼ [U+207C]
- ⁽ [U+207D]
- ⁾ [U+207E]
- ⁿ [U+207F]
- ⁱ [U+2071]
The "linear", "squared", and "cubed" subscripts are the most familiar and are found in Latin-1 Supplement. All the others are found in Superscripts and Subscripts. Add 0x2070 to all the non-Latin-1 Supplement superscripts to obtain the code point value of these digits. See this Wikipedia article and the official Unicode codepage segment.
Interesting notes
There are also subtle differences between <sup> subscripts and Unicode subscripts; Unicode subscripts are entirely different codepoints altogether, and some fonts professionally design subscripted letters because <sup> subscripts may look thin.
Compare x² with x2, similarly x⁺ with x+ (the first involves Unicode, the second is markup)
The best solution is to use markup, such as <sup>.
You can't create the characters, but you can format then as super-scripts if you are generating HTML.
As to find which exist, you just have to use an unicode-character searching resource and look for "superscript" to have a listing -
This query, for example:
https://www.fileformat.info/info/unicode/char/search.htm?q=superscript&preview=entity
As you can see, all digits are available (more than once, even), but very few letters.
However, if you intend to generate HTML output, the <sup> tag will work for any text you want, and give the necessary semantic meaning to the text - you can read about it and try it online here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup

What’s the difference between and &NewLine;?

Apart from readability, what is the difference between the HTML codes
and &NewLine;?
ASCII Code
HTML Entity &NewLine;
Hexadecimal value
These are all referring to the same thing but are represented in different ways. They all translate to Unicode U+0000A LINE FEED (LF)
Example:
The number 2 can be represented using 1+1. It can also be represented using |sqrt(4)|. The result is the same, but using different syntaxes we can achieve the same result in different ways.
References:
https://theasciicode.com.ar/ascii-control-characters/line-feed-ascii-code-10.html
https://www.quackit.com/character_sets/unicode/co_controls_and_basic_latin_unicode_character_codes.cfm
https://www.w3schools.com/html/html_symbols.asp
https://www.w3schools.com/charsets/ref_html_ascii.asp

difference between " " and nbsp; or " "

Hello I am trying to compile an EPUB v2.0 with html code extracted from Indesign. I have noticed there are a lot of "special characters" either at the beginning of a paragraph or at the end. For example
<p class="text_indent0px font_size0_8em line_height1_325 margin_bottom1px margin_left0px margin_right0px sans_serif floatleft">E<span class="small_caps">VELYNE</span> </p>
What is this
and can I either get rid of it or replace it with a "nbsp;"?
&#9
Is the ascii code for tabs. So I guess the paragraphs were indented with tabs.
If you want to replace them with then use 4 of them
That would be a horizontal tab (i.e. the same as using the tab key).
If you want to replace it, I would suggest doing a find/replace using an ePub editor like Sigil (http://sigil-ebook.com/).
represents the horizontal tab
Similarly represent space.
To replace you have to use
In the HTML encoding &#{number}, {number} is the ascii code. Therefore, is a tab which typically condenses down to one space in HTML, unless you use CSS (or the <pre> tag) to treat it as pre formatted text.
Therefore, it's not safe to replace it with a non-breaking or a regular space unless you can guarantee that it's not being displayed as a tab anywhere.
div:first-child {
white-space: pre;
}
<div> Test</div>
<div> Test</div>
<pre> Test</pre>
See https://developer.mozilla.org/en-US/docs/Web/CSS/white-space and http://ascii.cl/
is the entity used to represent a non-breaking space
decimal char code of space what we enter using keyboard spacebar
decimal char code of horizontal tab
and both represent space but is non-breaking means multiple sequential occurrence will not be collapsed into one where as for the same case, ` will collapse to one space
= approx. 4 spaces and approx. 8 spaces
There are four types of character reference scheme used.
Using decimal character codes (regex-pattern: &#[0-9]+;),
Using hexadecimal character codes (regex-pattern: &#x[a-f0-9]+;),
Using named character codes (regex-pattern: &[a-z]+;),
Using the actual characters (regex-pattern: .).
Al these conversions are rendered same way. But, the coding style is different. For example, if you need to display a latin small letter E with diaeresis then you could use any of the below convention:
ë (decimal notation),
ë (hexadecimal notation),
ë (html notation),
ë (actual character),
Likewise, as you said, what should be used (a) (decimal notation) or (b) (html notation) or (c) (decimal notation).
So, from the above analogy, it can be said that the (a), (b) and (c) are three different kind of notation of three different characters.
And, this is for your information that, (a) is a Horizontal Tab, the (b) one is the non-breaking space which is actually   in decimal notation and the (c) is the decimal notation for normal space character.
Now, technically space at the end of the paragraph, is nothing but meaningless. Better, you could discard those all. And if you still need to use space inside <pre> elements, not in <p> or <div>.
Hope this helps...

Special Number format in MS Access

I have a table with an ID number which has a special format as follow: 2500-001
By default the number format does not accept dash(-) in the middle of number and I can not make it a Text field as I need this ID as the Primary Key.
Would you please tell me if there is anyway to achieve this in Design View?
Thank you in advance
Use a text box input mask.
You can specify whether or not the dash is included in the data. See here for more information about input masks:
The three parts of an input mask
Input masks are made up one mandatory
part and two optional parts, and each part is separated by a
semicolon. The purpose of each part is as follows:
The first part is mandatory. It includes the mask characters or string
(series of characters) along with placeholders and literal data such
as, parentheses, periods, and hyphens.
The second part is optional and
refers to the embedded mask characters and how they are stored within
the field. If the second part is set to 0, the characters are stored
with the data, and if it is set to 1, the characters are only
displayed and not stored. Setting the second part to 1 can save
database storage space.
The third part of the input mask is also
optional and indicates a single character or space that is used as a
placeholder. By default, Access uses the underscore (_). If you want
to use another character, enter it in the third part of your mask.