![]() The depth of the nesting will determine what kind of HTML formatting to use for the section heading (for example, h1 or h2). In this structure, sections can be nested. So we will dispense with defining a DTD for the document type. The assertion-based validator can do it, but most other schema mechanisms cannot. ![]() Note - This kind of structure is not easily validated, because XML's mixed-content model allows text anywhere in a section, whereas we want to confine text and inline elements so that they appear only before the first structure element in the body of the section. It also matches our intuitive expectations about document structure, where the text of a heading is followed directly by structure elements, an arrangement that can simplify outline-oriented editing. That arrangement adds some complexity to the stylesheet, but it will give us a chance to explore XSLT's template-selection mechanisms. Instead, we will allow the heading to merge seamlessly into the body of a section. Such elements are commonly created to distinguish the heading text (and any tags it contains) from the body of the section (that is, any structure elements underneath the heading). The slightly unusual aspect of this structure is that we will not create a separate element tag for a section heading. : An aside, that is offset from the main text : A section, consisting of a heading and a body Our article documents will contain these structure tags: Start by defining a very simple document type that can be used for writing articles. For a more thorough grounding in XSLT, consult a good reference manual, such as Michael Kay's XSLT 2.0 and XPath 2.0: Programmer's Reference (Wrox, 2008). It will give you a little background so you can understand simple XSLT processing tasks, but it does not examine in detail how to write an XSLT transform, rather concentrating on how to use JAXP's XSLT transform API. XSLT specification is large and complex, so this tutorial can only scratch the surface. In this section, an XSLT transform is used to translate XML input data to HTML output. But generally, XSLT is used to generate formatted HTML output, or to create an alternative XML representation of the data. For example, with a sufficiently intelligent stylesheet, you could generate PDF or PostScript output from the XML data. The Extensible Stylesheet Language Transformations (XSLT) APIs can be used for many purposes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |