text:
Cookbook:Sweeteners

| Basic foodstuffs

A sweetener is a food additive which adds the basic taste of sweetness to a food; it may come from a natural source or it may be artificially manufactured.

Sugar

 * table sugar
 * Coconut sugar
 * fructose
 * maltose
 * maple sugar

Liquid sweeteners

 * Agave syrup
 * apple juice concentrate
 * cane syrup (US) aka golden syrup (AUS/NZ) aka light treacle (UK)
 * corn syrup
 * glycerol
 * Gula Jawa
 * honey
 * maple syrup
 * molasses
 * blackstrap (US) = dark treacle (UK & AUS)
 * Simple syrup
 * sorghum aka sorghum molasses aka sorghum syrup
 * stevia

Artificial sweeteners
The list below includes the apparent sweetness of the sweetener, when compared to granulated sugar. This is for the chemical sweetener; commercially available preparations may be less sweet due to binders and fillers like dextrose.

 * acesulfame potassium (also known as Acesulfame-K or Ace-K) - 200x
 * alitame
 * aspartame - 160x (trademarked as Equal and Nutrasweet)
 * cyclamate (calcium cyclamate or sodium cyclamate) - 30x
 * Erythritol
 * glucitol / sorbitol
 * isomalt
 * saccharin (also spelled saccarine, saccarin, or saccharine) - 300x (Sweet'n Low)
 * stevia - 250x (also called Steviosides, or Sweetleaf. Marketed as a 'Dietary Supplement'. Truvia and PureVia are sweeteners partially derived from Stevia. )
 * sucralose (trademarked as Splenda or Splendar) - 600x
 * xylitol - 1x (gram for gram); 1.5x (joule for joule)

title: Cookbook:Sweeteners


text:
Norwegian

 * /Cover/
 * /Contributors/
 * Introduksjon ~ Introduction

Lessons

 * 1) Presenter deg Introducing Yourself [[Image:25%.svg]]
 * 2) Grunnleggende grammatikk Basic Grammar [[Image:25%.svg]]
 * 3) Kjekt å vite Nice to Know [[Image:25%.svg]]

Vocabulary
/Months and Weekdays/ | /Numbers/ | /Time/ | /Useful Expressions/

Appendices
Advanced Noun Inflection | Norwegian Pronunciation | Misunderstandings | Fast translation rules

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Norwegian


text:
Cookbook:Dairy

| Basic foodstuffs

Dairy ingredients are generally the products of milk and are used in a variety of different ways. Almost all of the dairy consumed by humans is derived from domesticated herbivores, such as cows, goats, sheep, buffalo, etc. Dairy products from cows are most prominent globally, but many cultures and specialty products rely on other animal sources.

Characteristics
Most dairy products have a white or off-white color and a mild, slightly sweet flavor—the exception is fermented dairy products (e.g. yogurt, cheese), which develop more complex flavors, textures, and colorations as a result of the microbial action on the initial milk or cream. Unless the fat has been removed, dairy products are rich, but the final fat content depends on the processing techniques.

Varieties
All dairy products begin with milk, which is then processed in a variety of ways to make different products:

Selection and storage
Most dairy products—especially fresh ones—are perishable, and they must be stored carefully in the refrigerator. Fermented, cured, and pasteurized dairy products have a longer shelf life, but some may still be perishable, depending on the method of production.

Use
Dairy products have a wide range of uses in cooking, where they typically contribute to flavor and texture. Both the proteins and sugars in dairy products can contribute to the maillard reaction, resulting in the generation of browning and complex flavors. Yeasted products especially benefit from this, as the yeast cannot break down the added lactose. Dairy products containing fat will also contribute richness, tenderness, and flavor to dishes. Fermented dairy products can add acidity. All dairy products will also contribute moisture, although the amount will depend on the specific product.

Abstinence
People abstain from dairy as a category for a variety of reasons. Health-wise, a large number of adults are lactose intolerant, which requires them to avoid certain dairy products, most often fresh dairy products where the lactose has not been broken down by fermentation. Individuals may also be allergic to some of the proteins in milk, which typically prevents the consumption of all dairy products. Under the Jewish laws of kashrut, dairy products may not be combined with meat. Vegans abstain from all animal products, including dairy. Individuals with lactose intolerance may need

Substitution
Sometimes, different dairy products can substitute for each other, depending on the exact characteristics called for in the original recipe. You'll want to assess the moisture content, fat content, and acidity and choose/modify a substitute to match the original characteristics as much as possible. Similarly, in certain circumstances, dairy products can be substituted by non-dairy ingredients, depending on the function of the dairy in the original recipe. It will, however, be harder to match the flavor profile and milkfat characteristics.

Index
For a full list of dairy ingredients, see Category:Dairy or browse below:

title: Cookbook:Dairy


text:
Cookbook:Grains

| Basic foodstuffs

Grains are the seeds or fruits of cereal grasses and, in common usage, other commercially similar plants such as soybeans.

True cereals

 * Barley
 * Maize (Corn)
 * Millet
 * Oats
 * Rice
 * Rye
 * Triticale
 * Sorghum (Milo)
 * Teff
 * Wheat
 * Spelt
 * Kamut

Pseudo-cereals

 * Alfalfa (Lucerne)
 * Amaranth
 * Buckwheat
 * Legumes
 * Quinoa
 * Wild Rice

Grain Derivatives

 * Bulgur
 * Couscous (usually wheat)
 * Kasha

ספר מתכונים/דגנים

title: Cookbook:Grains


text:
Cookbook:Lemonade

| Cuisine of the United States | Beverages

Lemonade is a sweetened beverage made from lemons, sugar, and water. It is popular in the United States during the spring and summer, when it is generally served chilled with ice. In some countries, the word 'lemonade' is also used to describe any clear carbonated drink; in others, it means any fruit-flavored soda.

Ingredients

 * 1 cup (250 ml/8.5 oz) fresh lemon juice
 * ¾–1 cup (160–225 g/5.6–7.9 oz) white or turbinado sugar
 * 5–6 cups (1.2–1.5 L) water

Special equipment

 * Citrus reamer

Procedure

 * 1) Combine the lemon juice and sugar in a pitcher or jug. Stir until the sugar is dissolved.
 * 2) Stir in the water.
 * 3) Chill and/or serve over ice.

Notes, tips, and variations

 * Using turbinado sugar will result in a golden-brown color and mild caramel flavor.
 * Because sugar dissolves easier in warm liquid, you may want to heat some of the water and dissolve the sugar in it before combining with the remaining ingredients.
 * Hard lemonade incorporates an alcoholic spirit, such as tequila, gin, or vodka to the lemonade.
 * Various fruits, such as strawberries and raspberries can be added for color and flavor. A small amount of beet juice results in pink lemonade with little change in flavor.
 * Herbs such as mint, borage, lavender, and lemon verbena can change the aroma of the drink.
 * Including the lemon peels, bruised and sliced, gives more bite and a stronger aroma.
 * Other citrus fruits can be used, including lime, orange, and grapefruit. Sugar and water content should be adjusted to taste. In American parlance, these are not technically lemonades, but limeade, orangeade, etc.
 * The sugar can be replaced by other alternative sweeteners.

simple:Cookbook:Lemonade

title: Cookbook:Lemonade


text:
Cookbook:Beverages

Beverages are liquids intended for drinking. For a complete, automatically generated list of recipes see Category:Beverage recipes or browse below.

Recipes
See the drop-down menu for beverage recipes below:

Cocktails Livre de cuisine/Boissons ספר מתכונים/משקאות hy:Եփութուխ:Խմիչքներ Libro di cucina/Cocktail 料理本/飲料 ro:Carte de bucate:Băuturi Drinkboken

title: Cookbook:Beverages


text:
User:Steinsky

w:User:Steinsky.

title: User:Steinsky


text:
Talk:General Biology/Cells/How Cells Divide

Overlap between Wikipedia and textbooks
I have started making some diagrams that illustrate mitosis and meiosis. (also, see: ) I am trying to think how to do it so that the diagrams can also be used here. Suggestions?

Would be more useful if there were three separate diagrams instead of just the one with three types of cell division - Marsh 18:54, 31 Mar 2004 (UTC)

 * That big diagram was for a comparison of the three types. The three parts can easily be split out. JWSurf 21:07, 31 Mar 2004 (UTC)


text:
XML - Managing Data Exchange/XSLT and Style Sheets

In previous chapters, we have introduced the basics of using an XSL stylesheet to convert XML documents into HTML. This chapter will briefly review those concepts and introduce many new ones as well. It is a reference for creating stylesheets.

XML Stylesheets
The eXtensible Stylesheet Language (XSL) provides a means to transform and format the contents of XML document for display. It includes two parts, XSL Transformation (XSLT) for transforming the XML document, and XSLFO (XSL Formatting Objects) for formatting or applying styles to XML documents. The XSL Transformation Language (XSLT) is used to transform XML documents from one form to another, including new XML documents, HTML, XHTML, and text documents. XSL-FO can create PDF documents, as well as other output formats, from XML. With XSLT you can effectively recycle content, redesigning it for use in new documents, or changing it to fit limitless uses. For example, from a single XML source file, you could extract a document ready for print, one for the Web, one for a Unix manual page, and another for an online help system. You can also choose to extract only parts of a document written in a specific language from an XML source that stores text in many languages. The possibilities are endless!

