Does TEXT in MySQL retain spaces/formatting for XML? - mysql

If I embed XML into a TEXT column in MySQL, will it retain the spacing/indentation of the XML blob? Will I need to fix the markup when I retrieve it so it isn't just a long string?

Per the docs, the text you put in will stay untouched (except for possible truncation if you try to put more text in than the datatype can accept). Indeed, there are few differences with VARCHAR: no DEFAULT value, and, if you put an index on a TEXT column, you must specify the prefix length, which is only optional for VARCHAR.

Related

Excel string to HTML code / inserting text mid string

How do I insert text (a URL link) from another cell (B1) into this cell (C1) containing HTML code like this:
<h4>Features</h4><ul><li>Available in other fabrics</li></ul>
Note:
- The insert text should fill in the tag.
- I tried using concat strings and convert the " into &CHAR(32) but it's not working.
- I have a few thousand rows of this data to work thru. Each URL link is different depending on the productSKU. So this process has to be automated.
- I am not familar with VB.
Thanks for your help.
So it should be something like
=SUBSTITUTE(C1,CHAR(34)&CHAR(34),CHAR(34)&B1&CHAR(34))
assuming the "" only occurs in the href tag.
It's easier than the alternative which would be
=SUBSTITUTE(C1,"""""",""""&B1&"""")
(you have to type a pair of double quotes for each double quote you want)
You might consider defining a name (say q) as =char(34) then it would be
=SUBSTITUTE(C1,q&q,q&B1&q)

Should punctuation always match the text format in HTML?

I am asking this out curiosity. I want to know if there's a rule or standard to include punctuation along with the text format, such as in the following:
<i>This is italic</i>; but a semicolon exists outside of it.
or
<b>This sentence is in a bold format</b>. The period is not included inside it though.
Does it matter that the punctuation exists outside of its format or not, if so on what standard it based upon?

Does "Text" in the HTML5 syntax mean "any character"?

I wasn't able to find any restrictions what characters are allowed in Text does this imply that erverthing is allowed or are there restrictions that affect HTML documents in general?
For example the Character Reference Section states that:
The numeric character reference forms [...] are allowed to reference any Unicode code point other than U+0000, U+000D, permanently undefined Unicode characters (noncharacters), surrogates (U+D800–U+DFFF), and control characters other than space characters.
Are those characters still allowed in their "unescaped" form in Text? E.g. as attribute value: <span title="Hello ␀ World"></span> where ␀ is the U+0000 NULL character (not U+2400).
The character restriction for text on your page and in your markup is defined according to your selected character set. If you don't define a character set, the browser will take a guess or assert its default option (usually, whatever is the least restrictive). The character set is defined by using the meta tag with the charset attribute in your document's head section. The most common example of this uses the UTF-8 character set:
<meta charset="UTF-8" />
The value of this attribute can be any of the character sets defined by the Internet Assigned Numbers Authority (IANA). The full list of defined character sets is available here.
Additionally, there may be specific restrictions on unescaped text used within certain elements (or types of elements). In this case, you would have to read the specifications for that tag or type of tag, or simply escape the characters in question by replacing them with their ampersand-encoded html entities escape values.
I dont think that there is any restriction which is there on Text in the context which you have pointed. The text here means all the allowed alphabets,numbers and alphanumeric characters.
The answer is in the link you provided:
Text is allowed inside elements, attribute values, and comments. Extra constraints are placed on what is and what is not allowed in text based on where the text is to be put, as described in the other sections
Now if we go to the syntax definition for CDATA sections:
CDATA sections must consist of the following components, in this
order:
The string "<![CDATA[".
Optionally, text, with the additional restriction that the text must not contain the string "]]>".
The string "]]>".
So every type of content has it's own set of restrictions, and text is just used to define the superset of all characters, symbols and so on...

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.

What is datetime in HTML?

I was learning HTML from a book and a noticed an example,
<del datetime="20040329">fluffy kitten</del>
What does datetime mean and what does it do?
A deleted text, with a date and time of when the text was deleted:
<p>My favorite color is <del datetime="2009-01-08T22:55:03Z">blue</del>
<ins>red</ins>!</p>
more info http://reference.sitepoint.com/html/del/datetime
http://www.w3.org/community/webed/wiki/HTML/Elements/del
The datetime attribute specifies the date and time when the text was deleted.
This links may help you
http://www.w3schools.com/tags/att_del_datetime.asp
http://www.w3schools.com/html5/tag_time.asp
<p>My favorite color is <del datetime="2009-01-08T22:55:03Z">blue</del>
<ins>red</ins>!</p>
Answer
http://www.w3.org/TR/2010/WD-html-markup-20101019/del.html
The del element represents a range of text that has been deleted from a document.
datetime - The date and time when the text was deleted. A valid date-time as defined in [RFC 3339], with these additional qualifications:
the literal letters T and Z in the date/time syntax must always be uppercase
the date-fullyear production is instead defined as four or more digits representing a number greater than 0
It shows when some text was deleted, reference. The deleted text is crossed out.
The datetime attribute specifies the date and time when the text was deleted. It no visual effect in ordinary web browsers,
Syntax
<del datetime="YYYY-MM-DDThh:mm:ssTZD">