Home| Progetto| Web| Faq| Acronimi | ||||
Argomenti Documenti pubblicabili:1120
Scripts:1282 Documenti non pubblicabili:162 Categorie tematiche:68 .Net |_C# |_Visual basic.net |_Asp.net Active Server Pages C++ Cascade Style Sheet JavaScript Mysql Php Xml Java |_Java 2 Micro Edition |_Java server pages |_Java Servlet Oracle |_PLSQL PostgreSQL Unix
Oracle...
Script:
Redo log
Unix...
Tip:
Eseguire pił comandi in una sola linea
PLSQL...
Script:
Esempio inserimento righe all'interno di un loop
Shell scripting...
Script:
Formatting text as bold withing shell script
Basically, a web session can be defined as the timeframe in which a visitor navigates your web site.
Php Funzione mail()
XPath is a language for addressing parts of an XML document.
It is designed to be used by XSLT and XPointer.
Basically, a web session can be defined as the timeframe in which a visitor navigates your web site.
|
Documents
Home >Xml > How XSL Works?
If you've succeeded in running this example, or even if you just want to get on with reading the book, you'll want to know how it works. Let's dissect it: <?xml version="1.0" encoding="iso-8859-1"?> This is just the standard XML heading. The interesting point is that an XSLT stylesheet is itself an XML document. I'll have more to say about this later in the chapter. I've used iso-8859-1 character encoding (which is the official name for the character set that Microsoft calls "ANSI") because in Western Europe and North America it's the character set that most text editors support. If you've got a text editor that supports UTF-8 or some other character encoding, feel free to use that instead. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> This is the standard XSLT heading. In XML terms it's an element start tag, and it identifies the document as a stylesheet. The xmlns:xsl attribute is an XML Namespace declaration, which indicates that the prefix xsl is going to be used for elements defined in the W3C XSLT specification: XSLT makes extensive use of XML namespaces, and all the element names defined in the standard are prefixed with this namespace, to avoid any clash with names used in your source document. The version attribute indicates that the stylesheet is only using features from version 1.0 of the XSLT standard, which at the moment is the only version there is. <xsl:template match="/"> An <xsl:template> element defines a template rule to be triggered when a particular part of the source document is being processed. The attribute match="/" indicates that this particular rule is triggered right at the start of processing the source document. Here «/» is an XPath expression which identifies the root node of the document: an XML document has a hierarchic structure, and in the same way as UNIX uses the special filename «/» to indicate the root of a hierarchic filestore, XPath uses «/» to represent the root of the XML content hierarchy. The DOM model calls this the Document object, but in XPath it is called the root. <html> <head> <title>Today's greeting</title> </head> <body> <p><xsl:value-of select="greeting"/></p> </body> </html> Once this rule is triggered, the body of the template says what output to generate. Most of the template body here is a sequence of HTML elements and text to be copied into the output file. There's one exception: an <xsl:value-of> element, which we recognize as an XSL instruction because it uses the namespace prefix xsl. This particular instruction copies the value of a node in the source document to the output document. . The SELECT attribute of the element specifies the node for which the value should be evaluated. The XPath expression «greeting>> means: "find the set of all <greeting> elements that are children of the node that this template rule is currently processing". In this case, this means the <greeting> element that's the outermost element of the source document. The <xsl:value-of> instruction then extracts the text node of this element, and copies it to the output at the relevant place, in other words within the generated <p> element. All that remains is to finish what we started: </xsl:template> </xsl:stylesheet> In fact, for a simple stylesheet like the one shown above, you can cut out some of the red tape. Since there is only one template rule, the <xsl:template> element can actually be omitted. The following is a complete, valid stylesheet equivalent to the preceding one: <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <head> <title>Today's greeting</title> </head> <body> <p><xsl:value-of select="greeting"/></p> </body> </html> This simplified syntax is designed to make XSLT look familiar to people who have learnt to use proprietary template languages which allow you to write a skeleton HTML page with special tags (analogous to <xsl:value-of>) to insert variable data at the appropriate place. But as we'll see, XSLT is much more powerful than that. Why would you want to place today's greeting in a separate XML file and display it using a stylesheet? One reason is that you might want to show the greeting in different ways depending on the context; for example, it might be shown differently on a different device. In this case you could write a different stylesheet to transform the same source document in a different way. This raises the question of how a stylesheet gets selected at run-time. There is no single answer to this question. As we saw above, Saxon and xt have interfaces interfaces that allow you to nominate both the stylesheet and the source document to use. The same thing can also be achieved with the Microsoft XSLT product, though it requires some scripting on the HTML page: the <?xml-stylesheet?> processing instruction which I used in the example above only works if you want to use the same stylesheet every time. Warning: include(ads/text468x15.html): failed to open stream: No such file or directory in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Warning: include(): Failed opening 'ads/text468x15.html' for inclusion (include_path='.;C:\php\pear') in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Tutorial ![]() Script ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Cerca
Xml...
Info:
Le cinque entitą predefinite in XML
A good scientist is a person with original ideas.
A good engineer is a person who makes a design that works with as few original ideas as possible. There are no prima donnas in engineering. Freeman Dyson A good scientist is a person with original ideas.
A good engineer is a person who makes a design that works with as few original ideas as possible. There are no prima donnas in engineering. Freeman Dyson
Xml...
Info:
Le cinque entitą predefinite in XML
Xml...
Definizioni:
Well-formedness
Oracle...
Definizioni:
SESSION
Shell scripting...
Script:
Debug shell program
fishScript.Com is accessible by Mobile access technology
as mobile phones, Palm and Pocket PC .
Nicoleta e Marco Magnani tutorial, examples, courses, esempi, corsi, esercizi, appunti vari Dottoressa Nicoleta Dragu Formatrice Docente Insegnante Mediatrice Culturale Dott. Marco Magnani Universita La Sapienza Roma Master Computer Science Hunter College New York , Data Base Administrator DBA oracle System architect |