An XSLT stylesheet is an XML document, complete with elements and attributes. It has two kinds of elements, top-level and instruction. Top-level elements fall directly under the  root element. Instruction elements represent a set of formatting instructions that dictate how the contents of an XML document will be transformed. During the transformation process, XSLT analyzes the XML document, or the source tree, and converts it into a node tree, a hierarchical representation of the entire XML document, also known as the result tree. Each node represents a piece of the XML document, such as an element, attribute or some text content. The XSL stylesheet contains predefined “templates” that contain instructions on what to do with the nodes. XSLT will use the  attribute to relate XML element nodes to the templates, and transform them into the result document.

Let's review the stylesheet, city.xsl from chapter 2, and examine it in a little more detail:

Exhibit 1: XML stylesheet for city entity

 Since a stylesheet is an XML document, it begins with the XML declaration. This includes the pseudo-attributes  and. They are called pseudo because they are not the same as element attributes. The standalone attribute allows you to directly specify an external DTD The  tag declares the start of the stylesheet and identifies the version number and the official W3C namespace. Notice the conventional prefix for the XSLT namespace, xsl. Once a prefix is declared, it must be used for all the elements. The <xsl:output> tag is an optional element that determines how to output the result tree. The  element defines the start of a template and contains rules to apply when a specified node is matched. The  attribute is used to  (match) the template with an XMLelement, in this case the root (/), or whole branch, of the XML source document. If no output method has been specified, the output would default to HTML in this case since the root element is the start tag The  element is an empty element since it has no character content. It applies a template rule to the current element or the element's child nodes. The  attribute contains a location path telling it which element's content to process. The instruction element  extracts the string value of the child of the selected node, in this case, the text node child of

The  element defines the rules that implement a change. This can be any number of things, including a simple plain-text conversion, the addition or removal of XML elements, or simply a conversion to HTML, when the pattern is matched. The pattern, defined in the element’s  attribute, contains an abbreviated ../XPath/ location path. This is basically the name of the root element in the doc, in our case, "tourGuide."

When transforming an XML document into HTML, the processor expects that elements in the stylesheet be well-formed, just as with XML. This means that all elements must have an end tag. For example, it is not unusual to see the  tag alone. The XSLT processor requires that an element with a start-tag must close with an end tag. With the  element, this means either using   or   As mentioned in Chapter 3, the   element is an empty element. That means it carries no content between tags, but it may have attributes. Although no end tags are output for the HTML output, they still must have end-tags in the stylesheet. For instance, in the stylesheet, you will list:  or as an empty element. The HTML output will drop the end-tag so it looks like this:  On a side note, the processor will recognize html tags no matter what case they are in - BODY, body, Body are all interpreted the same.

Output
XSLT can be used to transform an XML source into many different types of documents. XHTML is also XML, if it is well formed, so it could also be used as the source or the result. However, transforming plain HTML into XML won't work unless it is first turned into XHTML so that it conforms to the XML 1.0 recommendation. Here is a list of all the possible type-to-type transformations performed by XSLT:

Exhibit 2: Type-To-Type Transformations

The  element in the stylesheet determines how to output the result tree. This element is optional, but it allows you to have more control over the output. If you do not include it, the output method will default to XML, or HTML if the first element in the result tree is the element. Exhibit 3 lists attributes.

Exhibit 3: Element output attributes <SMALL>(from Wiley: XSL Essentials by Michael Fitzgerald)</SMALL>

XML to XML
Since we have had a lot of practice transforming an XML document to HTML, we are going to transform city.xml, used in chapter 2, into another XML file, using host.xsd as the schema.

Exhibit 4: XML document for city entity

Exhibit 5: XSL document for city entity that list cities by City ID

Exhibit 6: XML schema for host city entity

Exhibit 7: XML stylesheet for city entity

 * Although the  is set to "xml", since there is no   element as the root of the result tree, it would default to XML output.
 * is a top-level element that creates a group of attributes by the name of "date." This attribute set can be reused throughout the stylesheet. The element  also has the attribute use-attribute-sets allowing you to chain together several sets of attributes.
 * The  produces the XML stylesheet processing instructions.
 * The element  creates a comment in the result tree
 * The  element allows you to add an attribute to an element that is created in the result tree.

The stylesheet produces this result tree:

Exhibit 8: XML result tree for city entity

The processor automatically inserts the XML declaration at the top of the result tree. The processing instruction, or PI, is an instruction intended for use by a processing application. In this case, the href points to a local stylesheet that will be applied to the XML document when it is processed. We used  to create new content in the result tree and added attributes to it.

There are two other instruction elements for inserting nodes into a result tree. These are  and. Unlike, which only copies content of the child node (like the child text node), these elements copy everything. The following code shows how the copy element can be used to copy the city element in city.xml:

Exhibit 9: Copy element

The result looks like this:

Exhibit 10: Copy element result

The output isn't very interesting, because copy does not pick up the child nodes, only the current node. In our example, it picks up the two city nodes that are in the city.xml file. The copy element has an optional attribute, use-attribute-sets, which allows you to add attributes to the element. However, it will leave behind any other attributes, except the namespace, if it is present. Here is the result if a namespace is declared in the source document, in this case, the default namespace:

Exhibit 11: Namespace result

If you want to copy more from the source file than just one node, the  element includes the current node, and any attribute nodes that are associated with it. This includes any nodes that might be laying around, such as namespace nodes, text nodes, and child element nodes. When we apply the  element to city.xml, the result is almost an exact replica of city.xml! You can also copy comments and processing instructions using  and  where   is the value of the name attribute in the processing instruction you wish to retrieve.

Why would this be useful, you ask? Sometimes you want to just grab nodes and go! For example, if you want to place a copy of city.xml into a SOAP envelope, you can easily do it using. If you don't already know, Simple Object Access Protocol, or SOAP, is a protocol for packaging XML documents for exchange. This is really useful in a B2B environment because it provides a standard way to package XML messages. You can read more about SOAP at www.w3.org/tr/soap.

Use an XML editor to create the above XML Stylesheets, and experiment with the  and   elements.

Templates
Since templates define the rules for changing nodes, it would make sense to reuse them, either in the same stylesheet or in other stylesheets. This can be accomplished by naming a template, and then calling it with a  element. Named templates from other stylesheets can also be included. You can quickly see how this is useful in practical applications. Here is an example using named templates:

Exhibit 110: Named templates

Templates also have a mode attribute. This allows you to process a node more than once, producing a different result each time, depending on the template. Let's create a stylesheet to practice modes.

Exhibit 12: XML template modes

 * tells the processor to look for a template that has the same mode attribute value
 * returns the current node which is converted to a string with Using  will also return the current node.

The result isn't very flattering since we didn't do much with the file, but it gets the point across.

Exhibit 13: Result from above stylesheet

By default, XSLT processors have built-in template rules. If you apply a stylesheet without any matching rules, and it fails to match a pattern, the default rules are automatically applied. The default rules output the content of all the elements.

Sorting
Writing “well formed” code XML is vital. At times, however, simply displaying information (the most elementary level of data management) is not all that is necessary to properly identify a project. As information technology specialists, it is necessary to fully understand that order is vital for interpretation. Order can be attained by putting data in a format that is quickly readable. Such information then becomes quickly usable. Using a comparative model or simply looking for a specific name or item becomes very easy. Finding a specific musical artist, title, or musical type becomes very easy. As an Information Specialist, you must fully be aware that it often becomes necessary to sort information. The basis of sorting in XMLT is the xsl:sort command. The xsl:sort element exemplifies a sort key component. A sort key component identifies how a sort key value is to be identified for each item in the order of information being sorted. A Sort Key Value is defined as “the value computed for an item by using the Nth sort key component” The significance of a sort key component is realized either by its select attribute, or by the contained sequence constructor. A Sequence Constructor is defined as a “sequence of zero or more sibling nodes in the stylesheet that can be evaluated to return a sequence of nodes and atomic values”. There are instances when neither is present. Under these circumstances, the default is select=".", which has the effect of sorting on the actual value of the item if it is an atomic value, or on the typed-value of the item if it is a node. If a select attribute is present, its value must be an Xpath expression.

The following is how the <xsl:sort> element is used to sort the output.

Sort Information is held as Follows: Sorting output in XML is quite easy and is done by adding the <xsl:sort> element after the <xsl:for-each> element in the XSL file.

Exhibit 14: Stylesheet with sort function

This example will sort the file alphabetically by artist name. Note: The select attribute indicates what XML element to sort on. Information can be SELECTED and SORTED by “title” or “artist”. These are categories that the XML document will display within the body of the file.

We have used the  function to sort the results of an   statement before. The sort element has many other uses as well. Essentially, it instructs the processor to sort nodes based on certain criteria, which is known as the sort key. It defaults to sorting the elements in ascending order. Here is a short list of the different attributes that sort takes:

Exhibit 15: Sort attributes

The sort element can be used in either the  or the   elements. It can also be used multiple times within a template, or in several templates, to create sub-ordering levels.

Numbering
The  instruction element allows you to insert numbers into your results. Combined with a sort element, you can easily create numbered lists. When this simple stylesheet, hotelNumbering.xsl, is applied to city_hotel.xml, we get the result listed below:

Exhibit 16: Sorting and numbering lists

