XML style table

xiaoxiao2021-03-06  68

XML is a simple and standard way to exchange raw data between computer programs, however XML-based data itself does not include information displayed. The style sheet is a document that describes the structure of the structure document, which can describe how these documents are displayed on the screen, or they can also describe their printing effects, and even sound effects. Using a style sheet defines the display mode of XML document data, XML data is separated from its expressions, in line with the industry advocated data or content and representation of the layer separated. In this way, the XML format or document does not repeat some HTML document structures, and the content is full of content. The writer of XML can also focus on the data itself, not affected by the sub-branch of the display method. Not only that, the style sheet also brings another benefit that defines that different stylesumes can make the same data to show different display appearances, thereby suitable for different applications, and can even be displayed on different display devices. In this way, XML data can be reused to meet different application needs. W3C gives two types of style sheet language: CSS, Cascading style Sheets, level connected style sheet language, XSL EXTENSIBLE SHEET, extensible style sheet language.

CSS-Level Connection Style Form Language CSS is a style description rule, which is a style sheet language proposed for HTML. Now it is also possible to apply the display of XML documents, using CSS, we can define HTML or XML documents The display effect of the middle element, including the location of the element, color, background, border, font, typographic format, etc.

Hello, There!

Good morning!

how are you?

Hello.css xsampdoc

{

Margin-top: .7in;

Margin-bottom: .7in;

Margin-left: 1.5in;

Margin-Right: 1in;

Color: navy;

Background-color: white;

Display: block

}

Greeting

{

Display: block;

Font-Family: Arial, Helvetica, Sans-Serif; Font-size: 32pt;

Width: 30em;

Color: Red

}

Question

{

Display: block;

Font-size: x-large;

Color: Black

}

Answer.ans

{

Display: block;

FONT-SIZE: 20PT;

Color: Blue

}

XSL XSL is a style sheet for converting an XML document, which contains rules for conversion and formatting XML documents. XSL is divided into two processes in the conversion XML document: first convert the document structure, and then format the document. These two steps can be separated separately, so gradually divide into two branches in the XSL development process: XSLT (Structure Translation) and XSL-FO (Format Output). The XSL-FO role is similar to the role of CSS in HTML, but development is not mature, not introducing here. XPath is a language dedicated to finding information in an XML document that describes how to identify, select, match each constituent element in the XML document, including elements, attributes, text content, and the like. XPath is affiliated with XSLT, so we usually talk together with XSLT and XPath syntax. XML is a database. XPath is SQL language. XML is a file system. XPath is the directory navigation command XSL contains powerful features of XSLT and XPath, so that the XML document can be converted into any other format document, such as XNL documents, HTML documents, XHTML documents, VRML documents, SVG documents.

XSL's basic syntax

Li Hua

Male

1978.9.12

92

Java

Oracle

C Sharp

SQL Server

Ni Bing

Female

1979.1.12

89

Visual Basic

SQL Server

ASP

Zhang Junbao

Male

1982.9.9

98

C Sharp

SQL Server

UML

Student.xsl

Student transcript </ Title></p> <p></ hEAD></p> <p><body></p> <p><h2 align = "center"> Student transcripts </ h2></p> <p><Table Border = "1" cellpadding = "0" align = "center"></p> <p><TR> <TH> Name </ TH> <TH> Gender </ TH> <TH> Birthday </ TH> <TH> Grade </ TH> </ TR></p> <p><xsl: for-each select = "/ roster / student"></p> <p><tr></p> <p><TD> <XSL: Value-of Select = "Name" /> </ td></p> <p><TD> <XSL: Value-of Select = "SEX" /> </ td></p> <p><TD> <XSL: Value-of Select = "Birthday" /> </ td></p> <p><TD> <XSL: Value-of Select = "Score" /> </ td></p> <p></ TR></p> <p></ xsl: for-energy></p> <p></ TABLE></p> <p></ body></p> <p></ html></p> <p></ xsl: template></p> <p></ xsl: stylesheet></p> <p>XSL itself is a complete XML document, so pays attention to the matching problem of labels when writing. <XSL: Stylesheet> is the XSL declaration statement, but also with an element, must be in the header of the file, usually to specify the namespace of XSL using the XMLNs property. All templates in the style sheet have labels <XSL: Template> indicated that the template can explain the processing of the object (element, attribute), the process, or the result of the conversion. The XSL Template XSL file is composed of templates, and an XSL file contains at least one purchase. The design of XSL can be refined into a template, and finally combines these templates into a completed XSL. This method is like modular design refinement in the program, which allows you to consider the entire XSL design from the whole, and then refine some expressions into different modules, and then design these modules, and finally integrate them together. Define a template: <XSL: Template Match = "Matching Mode"> Call a template: <xsl: Apply-Templates SELECT = "Mode"> XSL via <XSL: IF>, <XSL: for_each>, <xsl: choose> , <XSL: Sort> statement filters the contents of the document, sorted.</p> <p>The CSS and XSL comparison is different: CSS is mainly for HTML, XSL has a function of CSS unacceptable, such as using a command to convert an XML document to another document and store. Different: XSL uses a conversion idea, it converts an XML document that does not contain display information to another document that can be browsed by a browser, convert the lake's output code or a new document , Or temporarily stored in memory, but do not modify the source code. The CSS does not have any conversion actions, just for each component in the structured document, set the appearance pattern according to the style, and then display the document according to these types, and the entire process does not have any new code generation. Expressive ability: XSL supports sorting, super connection, etc. The grammar is different: the CSS self-contained system, XSL is defined according to the syntax of XML.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-110507.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="110507" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.034</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = '5FV4I_2BwASRZ_2FPimcrGSv5O9kgyf1ir8PwqKKjGFBAL_2FiyTKc_2FYZDwwOHNr0rqLLpnsmSa9zSnTxW72L0'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>