Exhibit 17: Result hotelNumbering.xsl 1. Bull Frog Inn 2. Mandarin Oriental Kuala Lumpur 3. Pan Pacific Kuala Lumpur 4. Pook's Hill Lodge

The expression in  is evaluated and the value for   is based on the sorted node list. To improve the looks we are adding the format attribute with a linefeed character reference (&#xa;), a zero digit to indicate that the number will be a zero digit to indicate that the number will be an integer type, and a period and space to make it look nicer. The format list can be based on the following sequences:

Exhibit 17: Numbering formats – Uppercase letters – Lowercase letters – Uppercase Roman numerals – Lowercase Roman numerals – Numeral prefix – Integer prefix/ hyphen prefix To specify different levels of numbering, such as sections and subsections of the source document, the  attribute is used, which tells the processor the levels of the source tree that should be considered. By default, it is set to, as seen in the example above. It also can take values of  and. The  attribute is a pattern that tells the processor which nodes to count (for numbering purposes). If it is not specified, it defaults to a pattern matching the same node type as the current node. The  attribute can also be used to specify the node where the counting should start.

When level is set to, the processor searches for nodes that match the value of  , and if it is not present, it matches the current node. When it finds the match, it creates a node-list and counts all the matching nodes of that type. If the  attribute is listed, it tells the processor where to start counting from, rather than counting all nodes

When the level is, it doesn't just count a list of one node type, it creates a list of all the nodes that are ancestors of the current node, in the actual order from the source document. After this list is created, it selects all the nodes that match the nodes represented in count. It then maps the number of preceding siblings for each node that matches count. In effect,  remembers all the nodes separately. This is where  is different. It will number all the elements sequentially, instead of counting them in multiple levels. As with the other two values, you can use the  attribute to tell the processor where to start counting from, which in effect will separate it into levels.

This is a modification of the example above using the :

Exhibit 18: Sorting and numbering lists

Exhibit 19: Result – hotelNumbering2.xsl 1.1 Bull Frog Inn 1.2 Pook's Hill Lodge 2.1 Pan Pacific Kuala Lumpur 2.2 Mandarin Oriental Kuala Lumpur

The first template matches the root node and then selects all  nodes that have   as an ancestor, creating a node-list. The next template recursively processes the  element, and gives it a number for each instance of   based on the number of elements in the attribute. This is figured out by counting the number of preceding siblings, plus 1.

Formatting
Formatting numbers is a simple process so this section will be a brief overview of what can be done. Placed within the XML stylesheet, functions can be used to manipulate data during the transformation. In order to make numbers a little easier to read, we need to be able to separate the digits into groups, or add commas or decimals. To do this we use the  function. The purpose of this function is to convert a numeric value into a string using specified patterns that control the number of leading zeroes, separator between thousands, etc. The basic syntax of this function is as follows: The following are the characters and their meanings used to represent the number format when using the format-number function within a stylesheet:
 * is a string that lays out the general representation of a number. Each character in the string represents either a digit from number or some special punctuation such as a comma or minus sign.
 * is a string that lays out the general representation of a number. Each character in the string represents either a digit from number or some special punctuation such as a comma or minus sign.

Exhibit 20: Format-number function Symbol             Meaning 0              A digit. #              A digit, zero shows as absent. . (period)     Placeholder for decimal separator. ,              Placeholder for grouping separator. ;              Separate formats. -              Default prefix for negative. %              Multiply by 100 and show as a percentage. X              Any other characters can be used in the prefix or suffix. ‘              Used to quote special characters in a prefix or suffix.

Conditional Processing
There are times when it is necessary to display output based on a condition. There are two instruction elements that let you conditionally determine which template will be used based on certain tests. These are the  and   elements.

The test condition for an  statement must be contained within the   attribute of the   element. Expressions that are testing greater than and less than operators must represent them by “&gt;” and “&lt;” respectively in order for the appropriate transformation to take place. The  function from XPath is a Boolean function and evaluates to true if its argument is false, and vice versa. The  and   conditions can be used to combine multiple tests, but an   statement can, at most, test only one expression. It can also only instantiate the use of one template.

The  element, is similar to the   statement in Java. By using the  element, the   element can offer a many alternative expressions. A choose element must contain at least one when statement, but it can have as many as it needs. The choose element can also contain one instance of the otherwise element, which works like the final else in a Java program. It contains the template if none of the other expressions are true.

The  element is another conditional processing element. We have used it in previous chapter exercises, so this will be a quick review. The  element is an instruction element, which means it must be children of template elements. evaluates to a node-set, based on the value of the select attribute, or expression, and processes through each node in document order, or sorted order.

Parameters and Variables
XSLT offers two similar elements,  and. Both have a required  attribute, and an optional   attribute, and you declare them like this:

Exhibit 21: Variable and parameter declaration <xsl:variable name="var1" select=" '' "/> <xsl:param name="par1" select=" '' "/>

The above declarations have bound to an empty string, which is the same effect as if you had left off the select attribute. With parameters, this value is considered only a default, or initial value to be changed either from the command line, or from another template using the  element. However, with the variable, as a general rule, the value is set and can't be changed dynamically except under special circumstances. When making declarations, remember that variables can be declared anywhere within a template, but a parameter must be declared at the beginning of the template.

Both elements can also have global and local scope, depending on where they are defined. If they are defined at the top-level under the <stylesheet> elements, they are global in scope and can be used anywhere in the stylesheet. If they are defined in a template, they are local and can only be used in that template. Variables and parameters declared in templates are visible only to the template they are declared in, and to templates underneath them. They have a cascading effect: they can spill down from the top-level into a template, down into a template within that one, etc, but they cannot go back up!

We are going to hard-code a value for the parameter in it's declaration element using the  attribute.

Exhibit 22: HTML results

The value that you pass in does not have to be enclosed in quotes, unless you are passing a value with more than one word. For example, we could have passed either country="United States" or country=Belize without getting an error.

The value of a variable can also be used to set an attribute value. Here is an example setting the countryName element with an attribute of countryCode equal to the value in the variable:

Exhibit 23: Attribute of countryCode

This is known as an attribute value template. Notice the use of braces around the parameter. This tells the processor to evaluate the content as an expression, which then converts the result to a string in the result tree. There are attributes which cannot be set with an attribute value template:
 * Attributes that contain patterns (such as  in  )
 * Attributes of top-level elements
 * Attributes that refer to named objects (such as the  attribute of  )

Parameters, though not variables, can be passed between templates using the  element. This element has two attributes,, which is required, and  , which is optional. This next example uses with-param as a child of the  element, although it can also be used as a child of.

Exhibit 24: XSL With-Param

 * Here we match the  nodes that were returned in the   node set.
 * , as discussed earlier, calls the template named
 * The element  tells the called template to use the parameter named , and the select statement sets the expression that will be evaluated.
 * Notice the declaration for the parameter is in the first line of the template. It instantiates  to an empty string, because the value will be replaced by the value of the expression in the   element's   attribute.
 * outputs a line feed in the result tree to make the output look nicer.

Exhibit 25: Text results – withParam.xsl City Name: Belmopan Number of hotels: 2 City Name: Kuala Lumpur Number of hotels: 2

The Muenchian Method
The Muenchian Method is a method developed by Steve Muench for performing functions using keys. Keys work by assigning a key value to a node and giving you access to that node through the key value. If there are lots of nodes that have the same key value, then all those nodes are retrieved when you use that key value. Effectively this means that if you want to group a set of nodes according to a particular property of the node, then you can use keys to group them together. One of the more common uses for the Muenchian method is grouping items and counting the number of occurrences in that group, such as number of occurrences of a city

Text Results – muenchianMethod.xsl City Name: Atlanta Number of Occurrences: 1 City Name: Athens Number of Occurrences: 1 City Name: Sydney Number of Occurrences: 1

Datatypes
There are five different datatypes in XSLT: Node-set, String, Number, Boolean, and Result tree fragment. Variables and parameters can be bound to each of these, but the last type is specific to them.

Node-sets are returned everywhere in XSLT. We've seen them returned from  and   elements, and variables. Now we will see how a variable can be bound to a node-set. Examine the following code:

Exhibit 26: Variable bound to a node-set

Here, we are setting the value of the variable  to the node-set   from the source tree. The  element is a child of city, so the output generated by apply-templates is the text node of. Remember, you can use variable references in expressions but not patterns. This means we cannot use the reference  as the value of a   attribute.

String types are useful if you are interested only in the text of nodes, rather than in the whole node-set. String types use XPath functions, most notably,. This is just a simple example:

Exhibit 27: String types

This is in fact, a longer way of saying:

Exhibit 28: Shorter version of above It is also possible to declare a variable that has a number value. You do this by using the XPath function.

Exhibit 29: Declaration of variable with number value

You can use numeric operators such as + - * / to perform mathematic operations on numbers, as well as some built in XPath functions such as  and.

The Boolean type has only two possible values, true or false. As an example, we are going to use a Boolean variable to test to see if a parameter has been passed into the stylesheet. Exhibit 30: Boolean variable to test

We start with an empty-string declaration for the parameter. In the  attribute of , the   function tests the value of. If the value is an empty string, as we defined by default,  evaluates to , and the template is not instantiated. If it does have a value, and it can be any value at all,  evaluates to.

The final datatype is the result tree fragment. Essentially it is a chunk of text (a string) that can contain markup. Let's look at an example before we dive into the details:

Exhibit 31: Result tree fragment datatype

Notice we didn't use the select attribute to define the variable. We aren't selecting a node and getting its value, rather we are creating arbitrary text. Instead, we declared it as the content of the element. The text in between the opening and closing variable tags is the actual fragment of the result tree. In general, if you use the select attribute as we did earlier, and don't specify content when declaring variables, the elements are empty elements. If you don't use select and you do specify content, the content is a result tree. You can perform operations on it as if it were a string, but unlike a node set, you can't use operators such as / or // to get to the nodes. The way you retrieve the content from the variable and get it into the result tree is by using the copy-of element. Let's see how we would do this:

Exhibit 32: Retrieve and place into result tree The result tree would now contain two elements: a copy of the city element and the added element, description.

EXSLT
EXSLT is a set of community developed extensions to XSLT. The modules include facilities to handle dates and times, math, and strings.

Multiple Stylesheets
In previous chapters, we have imported and used multiple XML and schema documents. It is also possible to use multiple stylesheets using the  and   elements, which should be familiar. It is also possible to process multiple XML documents at a time, in one stylesheet, by using the XSLT function.

Including an external stylesheet is very similar to what we have done in earlier chapters with schemas. The  element only has one attribute, which is. It is required and always contains a URI (Uniform Resource Identifier) reference to the location of the file, which can be local (in the same local directory) or remote. You can include as many stylesheets as you need, as long as they are at the top level. They can be scattered all over the stylesheet if you want, as long as they are children of the  element. When the processor encounters an instance of include, it replaces the instance with all the elements from the included document, including template rules and top-level elements, but not the root  element. All the items just become part of the stylesheet tree itself, and the processor treats them all the same. Here are declarations for including a local and remote stylesheet:

Exhibit 33: Declarations for local and remote stylesheet

Since  returns all the elements in the included stylesheet, you need to make sure that the stylesheet you are including does not include your own stylesheet. For example, city.xsl cannot include city_hotel.xsl, if city_hotel.xsl has an include element which includes city.xsl. When including multiple files, you need to make sure that you are not including another stylesheet multiple times. If city_hotel.xsl includes amenity.xsl, and country.xsl includes amenity.xsl, and city.xsl includes both city_hotel.xsl and country.xsl, it has indirectly included amenity.xsl twice. This could cause template rule duplication and errors. These are some confusing rules, but they are easy to avoid if you carefully examine the stylesheets before they are included.

The difference between importing stylesheets and including them is that the template rules imported each have a different import precedence, while included stylesheet templates are merged into one tree and processed normally. Imported templates form an import tree, complete with the root  element so the processor can track the order in which they were imported. Just like include, import has one attribute, href, which is required and should contain the URI reference for the document. It is also a top-level element and can be used as many times as need. However, it must be the immediate child for the  element, otherwise there will be errors. This code demonstrates importing a local stylesheet:

Exhibit 34: Importing local stylesheet

The order of the  elements dictates the precedence that matching templates will have over one another. Templates that are imported last have higher priority than those that are imported first. However, the  element also has a   attribute that can affect its priority. The higher the number in the  attribute, the higher the precedence. Import priority only comes into effect when templates collide, otherwise importing stylesheets is not that much different from including them. Another way to handle colliding templates is to use the  element. If a template in the imported document collides with a template in the importing document, apply-templates will override the rule and cause the imported template to be invoked.

The  function allows you to process additional XML documents and their nodes. The function is called from any attribute that uses an expression, such as the  attribute. For example:

Exhibit 35: Document function

When applied to an xml document that only contains an empty hotel element, such as the result tree will add a new element called amenityList, and place all the content from amenity.xml (except the XML declaration) in it. The document function can take many other parameters such as a remote URI, and a node-set, just to name a few. For more information on using, visit http://www.w3.org/TR/xslt#document

XSL-FO
XSL-FO stands for Extensible Stylesheet Language Formatting Objects and is a language for formatting XML data. When it was created, XSL was originally split into two parts, XSL and XSL-FO. Both parts are now formally named XSL. XSL-FO documents define a number of rectangular areas for displaying output. XSL-FO is used for the formatting of XML data for output to screen, paper or other media, such as PDF format. For more information, visit http://www.w3schools.com/xslfo/default.asp

Reference Section
Exhibit 36: XSL Elements <SMALL>(from http://www.w3schools.com/xsl/xsl_w3celementref.asp and http://www.w3.org/TR/xslt#element-syntax-summary)</SMALL>

Exhibit 37: XSLT Functions <SMALL>(from http://www.w3schools.com/xsl/xsl_functions.asp)</SMALL>

Exhibit 38: Inherited XPath Functions <SMALL>(from http://www.w3schools.com/xsl/xsl_functions.asp)</SMALL> Node Set Functions

String Functions

Number Functions

 Boolean Functions

Exercises
In order to learn more about XSL and stylesheets, exercises are provided.

Answers
In order to learn more about XSL and stylesheets, answers are provided.

Programmation XML/XSLT XML/XSLT e fogli di stile


text:
Wikibooks talk:Wikibooks for Wikimedians

I have no strong feelings about stub and incomplete, but I do think that consistency is good. In many ways it is as important to establish policies soon as to establish the best policies. --Rs2 22:35, 31 Mar 2004 (UTC)

It is very unclear to me what are the different aims of Wikipedia and Wikibooks. Several articles I have made major contributions to in Wikipedia (e.g. Link rot) have been moved to Wikibooks, but I have no idea why. Could someone please clarify why an article should be placed in Wikibooks and not Wikipedia? Fmccown 16:07, 14 November 2006 (UTC)


text:
Talk:Electronics/Prereq

How is multivariable calculus more important than calculus?

I don't know either. - maxpower 02:07, 9 Jun 2004 (UTC)

As the Mathematics section is not in alphabetical order, I've ordered by decreasing importance. (Donovan|Geocachernemesis|Interact) 07:57, 10 Jun 2005 (UTC)

title: Talk:Electronics/Prereq


text:
Electronics/Electric Field

Electric Field
Charged particles create an electric field.

A good way to look at an electric field is electrolysis.

cathode = electron emitter. anode = electron collector. (Means up the path).

Static Electricity
This is a rough draft.

Generated by contact between dissimilar materials, dissipates through moisture when humid, dry air is a better insulator.

''As this is a book, it should have historical stories and stuff to make it more interesting. Greeks and amber in this section, for instance.''

When a solitary atom has the same number of electrons and protons, it has no overall charge. The individual charges cancel out. It is said to be neutral.

An atom that has more electrons than protons is negatively charged. The atom will have a tendency to attract other particles that have a positive charge, and repel particles with a negative charge.

An atom that has less electrons than protons is positively charged. The atom will attract negative particles (like solitary electrons or negatively charged atoms) and repel positive particles (like solitary protons or positively charged atoms).

If a solitary proton and electron are placed near each other (or even far away, as long as nothing else is nearby), they will move closer together, until the electron becomes "attached" to the proton and they form a hydrogen atom. An atom of metal that is positively charged (missing electrons) and a free electron will behave the same way.

The same goes for macroscopic objects. A metal sphere that has a significant amount of atoms that have the same number of electrons and protons is neutral. Also, if there are several atoms that are positively charged or negatively charged, it is said that the whole object is charged. This may not be noticeable if only a few atoms on the object are charged.

Charged metal spheres will attract and repel each other according to the same rules as individual particles.

A solitary metal sphere with an excess of electrons will tend to have the extra electrons spread out evenly across the surface of the sphere (not in the interior). This is because the electrons repel each other, and try to get as far apart as possible. On a positively charged sphere, the positive charge (absence of electrons) also spreads evenly across the surface due to its lack of electrons. (Talk about the neat shielding properties of Faraday cages) In the space inside to the sphere there is no charge.

In the case of insulating spheres charge does not move throughout the object, it just sits there. The electrons in this object are not constantly moving from atom to atom, so the empty holes have no way to be filled by their neighbors.

A Van de Graaff generator is basically a pump for electrons (or a "charge pump"). It uses the triboelectric effect to take electrons from one conductor and deposit them on another. The triboelectric effect is caused when two different materials are brought into contact and then separated. One material will have more of a tendency to attract extra electrons, and some of the electrons will transfer from one material to the other. The Van de Graaff generator accomplishes this with a silk or rubber belt held tightly between two rollers of different materials. As the belt comes into contact with one roller and then separates, it picks up charge from the roller. When it comes into contact with the other roller and then separates, it deposits the charge.

It thus makes one roller positively charged and the other negatively charged. The electrons are supplied to one roller and extracted from the other by metal brushes, connected to the large conductors. This creates a voltage between the conductors, due to their distance.

(Should we really be going into so much detail about it though?... I guess as an example of a very basic electric circuit, it is a good example.  Maybe we could just link to Wikipedia triboelectric effect?  That's the thing I don't like about wikibooks.  You have to provide all of the background instead of just directing them to it.)

title: Electronics/Electric Field


text:
Electronics/Dielectrics

A dielectric is the material between two charges. It impeds the flow of charge until a certain voltage threshold at which point charge starts flowing.

''When I first learned about capacitors I thought that this was the way capacitors were used. They charge up to a strong enough voltage and then the dielectric breaks down and then they charge up again. I thought this was the basis for timer circuits. We need to be careful to separate dielectric breakdown from things that are supposed to happen in electronic circuits.''

title: Electronics/Dielectrics


text:
User:Nikola Herweg~enwikibooks

siehe Nikola

title: User:Nikola Herweg~enwikibooks


text:
User talk:Nikola Herweg~enwikibooks

Hi, I just have a tip for you. I hope you understand English. Mein Deutsch ist nicht gut. ;)

In order to link to your Wikipedia userinfo, you do this: Benutzer:Nikola, like this: Benutzer:Nikola

Hope that helps, I saw you tried doing it. :)

DarkPhoenix 10:34, 1 Apr 2004 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Nikola Herweg. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Nikola Herweg~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:32, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:18, 19 April 2015 (UTC)

title: User talk:Nikola Herweg~enwikibooks


text:
Authoring Webpages/Adapting a webpage for visual browsers

Introduction
The HyperText Mark-up Language (HTML) allows you to add structure and hyperlinks to a text. This in turn allows a web browser to display that text in a useful manner to the user. The mark-up you use has little or nothing to do with the display of the text: this makes it possible to display the hypertext on a wide array of devices.

The web browser has to make a translation between the mark-up you provide and display properties. For instance, a heading can be displayed in bold, large text on a graphical browser, and can be spoken out loudly in a speech browser, et cetera.

Generally, manufacturers of web browsers make good choices. As well-trained readers, we know that a bold large text on its own line over a mass of normal sized text is probably its heading. So when a browser renders a heading like that, we tend to recognize it as a heading without even thinking. List items are preceded by list item markers such as numbers or 'bullets', emphasized text is printed in bold or italics, et cetera.

Manufacturers of graphical web browser even consider that reading off a screen is hard: paragraphs are divided by empty lines, text is generally printed (by default) using a relatively large font-size, and hyperlinks are clearly marked as such, by using different colors and underlines or surrounding lines (the latter in the case of images).

There are two things though, that current web browsers are getting wrong. One is that they display each and every webpage the same; the other that they generally fail at presenting webpages in an aesthetically pleasing way.

It can certainly be argued that the browser manufacturers cannot be blamed for these problems.

Excercise 4-1
Why can manufacturers of web browsers not be blamed for rendering all webpages alike? Why can they not be blamed for displaying webpages in an aesthetically unpleasing way? You may also argue the reverse, if you like.

One of the few clues a visitor might have about the quality of webpages is provided by a concept called website. A website is a collection of webpages that belong together. Because they belong together, they provide a powerful hint to the visitor that information that was promised on one page of the website, may be found on another page of that website. Similarly, if the visitor accepts the voice of a webpage author as an authority, other webpages by that author may provide an interesting target for further visits.

There are several ways in which an author can make clear that webpages form part of one overarching website. One of these ways has already been discussed: by using a sensible  text, authors can show that pages belong together. The title of this page, "Adapting a webpage for visual browsers - Wikibooks", helps to underline this. All pages on the Wikibooks website have a title that ends with "- Wikibooks". If you feel like reading other textbooks, the message is clear: you should be on this site.

Another way to suggest a relation between webpages, that is, to suggest a website, is in the strategic use of the Uniform Resource Locator (URL), the address of a webpage that is often displayed in a webbrowser's address bar. You can use similar addresses for similar webpages.

The third way to suggest a relation between webpages is probably the most useful, though: you can use a uniform visual style to indicate to visitors on which website they are.

A bit of history
Originally, HTML was a mish-mash of graphical display mark-up and structural mark-up. This sounds perhaps worse than it was: only a few elements were reserved for visual presentation, such as  for bold text, and   for italicized text. Further,  allowed an author to display text using 'plain text formatting' (as discussed before),   forced a graphical browser to start displaying following text on a new line, and   let you display an image at a certain point in the text.

All this wasn't so bad, really. It did not introduce a huge drop in accessibility, but allowed authors of pages for graphical clients (more or less the default since the beginning of the web) to 'ponce up' their pages and make them more attractive to visitors.

However, by allowing display-only elements in an otherwise display-independent language, Tim Berners-Lee opened the door for abuse by browser manufacturers.

The possibility to create a visually pleasing web page made the web a more attractive place to be. Just like the DTP revolution made everybody think that they were graphical designers (mistakenly, most of the time), so did the graphical web open the door for letting form rule over content.

When the web became more popular with users, it of course also became more popular with businesses. Actual businesses were founded to produce web browsers, something almost unheard of before. The most successful of these was Netscape.

Browser wars
Netscape quickly recognised that the instant appeal of pretty webpages was just as strong a selling-point for a web browser, if not stronger, than the other, more solid appeals, such as the promise of becoming one's own publisher, or being able to traverse a associative landscape of ideas.

However, Netscape only had control over the browser, not over the web itself, or its underlying HTM Language. So what Netscape did was let its web browser, Navigator, recognise an extended version of HTML. Frames, for instance, are a Netscape invention, as is JavaScript and the  element. Using this strategy, Netscape Navigator soon became by far the most used browser on the web. With it the web (and with the web the internet) became a public space, rather than the academic space it had been before.

The one software company that had thoroughly missed the internet boat, and that was Microsoft. To the day of writing this, Microsoft still does not understand the internet: they don't see it as a space within which to operate, but rather as a thing to be owned. In the beginning they even tried to replace it with its own 'internet', called MSN; which is of course nonsense, because the internet is not an atomic network. It is a network of network. MSN was to be part of the internet, much to the chagrin of Bill Gates and his people.

Meanwhile, Netscape looked further ahead. For them, the internet was a vehicle to gain control over the 'desktop', the metaphor 1980s' operating systems use to describe themselves. If everybody had Netscape Navigator installed, and Netscape Navigator was this universal tool that could be used for everything, from playing games to word processing, it did not really matter which operating system was running beneath the browser.

Microsoft was, through its original disdain for the internet and the web, suddenly threatened in the core reason of its existence. It then made a strategic decision that pulled it right into the centre of the internet: it would build its own browser.

Microsoft's browser was called Internet Explorer, and it started the so-called browser wars. Microsoft started playing Netscape's game. It first supported almost all of Netscape's HTML extensions, added a few of its own, and changed the behaviour of some elements in a way that made them work slightly better.

The web was under a threat of balkanization: the dividing in parts so small, that dealing with the web, and especially authoring web pages, was to become an ordeal that would almost prove too much for authors and surfers alike.

Authors suddenly had to decided which browsers to support, or if they should support specific browsers at all. The possibility to treat the web as a purely visual medium planted the misguided thought in a lot of heads that web pages should look alike everywhere.

This was when the World Wide Web Consortium stepped in, and started rallying for stricter standards, and a division of document structure and document lay-out. The smartest move of the W3C was to get the browser manufacturers on board. With Microsoft and Netscape both having a direct say about how next versions of HTML would look like, they became stakeholders with an interest in creating a useful web language.

The W3C introduced a programming language for suggesting certain lay-outs to a web browser, called CSS. That abbreviation stands for Cascading Style Sheets. Stylesheets had a couple of things going for them. Most importantly, they promised a 'code once, view everywhere' approach to web authoring. This was good for the W3C, because that approach was what HTML was about in the first place. And it was good for the authors, because now they did not have to learn about the quirks of every web browser.

Other advantages of CSS were from the start:

 * They could be stored in separate files, so that the style for an entire site could be stored in one stylesheet;
 * They allowed for chaining ('cascading') stylesheets, so that part of a website could have its own distinct style from the rest of the site, while still looking part of the site; and
 * They enabled a few tricks that Netscape and Microsoft hadn't gotten to yet, such as more control over text styles.

Future
It could be argued that allowing a few graphical display elements in a hypertext language was a good move. It popularized the web, and with it the internet. It introduced a great deal of authors to the web. However, today many of these authors see the web as a visual medium rather than the (hyper)textual medium it really is. Weaning those people from their wrong notion may prove an impossible task.

Websites
As we saw before, webpages form part of the web, because they link to other pages or because other pages link to them. In other words, web pages do not live in a vacuum. When you receive a folder in a letter box for a pizza delivery service for instance, there is no context. You do not generally receive copies of competing services simultaneously, or a map that shows you where the delivery service is located, or an encyclopaedia that tells you about the history of pizzas.

A webpage does come with such a context. For instance, if you visit a webpage that lets you order pizzas, you probably visited a page before that which let you choose from several pizza delivery services. Also, the order page may link to a map, or to an article about the history of pizzas. Even if it does not do so, the web browser may provide additional functionality to you. For instance, if you selected the name of a pizza in the Firefox web browser, then right-clicked, a menu item would appear that would let you search Google for the selected text in a new tab in the background.

Although all webpages have a such a context, only the ones provide by you are under your control. When you group a number of related webpages, such a grouping is called a website. Webpages may form a website for any number of reasons; because they belong to the same subject, because they are hosted on the same server, because they live on the same domain, or because the are created by a single person or organisation.

For instance, the collection of webpages at http://www.nasa.gov form the website of the US national space agency NASA. They may not all be served by the same server, and they are not created all by the same person, but they live on the same domain, try to be the voice of NASA on the web and deal with topics that are all related to NASA.

A person or an organisation may of course have multiple websites; and what is called a website in this respect is not really important.

Websites are often characterised by

 * a main site navigation ("menus" of hyperlinks that are repeated on every webpage and that lead to important sections),
 * a coherent visual style across webpages, including a logo and a favicon,
 * coherent page names, for instance by repeating the site's name in the title element,
 * a natural division of the website in topics and subtopics.

All these clues tell you after going from one page to another that you are either on the same website, or have left for another website. Most web authors get these clues at least partially right, and most web page visitors are able to tell which website they are on.

An interesting feature of a webpage is then that it contains information that is at the core of what the author wanted to say with that particular webpage, but that it also contains information to the visitor that they are on a particular website, where they are on that site, where they can go, etc.

Most webpages will contain a lot of information that are pertinent to the subject of that page, and a little information about the website itself. The exceptions are called home pages; home pages are about the website they are part of.

Home pages
The "homepage" is the main page of a website. It is used as a central hub for the rest of the site. This is the file that is displayed when going to a web address that doesn't specify a document, e.g. . It is typically named ,  ,  , or.

A homepage has a number of functions and a number of rules and heuristics that it should adhere to. The functions of a homepage are to:

 * provide a navigational aid for the site
 * provide information on the site's theme
 * establish the brand identity of the website (e.g. the site pages' appearance)
 * provide a means for visitors to reorient themselves
 * provide the minimal location for a web page author to link to
 * live at an easy to remember location

Let's review these.

Navigational aid
When a visitor follows a information scent to your web page, the web page may or may not fulfill the information wish of the visitor. In the latter case, a visitor will either want to track back, or follow further scents.

As we have noted, the indication that a webpage is part of a website provides a powerful hint to the visitor that the same voice that wrote the webpage has written other webpages on possibly similar subjects. A visitor who does not succeed at the current webpage, or who has succeeded, but now has changed goals, may want to further explore your websites.

For example, if you collect jokes, and a visitor thinks the first of your jokes is funny, they may wish to read more of your jokes.

Links on the webpage to related webpages can be very useful; but sometimes these links are lacking, or they are worded in a way that does not help your visitor, or they do not make clear that they lead to parts of the same website; and often a webpage does not show the intentions an author has with a website, the freshness of a website et cetera.

A homepage should provide this sort of information, or at least leads to it. A homepage of a larger should also provide alternative ways of navigation. This could be done through:

 * a search function
 * a main menu
 * a catalogue
 * highlighted webpages

A common way to link to a homepage is to use the logo or site name as a hyperlink, or to link to it from a breadcrumb trail.

Site style
In order to find out that you are on a website, you need to have visited at least two webpages on that site: one to establish that a certain style was used, another to verify that style. Any webpage on a site can be used for that second function, but the homepage must always be usable in this way.

Site meaning
The homepage of a website should always make clear what the website is about, just like a webpage should always make clear what that webpage is about.

News
In lieu of other designated places where a visitor can review whether pages of a website have been added or updated, the homepage should be regularly updated to indicate that a website is still "alive". Popular ways to do this are to show leads to recent news item, to regularly change highlighted items, or to regularly make simple changes to the lay-out of the homepage. Other ways are to introduce seasonal elements into a homepage. For instance, you could use your homepage to wish visitors happy holidays.

Other designated places that allow you to assess the liveliness of a website are the news page, or for example the Recent Changes page at Wikipedia. You can use these pages instead of the homepage for situational feedback, as long as it is clear to visitors that they need to look somewhere else, for instance because you clearly link to a news section.

Location
In general, you will wish to let the world know about specific webpages, instead of your website. However, there are instances when the latter is desirable. For those instances it would be useful if the homepage were easy to find and to get to. One way to achieve is, is to locate the homepage at the shortest possible URL. If your webpages are at http://www.example.com/~wily/friends.html, http://www.example.com/~wily/album.html, and http://www.example.com/~wily/contact.html, your homepage should be at http://www.example.com/~wily/. (When faced with a request for a directory instead of a file, a webserver will generally start looking for files with a certain name, such as index.html, index.php, welcome.html etc. This behaviour differs from webserver to webserver, but index.html is usually a pretty safe file name to give to your homepage.)

Also, when you forget to link to a homepage, or when the link cannot easily be found, visitors will apply a trick called the directory traversal attack. Despite its goulish name and the fact that it is a crime in the UK, this is a perfectly moral and fine thing to do. It works by guessing the parts of a URL that are superfluous for the homepage address.

For example, if you are at http://www.example.com/~wily/friends.html, removing "friends.html" or "~wily/friends.html" from the full address in the address bar of your web browser, may lead to the homepage of this webpage's site.

Recapitulation
In essence, a homepage provides situational knowledge about a website. It should show a visitor what the site is about, what its main themes are, how you can get there, how fresh a site is, etc.

Stylesheets and the style element
CSS (Cascading Style Sheets) is a language used to "style" markup, such as HTML. CSS is a series of rules, and each rule has three parts: a selector, a property, and a value. a { color: red; font-style: italic; }

In this example, "a" is the selector. It selects all anchors ("links") in the document. Each rule that affects anchors is enclosed in the brackets ({}) following the selector. Here, the two properties are "color" and "font-style". "color" is used to set the color of the text, and "font-style" is used to set the variety of the font. Anchors will appear as red, italicized text.

There are three methods of adding CSS to a web page, but the third is considered the best for most purposes.

1) As a tag attribute. The name of the attribute is "style".

This is considered the worst way of adding styles, in most cases. The reason for this is that it's very hard to maintain. If you wanted to change the color of the anchors on your site, you'd have to find and replace the attribute in every "a" element in every web page, which could occur hundreds or even thousands of times, depending on the size of the website.

2) As a style element. This element is placed inside the  tag.  <stlye>    a {      color: red;      font-style: italic;    }  </style>

This is considered the second worst way of adding styles, in most cases. While not nearly as difficult to maintain as the first method, you'd still have to synchronize all of the style elements across all documents, and as your site grows, this would become more and more awkward.

3) As a linked document. The document ends in .css (e.g. "styles.css"). This is considered the best way, in most cases, because it is the easiest to maintain. To link your web page to your stylesheet, add this in your head tag:

Now, if you want to change any part of the anchors' appearance, you'd only have to edit one file, and it will affect all pages on the website that have that link in the head.

Typography on the web
Empty lines separating block level elements--line widthlosing control--practice: font family--practice: italics, bold, font-size--practice: line-width--practice: line-height.

Colours: dangerous and beautiful
Easy branding with colour--danger: colour blindness--danger: browser settings--solution: never use just colours--solution: always define all colours--practice: applying colours to text and links--practice: applying colour to backgrounds--practice: applying coloured borders.

Preparing for print
The print style sheet.

Answers
For answers, see Answers to Questions and Exercises.

Previous: How to write for the web - Up: Table of Contents - Next: HTML, XHTML and DOCTYPEs


text:
User:Branko~enwikibooks

I seem to be hopping from project to project. Things in which I have been involved in or am involved in: Wikipedia, nl.wikipedia, Distributed Proofreaders/Project Gutenberg, Distributed Proofreaders Europe. In all these endeavours, my username is Branko.

title: User:Branko~enwikibooks


text:
User talk:24.128.49.21

Welcome! Are you still browsing? r3m0t (cont) (talk) 14:28, 1 Apr 2004 (UTC)

title: User talk:24.128.49.21


text:
Talk:Lucid Dreaming/Further Reading

I'll just mention that Jouvet, a major dream researcher, is quoted on the back of The Origin of Dreams as saying...

 * "The bridge between neurophysiology and psychology - I read it with pleasure."

That's why I wrote "the most accepted current theory"... r3m0t (cont) (talk) 14:31, 1 Apr 2004 (UTC)

Website list maintenance
I think the list of other websites related to lucid dreaming should be maintained, to keep it free from link rot. If a page returns a "404", then at least try and find a copy of it at the Wayback machine. Emanla Eraton 23:07, 19 March 2007 (UTC)

title: Talk:Lucid Dreaming/Further Reading


text:
Talk:XML - Managing Data Exchange/Introduction to XML

I see someone has changed "There are four central problems in data management: capture, storage, retrieval, and exchange." to "There are five central problems in data management: capture, storage, retrieval, and exchange." Huh ?

Yeah, this is an inherent flaw in using wiki.

My understanding of xml is not that it will replace html but will complement html. Is this true? If so consider changing this statement which somehow does not ring true with me.

"XML should steadily replace HTML on many Web sites because of some key advantages."

Using a rich application like NetBeans seems like a bad idea. It can only run decently on two of the three machines I have, and in a way, you are more learning how to use a support tool to write XML than learning how to write XML. I suppose it makes the whole process easier though :|

WikiMl seems dead... (at least this link is)
At the end of the introduction, there is a reference to WikiMl:

There is a project to create WikiMl (Wiki MarkupLanguage), and this might be used at some point.

However, following the link takes you to an "Under Construction" page that, according to Firefox's view page info, was last updated 12/06/2004 08:24:07 AM. Digging around in Google didn't turn up more current info.

KJC 14:37, 10 October 2006 (UTC)


text:
Talk:XML - Managing Data Exchange/Preface

There's a tool called XMLStarlet that does XML validation and transformation and that is a stand-alone tool. I haven't played much with it, but it looks legit.--Branko 20:47, 1 Apr 2004 (UTC)

January 2007
Is there anybody who is actively working on this WikiBook? --Runnerupnj 07:36, 28 January 2007 (UTC)


text:
Electronics/Permission

Wikibooks GCSE Science
User talk:69.157.40.94

From Wikibooks, the free textbook project.

Hi and welcome to wikibooks. I noticed you started a book on electronics and just wanted to point out that i have already written a very basic introduction to electronics in the GCSE science book. Take a look at Circuits (GCSE science) and the pages that follow - you may find it easier to visit Electricity (GCSE science) and navigate from there. Feel free to copy anything you want including any of the diagrams. (click on a diagram and it will take you to a description page titles image:image_name.png, copy the title of the description page into the page you want and put double square brackets around it like this . Preview and you should see the image appear on the page. Theresa knott 12:54, 17 Mar 2004 (UTC)

Wikipedia
Do we need any permission to use content from Wikipedia?

No. Anything from Wikipedia is copyleft, and can be used as long as the same freedoms are provided. However, you must comply with the site license which includes providing attribution. This is usually done by requesting a history import at RFI.

I'm guessing this includes images.

No it does not include images. Images hosted on Wikipedia may be subject to copyright and used under fair use criteria that do not necessarily apply here.

Electronics textbook
Anyone want to look at this license to see if we can use the electronics book?

Klunky
"The web page is written in HTML and Javascript. Because of that the source code is wide open and available to all. Radio amateurs are encourged to take the code, modify it, and create something even more useful to the ham community. The way the web page operates does not have to be limited to schematics. It could be extended to other uses such as printed circuit board layout."

"These things imply that it's ideal for amateur radio. It can be shared all over the world, which is where hams are. It can be used with diverse equipment, which hams have. It it can be modified, which hams love to do. And hams need simple, albiet clunky, schematics.

So, Klunky is my gift to amateur radio. If some ham, somewhere, can get some use out of it, he's welcome to it."

I am sure he wouldn't mind if we use it. He says the code is open. I have written him to ask specifically, but he hasn't responded.

title: Electronics/Permission


text:
Electronics/Magnetic Field

Magnetic Field: B
A magnetic field is generated due to:
 * 1) Magnetic moment.
 * 2) Moving charge.

 * Magnets have two poles, a north and a south.
 * Like poles repel, unlike poles attract.

 * Magnets will try to align their poles.

 * North and south pole: pole of earth is reversed; geographic north is magnetic south and vice versa.

 * Polarity: the alignment of the magnetic field.
 * Magnetic monopole: the idea that a single independent pole can exist

 * Pauli-exclusion principle: Two electrons cannot occupy the same state.

 * Spin: quantum property of electrons, which gives them intrinsic angular momentum. This means, they act as if they were perpetually spinning around their own axis.

 * Permanent dipoles: These occur when 2 atoms in a molecule have substantially different electronegativity – one atom attracts electrons more than another becoming more negative, while the other atom becomes more positive. See dipole-dipole attractions.

 * Instantaneous dipoles: These occur due to chance when electrons happen to be more concentrated in one place than another in a molecule, creating a temporary dipole. See Instantaneous dipole attraction.

 * Induced dipoles: These occur when one molecule with a permanent dipole repels another molecule's electrons, "inducing" a dipole moment in that molecule. See induced-dipole attraction.

 * magnetic dipole: Analogous to electric dipole. It refers to a magnetic field that looks as if it came from a pair of north and south monopoles, infinitesimally close together.

An object with a magnetic moment creates an magnetic dipole
 * magnetic moment (u): The tendency of an object to align itself with a magnetic field. This alignment creates a PE (U). A current carrying loop has a magnetic moment. Electrons and many nuclei have intrinsic magnetic moments due to their quantum spin. The electrons generally come in pairs, whose intrinsic magnetic moments cancel, but they may still produce a magnetic dipole because they rotate (have orbital angular momentum), or produce a magnetic quadropole because of incomplete cancellation. These intrinsic magnetic moments create some of the macroscopic effects of magnetism, such as Nuclear Magnetic Resonance.

 * intrinsic magnetic moment: The moment which a thing has. Due to intrinsic angular momentum.

$$F = qV x B$$

Permeability: μ

 * Permeability: (μ) How much a material becomes magnetized in response to a magnetic field.

 * Permeability of vacuum: (μ0): 4π × 10-7 N·A-2 (exactly).

 * Relative Permeability: (μr) Permeability of materials compared to that of the vacuum.

 * $$ \mu_r = {\mu \over \mu_o} $$

 * Absolute magnetic permeability (μ): = μ0(1 + χ). henry / meter.

If χ is positive the magnetic field increase and the material is paramagnetic and if χ is negative the magnetic field decreases and the material is diamagnetic.
 * Magnetic susceptibility (χ): the fractional part of the relative permeability.

\chi = \frac {M} {H}, $$

Paramagnetism
Paramagnetism: (with magnetism) tendency of a magnetic dipoles to align itself with an external magnetic field due to the effects of spin. By aligning themselves the dipoles strengthen the external magnetic field. (relative magnetic permeability > 1, magnetic susceptibility 10-3 to 10-5) When the magnetic field is removed thermal motion will quickly disrupt magnetic alignment. Paramagnetism acts on each dipole of an atom separately with no interactions between the dipoles. Behaves like a bar magnet when subject to an external magnetic field.

$$M = C {B \over T}$$

M magnetisation, B magnetic flux, T is absolute temperature (Kelvin), and C is a material-specific Curie constant. Increasing the magnetic field makes paramagnetic materials more magnetic, decreasing the temperature reverses this. Curie's is accurate when saturation is low and stops working as the material becomes saturated.

Diamagnetism

 * Diamagnetism: (against magnetism) The orbital motion of electrons forms a microscopic current loop that has a magnetic dipole moment. A purely diamagnetic material is a superconductor, which is a phase transition that has no magnetic field and no resistance.

 * Meissner-Ochsenfeld effect: the exclusion of a magnetic field from the inside of a superconductor. Also called perfect diamagnetism.

 * cooper pairs: When electrons of opposite spin become paired due to low energy. Like atoms bonding. Being in a cooper pair binds electrons together so they are not scattered from the ions in the material. This causes the resistance of the material to become zero.

 * High-temperature superconductivity: superconductivity at temperatures high enough to use liquid nitrogen rather than liquid helium as a coolant.(Important because liquid nitrogen is cheap and easy to obtain)

 * superfluidity: When atoms are cooper paired due to spin. Turns a solid into a gas. A state of matter characterized by the complete absence of viscosity. Thus superfluids, placed in a closed loop, can flow endlessly without friction.

 * phonon: thermal energy in a solid. Takes the form of vibrations. As a solid gets cold it stops vibrating and forms cooper pairs. Responsible for electron pairing and electrical conductivity, how well a material conducts charge.

 * copper, bismuth

Ferromagnetism

 * magnetization: zero above Curie temperature.

 * spontaneous magnetization: the tendency of spins to align without an applied magnetic field.

 * Ferromagnetism: (iron magnetism) Phenomenon by which materials exhibit spontaneous magnetization. Most common and one of the strongest forms of magnetism. Found in bar magnets and permanent magnets. Magnetic moments are partially aligned in magnetic domains. Increasing temperature causes thermal fluctuations and destroys alignment. Above Curie temperature ferromagnetic domains melt away (no net spontaneous magnetization) if there is no external magnetic field, and the material become purely paramagnetic. The Pauli Exclusion principle causes magnetic dipoles to align in the same direction with lower energy known as exchange energy. Over distance dipoles repel each other. This is the principle behind magnetic domains. A Block Wall is the transition between magnetic regions. A strong magnet will align the domains.

 * iron, steel, nickel, cobalt, and some alloys and ceramics.

 * Curie temperature: Temperature at which a ferromagnetic material undergoes a phase transition and becomes paramagnetic. At this temperature magnetic susceptibility is theoretically infinite. Phase transition.

 * Curie point: Above which material becomes paramagnetic. When combined with ferromagnetism follows hysteresis curve with applied field. Used as temperature control in soldering irons.

 * Curie points: dysprosium -188 °C gadolinium 16 °C nickel 358 °C iron 770 °C cobalt 1131 °C

 * Antiferromagnetism: The spins of electrons align an a regular pattern.

 * Neel temperature: The temperature at which antiferromagnetic materials undergo a phase transition and become paramagnetic due to thermal energy.

 * spin glass: exhibits high magnetic frustration.

 * magnetic frustration: Its magnetic structure is disordered even at low temperatures.

Permanent Magnets

Ferromagnetic materials make up permanent magnets.

To understand how a permanent magnet is made and destroyed it is necessary to look at the microscopic structure of a magnetic material such as iron. A piece of iron is made up of lots and lots of tiny little magnets called domains. In unmagnetised iron these domains have their north poles pointing all over the place in a random way, but when the iron is put in a strong magnetic field the domains line up with the field. The iron becomes magnetised.

Once it has become magnetised, the magnet's own field is strong enough to keep itself magnetised even after it is removed from the external field.

Picture Hysteris Curve

Hysteris curve. heat destroys magnetism if the material is heated above its Curie point.

 * Remanence: (Bd, Mr) The amount of magnetism remaining after a magnetic field is removed. Less than the applied magnetic field.

 * Residual induction:

 * Retentivity: retains some residual magnetism.

 * Saturation: The maximum amount of alignment that can occur in a magnet due to a magnetic field. When the majority of dipoles in a material are aligned with an external magnetic field.

 * Coercivity: The strength of the magnetic field needed to reduce to magnet from saturation to zero.

 * Magnetic flux density: in tesla (T)

 * Magnetic field strength: Ampere / meter.

 * Compass: A small bar magnet that aligns itself with an external magnetic field. Talk about earth's magnetic field, how its south pole is our north pole, how it keeps switching and is weak.

 * Molecular Magnets:

 * hysteresis: when an external magnetic field is applied, the ferromagnet takes up some of the field

and becomes more aligned. When the field is removed the magnet retains some of the field and is magnetized.

 * hysteresis loop: when an alternating magnetic field is applied to a ferromagnetic material. The material is less magnetized than the magnetic field.

 * electrical hysteresis: occurs in ferroelectric material, where domains of polarisation contribute to the total polarisation. Polarisation is the electrical dipole moment (either C·m-2 or C·m).

 * electrical dipole moment:

Moving Charge

When a negatively charged particle such as an electron moves through space or a wire it generates a magnetic field that circles counterclockwise in a plane perpendicular to it. This is part of Ampere's law. For a positively charged particle the magnetic field is clockwise. The faster the charged particle moves the larger the magnetic field.

Inductance

Self inductance This is what happens when you turn on DC in an inductor.

 * 1) The voltage increases very rapidly ( in a matter of ms) as you turn on the switch.
 * 2) This causes a very rapidly changing current to flow.
 * 3) This current has an associated magnetic field which also changes very rapidly.
 * 4) The rapidly changing field induces an e.m.f. (Faraday’s Law) that tends to oppose the increase of current (Lenz’s Law). However it cannot stop it increasing completely, just slow it down.
 * 5) Once the current reaches it's maximum (determined by the voltage and the ordinary resistance of the wire) it ceases to change, the magnetic field becomes constant and the back EMF goes to zero.

All remains calm until you try to turn the thing off

 * 1) The field collapses very suddenly
 * 2) The changing magnetic field induces a back EMF which tries to oppose the collapse of the field (Lenz’s Law again)

For large coils the EMF can be huge, sparks can fly!

Isn't really an issue for DC though except when turning on and off. But for AC the current is varying all the time, so things never settle into a steady state. The higher the frequency, the faster things are changing and so the greater the inductance. I hope all this is reasonably clear now. Theresa knott 13:49, 30 Apr 2004 (UTC)

Electromagnet
A magnetic hose that acts like a bar magnet. As the current increases the magnet becomes more repulsive to other magnets. Used as a switch for magnetic materials and to pick up magnetic material such as cars at scrapyards.

To make a good electromagnet we use a 'soft iron' core. Soft iron has the property of being easy to magnetise. It also loses its magnetism very easily once the electric current is turned off. Steel can also be used as the core of an electromagnet, but steel does not lose its magnetism once the electric current is turned off. It stays magnetised.

When a current is switched on, or off, it creates a changing magnetic field, which in turn creates voltages that oppose the current. This is the basis for inductance.

By coiling the wire up we can make a solenoid. The magnetic field of a solenoid looks like the field of an ordinary bar magnet.

A solenoíd makes a pretty weak bar magnet on its own but if a piece of iron is put inside the solenoid the field becomes much much stronger. Try the following experiment:

 * Wrap a piece of plastic coated wire around a pencil.Remove the pencil then connect to a power supply set at 1V DC current. sprinkle iron filings around thwe coil of wire. Put a plotting compass near the wire. Try to pick up a paper clip.
 * Wrap a piece of plastic coated wire around a large nail. Repeat all of the above experiments

You will find that the solenoid with the iron core is very much stronger than the one with the air core.

Q1) Why is it important to use plastic coated wire?

Mutual Inductance

 * induced current: magnetic field creates current.

 * eddy current: a current induced by electromagnetic waves.

Mutual inductance is just like inductance except that the magnetic field from the current in one solenoid is creating voltage in a different solenoid, as well as in itself.

 * transformer: Transformers and transformer design: Transformer Design

Toroid
Picture of a toroid

A toroid is a solenoid that wraps around on itself.

toroid: A donut shaped inductor where the magnetic fields stay contained within it. Has an air gap.

A Toroid is a doughnut-shaped object enclosed by a torus. It has a ring-shaped surface generated by rotating a circle around an axis that does not intersect the circle. Usually, a toroid is composed of a coil of insulated wire in a donut shape (and is usually composed of iron or similar metals).

Toroids are inductors in circuits. They are primarily used in low frequencies transception for the inductance properties needed. Toroids possess greater inductance properties and carry greater current than similarly constructed solenoids. Toroidal coils reduce resistance, due to diameter and number. In a toroid, magnetic fluxes are confined in the toroid's core.

a toroid magnifies current.

Magnetic Fields and Electric Fields
Notice the similarity between magnetism and electricity. Electricity attracts neutral material (recall a rubbed balloon picking up small bits of paper). Electricity comes in two forms: positive and negative. Like charges repel unlike, charges attract. Physicists long ago realised that these similarities were important. It is now realised that electricity and magnetism are closely related forces. They are really two different aspects of the same force! We call that force electromagnetism. This next section of the electricity module is probably the hardest, but it is also the most interesting. Work out the problems in the text as you go along and you will be able to cope.

A changing electric field creates a magnetic field. Conversely, a changing magnetic field creates an electric field.

used to create photon / radio waves

This means that electric currents produce magnetic fields and changing or moving magnetic fields produce electric currents. This module looks at this property of electric and magnetic fields in detail. You will learn about the magnetic fields generated by a wire and a solenoid, then go on to look at motors, generators, and transformers.

Any charged particle in a magnetic field feels a force perpendicular to both the field and its own velocity.

So far we have looked at the effect of putting a current in a magnetic field and seeing that there is a force on the wire that carries the current. On this page we will look at a related effect known as induction.

Talk about straight magnetic fields and electrons moving in circular path.

Talk about how magnetic fields alter the paths of charged particles.

For a more math oriented explanation of Electric and Magnetic Fields consult Electrodynamics.

Conclusions

 * 1) If there is relative movement between a coil of wire and a magnet, there will be a current induced in the coil.
 * 2) The faster the movement the bigger the current.
 * 3) Reversing the magnet, or the direction of movement reverses the direction of the induced current.

Theoretical explanation of what's going on (Advanced)
So now we know what happens we have to come up with an explanation. Look at the diagram below.

In this diagram the green line represents a wire that is going into the screen or page. It is at right angles to the magnetic field between the two bar magnets. The wire is moved downwards so that it "cuts" the field lines. This induces an e.m.f. (voltage) along the wire. It is this e.m.f. that causes a current to flow if a complete circuit is made. So now we know why you get a current. It's caused by the induced voltage, but why do you get a voltage?

This is a close up of the wire seen end-on. The blue circles represent where the magnetic field lines stick out of the screen or page. They are coming straight out of the screen.

The wire is made of a metal and so has many free electrons. As the wire moves downwards each individual electron travels downwards too. They effectively form loads of little current flowing down. From the motor effect we know that if a current flows in a magnetic field there will be a force. In this case the force pushes the electrons to the right. It is the electrons all moving up to the right end of the wire that causes the voltage difference.

So, the motor effect can induce an e.m.f. This is one of two ways magnetic fields can induce an e.m.f

Q3) Imagine more than one loop of wire cutting through the magnetic field.Each loop of wire has its own e.m.f. induced on it. If the wires are joined up, it's as if they are little cells in series. Fill in the blanks " As the number of windings on the solenoid increases the value of the induced voltage ______________.

When a current flows down a wire it creates a magnetic field. To see this place a small plotting compass near the wire and turn the current on.The compass needle will deflect. The shape of the magnetic field around a wire is circular. look at the diagram on the right. The wire is coming straight out of the screen so you only see it's cross section (the red circle) The plotting compasses show how the field wraps around the wire.

Making the field stronger
To make the field stronger we can:
 * Use a soft iron core
 * Increase the amount of current flowing in the wire

 * Increase the number of turns on the solenoid.

Reversing the field
To make the north pole and south pole swap positions we can
 * reverse the direction of the current by swapping the positive and negative leads on the power pack.
 * Wind the wire the other way round. {So if you wound it clockwise, take it off and wind it anticlockwise.

Talking of north and south poles, there is a little trick to find out which end will be the north pole and which end will be the south.

Look down the solenoid and work out which way the current is flowing. Remember current flows from the positive to the negative terminals on the power pack. If the current is flowing clockwise the end will be a south pole. If it looks like it's going anticlockwise the end will be a north pole. The easy way to remember this is to put arrows on the end of a capital N and S like this.

title: Electronics/Magnetic Field


text:
Electronics/Spin

Electrons posses a quantum mechanical property called spin. It is responsible for magnetism. It works when charge is moving. When charge does not flow there is no magnetic field. Magnetic fields work in a direction perpendicular to the flow of charge.

(should this even be in here?)

Sure, it's the easiest way to understand magnetism. We don't need to talk about the formulas associated with spin, we just need to give an overview of how it works.

(okay, perhaps we should lump this into an article about magnetism? Things are getting crowded in the main page)

title: Electronics/Spin