Home

XML.com: What is XSLT? [Aug. 16, 2000]

image

Contents

1. x110E x1112 x113C x113E x114E x1150 x1154 x1155 x115F x1161 x1163 x1165 x116D x116E x1172 x1173 X11A8 x11AB Sx1llAE x11AF X11BA x11BC x11C2 xX11EB xlEAO x1EF9 xlF20 x1F45 x1F59 x1F5B x1F80 XxX1FB4 xX1FD6 x1FDB X1FF6 x1FFC x212E x30A1 x30FA x3007 x0360 x0361 x05A3 x05B9 x0A47 x0A48 xOA81 x0A8 3 xOAC7 x0AC9 XOB3C xOB4B x0B4D xOBBE x0BC2 xOBD7 xO0C46 x0C48 xOC82 x0C83 xOCCA x0CCD xOD3E x0D43 XOD57 x0E31 x0EB1 x0EC8 x0ECD x0F39 fxOFS3E 4xOF86 4xOF8B x20E1 x0660 x0669 X09E6 x09EF x0B66 x0B6F XOCE6 x0CEF xOEDO x0EDQ x02D1 x0387 x3031 x3035 xlFC6 x1FCC x06DD x06DF xO093E x094C x0B3E 4x0B43 4 x0CO1 4x0C03 xOEB4 x0EBQ9 xOFB1 xO0FB7 x302A x302F x1140 fx114C x1159 x1167 x1169 x1175 X119E x11B 7 x11B8 x11F0 x11F9 x1F00 x1F15 x1F48 x1F4D x1F5D X1FB6 x1FBC xX1FE0 XxX1FEC x2126 x2180 x2182 x3105 x312C x3021 x3029 x0483 x0486 x05BB x05BD x064B x0652 x06EA x06ED x094D x0981 x0983 x09C0 x09C4 x09D7 XOA3E x0A3F x0A4B x0A4D x0ABC xOACB x0ACD xO0B56
2. or zero or one times The absence of such an operator means that the element or content particle must appear exactly once This syntax and meaning are identical to those used in the productions in this specification The content of an element matches a content model if and only if it is possible to trace out a path through the content model obeying the sequence choice and repetition operators and matching each element in the content against an element type in the content model For compatibility it is an error if an element in the document can match more than one occurrence of an element type in the content model For more information see E Deterministic Content Models Ui Validity Constraint Proper Group PE Nesting Parameter entity replacement text must be properly nested with parenthetized groups That is to say if either of the opening or closing parentheses in a choice seq or Mixed construct is contained in the replacement text for a parameter entity both must be contained in the same replacement text T For interoperability if a parameter entity reference appears in a choice seq or Mixed construct its replacement text should not be empty and neither the first nor last non blank character of the replacement text should be a connector or Examples of element content models 3 2 2 Mixed Content Definition An element type has mixed content when elements of that type may contain character data optiona
3. tr align right gt lt td gt lt xsl value of select num gt lt td gt lt xsl for each select product gt each product td xsl value of select Scustomer prodsale idretr scurremwe 0 abel V7 td xsl for each tr xsl for each summarize tr align right gt lt td gt lt b gt Totals lt b gt lt td gt xsl for each select product lt xsl variable name pid select id gt E Ob 12 9 s welliie Gic select sum prodsale QGidref S pid i Auc 44 2 hore ace e Aha lt table gt body html Example 2 7 Tabular presentation of the sample product sales source information Recall that a stylesheet is oriented according to the desired result producing the result in result parse order The entire document is an HTML file whose document element begins on line 3 and ends on line 30 The XSLT namespace and version declarations are included in the document element The naming of the document element as html triggers the default use of HTML result tree serialization conventions Lines 5 and 6 are fixed boilerplate information for the mandatory title element Lines 7 through 29 build the result table from the content A single header row lt th gt is generated in lines 9 through 12 with the columns of that row generated by traversing all of the product elements of the source The focus http www xml com pub a 2000 08 hol
4. 4 4 4 Forbidden The following are forbidden and constitute fatal errors e the appearance of a reference to an unparsed entity e the appearance of any character or general entity reference in the DTD except within an Ent ityValue or AttValue H e areference to an external entity in an attribute value H 4 4 5 Included in Literal When an entity reference appears in an attribute value or a parameter entity reference appears in a literal entity value its replacement text is processed in place of the reference itself as though it were part of the document at the location the reference was recognized except that a single or double quote character in the replacement text is always treated as a normal data character and will not terminate the literal For example this is well formed T while this is not 4 4 6 Notify When the name of an unparsed entity appears as a token in the value of an attribute of declared type ENTITY or ENTITIES a validating processor must inform the application of the system and public if any identifiers for both the entity and its associated notation T 4 4 7 Bypassed When a general entity reference appears in the Ent it yValue in an entity declaration it is bypassed and left as is T 4 4 8 Included as PE Just as with external parsed entities parameter entities need only be included if validating When a parameter entity reference is recognized in the DTD and included its replacement tex
5. A simple declaration for xml lang might take the form xml lang NMTOKEN IMPLIED but specific default values may also be given if appropriate In a collection of French poems for English students with glosses and notes in English the xm1 Lang attribute might be declared this way lt ATTLIST poem SSS Tengo NMTOKEN rie E SMa od solos ss xml lance NMTOKEN cine gt SAT Tils UNORE xml lang NMTOKEN en gt 3 Logical Structures Definition Each XML document contains one or more elements the boundaries of which are either delimited by start tags and end tags or for empty elements by an empty element tag Each element has a type identified by name sometimes called its generic identifier GI and may have a set of attribute specifications Each attribute specification has a name and a value Element 39 element EmptyElemTag STag content ETag WFC Element Type Match VC Element Valid This specification does not constrain the semantics use or beyond syntax names of the element types and attributes except that names beginning with a match to X x M m L 1 are reserved for standardization in this or future versions of this specification Well formedness constraint Element Type Match http www w3 org TR REC xml 13 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition The Name in an element s end tag must match the element type
6. Example 1 7 HTML rendering semantics markup for example The rendering result would then be as follows with the rendering user agent interpreting the markup for italics and boldface presentation semantics http www xml com pub a 2000 08 holman s1 html page 2 2 di 19 10 05 2001 9 03 31 Sponsored By Sponsored By XML com What is XSLT I Aug 16 2000 SEYBOLD PUBLICATIONS THIS SITE IS ON THE yix Netscape Purchase p001 File Edit View Go Bookmarks Options Directory Wi From Customer Reference cust123 Figure 1 1 HTML rendering for example The above illustrates these two distinct styling steps transforming the instance of the XML vocabulary into a new instance according to a vocabulary of rendering semantics and formatting the instance of the rendering vocabulary in the user agent 1 1 3 2 Two W3C Recommendations In order to meet these two distinct processes in a detached yet related fashion the W3C Working Group responsible for the Extensible Stylesheet Language XSL split the original drafts of their work into two separate Recommendations one for transforming information and the other for rendering information The XSL Transformations XSLT 1 0 Recommendation describes a vocabulary recognized by an XSLT processor to transform information from an organization in the source file into a different organization suitable for continued downstream processing The Extensible S
7. xsd pattern value 0 9 10 gt lt xsd restriction gt lt xsd simpleType gt Facets and the two other ways to derive a datatype list and union are covered further in following sections Complex types are defined as we ve seen before but given a name Defining and using named datatypes is comparable to defining a class and using it to create an object A datatype is an abstract notion that can be used to define an attribute or an element The datatype plays then the same role with an attribute or an element that a class would play with an object http www xml com pub a 2000 1 1 29 schemas part1 html page 3 1 di 3 10 05 2001 9 18 27 XML Products Tools Training XML com Using W3C XML Schema Nov 29 2000 TOOLBOX Full listing lt xml version 1 0 encoding utf 8 Syntax Checker lt xsd schema xmlns xsd http www w3 org 2000 10 XMLSchema gt XML Testbed definition of simple types gt EYBOLD xsd simpleType name nameType gt PUBLICATIONS lt xsd restriction base xsd string gt lt xsd maxLength value 32 gt lt xsd restriction gt THIS SITE IS ON THE 5 x lt xsd simpleType gt lt xsd simpleType name sinceType gt lt xsd restriction base xsd date gt lt xsd simpleType gt lt xsd simpleType name descType gt lt xsd restriction base xsd string gt lt xsd simpleType gt lt xsd simpleType name isbnType gt lt xsd restriction bas
8. Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Products gt Training gt FIND Search Article Archive FAQs Add the latest news from XML com to your web site COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker Find it on a d O Reilly Network E OREILLY COM Using W3C XML Schema by Eric van der Vlist Pages 1 2 3 4 5 6 7 8 9 Print This Article Namespaces Namespace support in W3C XML Schema is flexible yet straightforward It not only allows the use of any prefix in instance documents unlike DTDs but also lets you open Table of Contents Introducing Our First your schemas to accept unknown elements and attributes Schema from known or unknown namespaces Slicing the Schema Each W3C XML Schema document is bound to a specific Defining Named Types namespace through the targetNamespace attribute or Groups Compositors and to the absence of namespace through the lack of suchan Derivation attribute We need at least one schema document per eContent Types namespace we want to define elements and attributes Constraints without namespaces can be defined in any schema Building Usable and though XML Produ
9. TOOLBOX gt Lines 2 through 11 describe the document model for the sales information Lines 14 and 15 summarize product Syntax Checker description information and have unique identifiers according to the ID IDREF rules Lines 16 through 23 XML Testbed summarize customer purchases product sales each entry referring to the product having been sold by use of the idre f attribute Not all customers have been sold all products SEY BO LD Consider the following two renderings of the same data using two orientations each produced with different stylesheets PUBLICATIONS http www xml com pub a 2000 08 holman s2_1 html page 2 2 di 7 10 05 2001 9 07 18 XML com Getting started with XSLT and XPath Aug 23 2000 THIS SITE IS ON THE 5 E Netscape Product Sales Summary OR x vix Netscape Record of Sales Miel x File Edit View Go Bookmarks Options Directory File Edit View Go Bookmarks Options O Window Help Directory Window Help Location JL Mast d Lee LO LAE Location Il AFER TA eT n n UT Product Sales Summary Record of Sales C1001 Packing Boxes 100 C1001 Packing Tape 200 C1002 Packing Tape 50 C1003 Packing Boxes 75 C1003 Packing Tape 15 Packing Packing Boxes Tape C1001 100 200 C1002 50 C1003 T5 15 Totals di 265 Fj Document Done wa 3 58 Document E EJ 7 Figure 2 3 Different HTML results from the same XML source Note how the same
10. This version http www w3 org TR 1998 REC xml 19980210 http www w3 org TR 1998 REC xml 19980210 xml http www w3 org TR 1998 REC xml 19980210 html http www w3 org TR 1998 REC xml 19980210 pdf http www w3 org TR 1998 REC xml 19980210 ps U 1 Latest version http www w3 org TR REC xml Previous version http www w3 org TR PR xml 971208 Hi Editors Tim Bray Textuality and Netscape lt tbray G textuality com H Jean Paoli Microsoft lt jeanpa microsoft com gt C M Sperberg McQueen University of Illinois at Chicago cmsmcq G uic edu iH Abstract The Extensible Markup Language H XML is a subset of SGML Hj that is completely described in this document Its goal is to enable generic SGML to be served received and processed on the Web in the way that is now possible with HTML XML has been designed for ease of implementation and for interoperability with both SGML and HTML Status of this document This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation H It is a stable document and may be used as reference material or cited as a normative reference from another document ji W3C s role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment This enhances the functionality and interoperability of the Web This document specifies
11. XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker XML Testbed SEYBOLD PUBLICATIONS XML com Getting started with XSLT and XPath Aug 23 2000 and will work with any conformant XSLT processor 2 2 3 Stylesheet requirements ons and literal Note The current 4 14 2000 Internet Explorer 5 production release supports only an archaic experimental dialect of XSLT based on an early working draft of the recommendation The examples in this book will not run on the production release of IES The production implementation of the old dialect is described in http msdn microsoft com xml XSLGuide conformance asp 2 1 1 Some simple examples Consider the following XML file he11o xml obtained from the XML 1 0 Recommendation and modified to declare an associated stylesheet 01 lt xml version 1 0 gt 02 xml stylesheet type text xsl href hello xs1 03 sereeting Hello world s greeting Example 2 1 The first sample instance in XML 1 0 modified We will use this simple file as the source of information for our transformation Note that the stylesheet association processing instruction in line 2 refers to a stylesheet with the name hello xsl oftype XSL Recall that an XSLT processor is not obliged to respect the stylesheet associatio
12. embed Indicates that upon traversal of the link the designated resource should be embedded for the purposes of display or processing in the body of the resource and at the location where the traversal started replace Indicates that upon traversal of the link the designated resource should for the purposes of display or processing replace the resource where the traversal started new Indicates that upon traversal of the link the designated resource should be displayed or processed in anew context not affecting that of the resource where the traversal started http www w3 org TR 1998 WD xlink 19980303 13 di 16 10 05 2001 9 30 10 XML Linking Language XLink 6 2 The Actuate Axis The actuate attribute is used to express a policy as to when traversal of a link should occur It may take one of two values auto Indicates that the resource in question should be retrieved when any of the other resources of the same link is encountered and that the display or processing of the initiating resource is not considered complete until this is done All auto resources are retrieved in the order specified user Indicates that the resource should not be presented until there is an explicit external request for traversal 6 3 Combinations of the Show and Actuate Axes Each combination of the show and actuate attributes is meaningful Perhaps the least obvious is show replace combined with actuate auto this could
13. id ID namespace uriReference schemaLocation uriReference any attributes with non schema namespace gt Content annotation gt Can be included in schema e include ref Inclusion of a W3C XML Schema for the same target namespace lt include id ID schemaLocation uriReference any attributes with non schema namespace gt Content annotation lt include gt Can be included in schema e key ref Definition of a key key key id ID name NCName any attributes with non schema namespace gt Content annotation selector field Can be included in element e keyref ref Definition of a key reference lt keyref id ID name NCName refer QName any attributes with non schema namespace gt Content annotation selector field lt keyref gt Can be included in element e length ref Facet to define the length of a value lt length id ID value nonNegativeInteger fixed boolean false any attributes with non schema namespace gt Content annotation lt length gt Can be included in restriction e list ref Derivation by list list list id ID itemType QName any attributes with non schema namespace gt Content annotation simpleType Can be included in simpleType http www xml com pub a 2000 1 1 29 schemas structuresref ht
14. Language XSL Language Transformations XSLT conferences oreilly com INNOVATE COLLABORATE T Find it om the O Reilly Network FIND gt Search Article Archive FAQs Add the latest news from XML com to your web site Click here D gt COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed XML com What is XSLT I Aug 16 2000 can exploit the information as long as it remains flexible and flows abstract Late binding of the information to a final form can be based 1 2 1 Transformation from on the target use of the final product by delaying this binding until XML to XML late in the process we preserve the original information for 1 3 5 ranean Eod exploitation for other purposes along the way XML to XSL formatting Itis a common but misdirected practice to model information based semantics 1 2 3 Transformation from XML to non XML on how you plan to use it downstream It does not matter if your target is a presentation oriented structure for example or a structure that is appropriate for another markup based system Modeling practice should focus on both the business reasons and inherent relationships existing in the semantics behind the information being described as such the vocabularies are then content
15. Source of file x 7C samp hello htm Pie E3 lt b gt lt i gt lt u gt Hello world lt u gt lt i gt lt b gt Using an XML aware browser recognizing the W3C stylesheet association processing instruction in Example 2 1 the canvas is painted with the HTML resulting from application of the stylesheet the child window is opened using the View Source menu item E X samp hello xml Microsoft Internet Explorer Helio worid CRIT E hello xml Notepad 00 04 11 07 36 Mi E3 File Edit Search Help lt xml version 1 6 gt lt xml stylesheet type text xsl href hello xsl gt lt greeting gt Hello world lt greeting gt Figure 2 2 An XML aware browser viewing the source of a document The canvas content matches what the non XML browser rendered in Figure 2 1 Note that View Source http www xml com pub a 2000 08 holman s2_1 html page 1 5 di 6 10 05 2001 9 06 36 XML com Getting started with XSLT and XPath Aug 23 2000 displays the raw XML source and not the transformed XHTML result of applying the stylesheet Note I found it very awkward when first using browser based stylesheets to diagnose problems in my stylesheets Without access to the intermediate results of transformation it is often impossible to ascertain the nature of the faulty HTML generation One of the free resources found on the Crane Softwrights Ltd web site is a script for standalone command line invocation of the MSXML XSLT p
16. as well as 1ocator group and document which identify other related types of elements An element in whose start tag such an attribute appears is to be treated as an element of the indicated XLink type as dictated by this specification For example Note Subject to definitions to be developed in related standards the methods described in 7 Attribute Remapping may be used to rename the reserved attribute There are two mechanisms that may be used to associate the xml link and xml attributes attributes with a linking element The simplest is to provide the attribute explicitly in a start tag A less verbose method is to use XML s facilities for declaring default attribute values For example the following attribute list declaration would indicate that all instances of the A element in the current document are XLink simple links http www w3 org TR 1998 WD xlink 19980303 6 di 16 10 05 2001 9 30 10 XML Linking Language XLink 4 Linking Elements XLink defines two types of linking element e A simple link which is usually inline and always one directional e A much more general extended link which may be either inline or out of line and must be used for multidirectional links links originating from read only resources and so on Both kinds of links can have various types of information associated with them 4 1 Information Associated with Links The following information can be associated with a link and its
17. needs for our information our own infrastructure and processing capabilities and our own commercial and privacy concerns We can choose to dumb down our information for consumption and the installed base of user agents supporting presentation oriented semantic less HTML can be the perfect delivery vehicle to protect these concerns of ours This is a prose version of an excerpt from the book Practical Transformation Using XSLT and XPath Eighth Edition ISBN 1 894049 05 5 at the time of this writing published by Crane Softwrights Ltd written by G Ken Holman this excerpt was edited by Stan Swaren and reviewed by Dave Pawson PHP Admin Basics Darrell Brogdon Find it on the O Reilly Network BRS ory TET http www xml com pub a 2000 08 holman s1 html page 3 10 di 10 10 05 2001 9 05 02 O REILLY o xml from the inside out XML COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ji ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Security Alerts Noel Davis Find it on the O Reilly Network In the Linux DevCenter O REILLY NETWORK XML com Getting started with XSLT and XPath Aug 23 2000 Pre conference workshops 25th July Conference 26th amp 27th July Holiday Inn London Victoria OREILLY COM ONJAVA COM EE search amp Print Thi
18. 1 0 Second Edition 4 NameChar Letter Digit CombiningChar Extender 5 Name m Letter NameChar 6 Names z2 Name S Name 7 Nmtoken m NameChar 8 Nmtokens Nmtoken S Nmtoken Literal data is any quoted string not containing the quotation mark used as a delimiter for that string Literals are used for specifying the content of internal entities Entity Value the values of attributes Att Value and external identifiers SystemLiteral Note that a SystemLiteral can be parsed without scanning for markup Literals 9 EntityValue x 1 amp PEReference Reference 4 5 amp PEReference Reference 10 AttValue zu CU amp Reference lt amp Reference I1 SystemLiteral z ree pempe THI qe rE par mere 12 PubidLiteral z VEY PubidgChar 27 wt PubidOhar Trnje mim 13 PubidChar x20 xD xA a zA Z0 9 2 S_ Note Although the Entity Value production allows the definition of an entity consisting of a single explicit lt in the literal e g lt ENTITY mylt lt gt itis strongly advised to avoid this practice since any reference to that entity will cause a well formedness error 2 4 Character Data and Markup Text consists of intermingled character data and markup Definition Markup takes the form of start tags end tags
19. 1998 See http www sgmlsource com 8879rev n0029 htm XML Names Tim Bray Dave Hollander and Andrew Layman editors Namespaces in XML Textuality Hewlett Packard and Microsoft World Wide Web Consortium 1999 See http www w3 org TR REC xml names http www w3 org TR REC xml 34 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition B Character Classes Following the characteristics defined in the Unicode standard characters are classed as base characters among others these contain the alphabetic characters of the Latin alphabet ideographic characters and combining characters among others this class contains most diacritics Digits and extenders are also distinguished Characters 84 Letter BaseChar Ideographic 85 BaseChar m x0041 x005A 4 x0061 4x0074A 4 x00C0O 4x00D6 x00D8 x00F6 xOOF8 x00FF x0100 x0131 x0134 x013E x0141 x0148 xO14A x017E xO0180 x01C3 xO01CD x01F0 xO1F4 x01F5 xO1FA x0217 xO0250 x02A8 xO2BB x02C1 X0386 x0388 x038A x038C xO38E x03A1 413x03A3 4x03CE x03D0 x03D6 x03DA x03DC x03DE x03E0 xX03E2 x03F3 x0401 x040C x040E x044F x0451 x045C x045E x0481 x0490 x04C4 x04C7 x04C8 x04CB x04CC x04D0 x04EB x04EE x04F5 x04F8 x04F9 x0531
20. 1999 See http www ietf org rfc rfc2732 txt IETF RFC 2781 IETF Internet Engineering Task Force RFC 2781 UTF 16 an encoding of ISO 10646 ed P Hoffman F Yergeau 2000 See http www ietf org rfc rfc278 1 txt ISO 639 International Organization for Standardization ISO 639 1988 E Code for the representation of names of languages Geneva International Organization for Standardization 1988 ISO 3166 International Organization for Standardization ISO 3166 1 1997 E Codes for the representation of names of countries and their subdivisions Part 1 Country codes Geneva International Organization for Standardization 1997 ISO 8879 ISO International Organization for Standardization ISO 8879 1986 E Information processing Text and Office Systems Standard Generalized Markup Language SGML First edition 1986 10 15 Geneva International Organization for Standardization 1986 ISO IEC 10744 ISO International Organization for Standardization ISO IEC 10744 1992 E Information technology Hypermedia Time based Structuring Language HyTime Geneva International Organization for Standardization 1992 Extended Facilities Annexe Geneva International Organization for Standardization 1996 WEBSGML ISO International Organization for Standardization ISO 8879 1986 TC2 Information technology Document Description and Processing Languages Geneva International Organization for Standardization
21. 29 2000 lt annotation gt lt documentation xml lang en gt This is a type definition for generic text in XML For maintenance reasons it is preferable to us THIS SITE IS ON THE something like this rather than the built in datatype z string unless you have an absolute requirement to use a simple datatype lt documentation gt lt annotation gt lt group minOccurs 0 maxOccurs unbounded gt lt any namespace other gt lt group gt lt attributeGroup ref xml specialAttrs gt lt anyAttribute namespace any gt lt complexType gt You will have to import the xml lang and xml space definitions too import namespace http www w3 org XML 1998 namespace schemaLocation http www w3 org 2000 10 xml xsd gt And the schema element itself should probably have namespace declaration xmlns xml http www w3 org XML 1998 namespace Limitations There is no provision for e overriding facets in the instance document creating quantity unit pairs declaring n gt 1 dimensional arrays of tokens specifying inheritance effects declaring complex constraints where the value of some other information item in the instance e g an attribute has an effect on the current datatype by Clay Shirky Find it at openp2p com http www xml com pub a 2000 1 1 29 schemas dataref html 2 di 2 10 05 2001 9 21 19 XML com W3C XML Schema Structures Reference Nov 2
22. Additionally user agents recognize a number of general entity references as built in characters supporting accented letters the non breaking space and other characters from public entity sets defined or used by the designers of HTML An XSLT processor recognizes the use of these characters in the result tree and serializes them using the assumed built in general entities 1 2 3 2 Text lexical conventions An XSLT processor can be asked to serialize only the PCDATA content of the entire result tree resulting in a file of simple text without employing any markup techniques All text is represented by the characters individual values even those characters sensitive to XML interpretation Note 13 use the text method often for synthesizing MSDOS batch files By walking through my XML source I generate commands to act on resources identified therein thus producing an executable batch file tailored to the information 1 2 3 3 Arbitrary binary and custom lexical conventions Many of our legacy systems or existing applications expect information to follow custom lexical conventions according to arbitrary rules Often this format is raw binary not following textual lexical patterns We are usually obliged to write custom programs and transformation applications to convert our XML information to these non standardized formats due to their binary or non structured natures XSLT can play a role even here where the target format is neither str
23. Edit menu and pressing Include Image e Opening up a relevant dialog e g a file chooser for the image to include Trying to code something like this links with multiple targets directions and roles in XML while having old a href in mind is confusing and leads people to questions like the following e What is the correct tag for links in XML e If there is such a magic element how can I make it point to more than one resource e What if I want links to have different meanings relevant to my data E g the motherhood and friendship relationships between two person elements In answer to these and many other linking questions this article describes the structure and use of XLink The article is composed of three parts a brief example that illustrates the basics of the language a complete review of the structure of XLink and a list of XLink related resources The resources include some XSLT transformations that enable your HTML output to simulate required XLink behavior on today s browsers Pages 1 2 3 http www xml com pub a 2000 09 xlink index html 2 di 2 10 05 2001 9 10 45 THA TE www thawte com XML com What is XLink Sep 18 2000 O REILLY o xml from the inside out RESOURCE gt CENTERS OnE ieri ONJAVA COM Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS An
24. If you have experience with SGML you will recognize these declarations from SGML DTDs Document Type Definitions If you have never seen them before their significance may not be immediately obvious One of the greatest strengths of XML is that it allows you to create your own tag names But for any given application it is probably not meaningful for tags to occur in a completely arbitrary order Consider the old joke example introduced earlier Would this be meaningful lt gracie gt lt quote gt lt oldjoke gt Goodnight lt applause gt Gracie lt oldjoke gt lt quote gt lt burns gt lt gracie gt Say lt quote gt goodnight lt quote gt lt gracie gt Gracie lt burns gt lt gracie gt It s so far outside the bounds of what we normally expect that it s nonsensical It just doesn t mean anything However from a strictly syntactic point of view there s nothing wrong with that XML document So if the document is to have meaning and certainly if you re writing a stylesheet or application to process it there must be some constraint on the sequence and nesting of tags Declarations are where these constraints can be expressed More generally declarations allow a document to communicate http www xml com pub a 98 10 guide2 html 3 di 10 10 05 2001 9 28 30 XML com What Do XML Documents Look Like Oct 03 1998 meta information to the parser about its content Meta information includes the allowed sequence and nes
25. Inside the XML 1 0 Specification If you want to understand XML you have to read the specification However to really get inside the specification and understand why it says what it does you need an expert guide Tim Bray co editor of the XML 1 0 specification shares his knowledge and insights about XML SGML and the working group behind the specification in this annotated version of the document Tim created the Annotated XML Specification in XML and wrote an excellent explanation of how he did this Clicking on the link below will open the Annotated XML Specification in a frameset window along with a floating navigation window if your browser supports JavaScript Alternatively you can use a three paned frames version of the document Use the links in the navigation window to get around the main document as well as to return to this page or to XML com The Annotated XML 1 0 Specification Non JavaScript Version http www xml com pub a axml axmlintro html 1 di 2 10 05 2001 9 23 45 l i conferences oreilly com INNOVATE COLLABORATE DISCOVER XML com The Annotated XML Specification Apr 15 1998 Add the latest news still requires frames from XML com to E your web sit COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt
26. Section 2 12 to identify the language Since the purpose of this attribute is to standardize information across applications the XML specification also describes how languages are to be identified Previous What is XML b Next Validity P RDF Applications with Prolog http www xml com pub a 98 10 guide2 html 10 di 10 10 05 2001 9 28 30 Extensible Markup Language XML 1 0 Second Edition Wir Extensible Markup Language XML 1 0 Second Edition W3C Recommendation 6 October 2000 This version http www w3 org TR 2000 REC xml 20001006 XHTML XML PDF XHTML review version with color coded revision indicators Latest version http www w3 org TR REC xml Previous versions http www w3 org TR 2000 WD xml 2e 20000814 http www w3 org TR 1998 REC xml 19980210 Editors Tim Bray Textuality and Netscape tbray textuality com gt Jean Paoli Microsoft jeanpa microsoft com C M Sperberg McQueen University of Illinois at Chicago and Text Encoding Initiative cmsmcq uic edu gt Eve Maler Sun Microsystems Inc lt eve maler east sun com gt Second Edition Copyright 2000 W3C MIT INRIA Keio All Rights Reserved W3C liability trademark document use and software licensing rules apply Abstract The Extensible Markup Language XML is a subset of SGML that is completely described in this document Its goal is to enable generic SGML to be served received and pr
27. These datatypes are not available for constraining data in mixed content Derivation and Facets e All simple datatypes are derived from their base type by restricting the values allowed in their lexical spaces or their value spaces e Every datatype has a set of facets that characterize the properties of the datatype For example the length of a string or the encoding of a binary type i e whether hex encoding or base64 By restricting some of the many facets a new datatype can be derived e There are three varieties of datatypes that you can use when deriving your own datatypes as well as atomic datatypes where the data contains a single value you can derive a list where the data is treated as a whitespace separated list of tokens and a union type where the lexical value of the data determines which of the base types is used Usage of the string datatype The string datatype should not be used for general text Use a complex type instead allowing mixed content and wildcarding it to allow elements from other namespaces This kind of declaration will be more future proof It is impossible to extend an element declared to have simple content so that it can contain sub elements Here is a definition that may be more suitable lt complexType name kindToStrangersText mixed true gt http www xml com pub a 2000 1 1 29 schemas dataref html 1 di 2 10 05 2001 9 21 19 XML com W3C XML Schema Datatypes Reference Nov
28. book gt lt xsd complexType mixed true gt lt xsd all gt lt xsd element name title type xsd string gt lt xsd element name author type xsd string gt lt xsd all gt xsd attribute name isbn type xsd string gt lt xsd complexType gt lt xsd element gt which will validate an XML element such as lt book isbn 0836217462 gt Funny book by lt author gt Charles M Schulz lt author gt Its title lt title gt Being a Dog Is a Full Time Job lt title gt says it all lt book gt Unlike DTDs W3C XML Schema mixed content doesn t modify the constraints on the sub elements which can be expressed in the same way as simple content models While this is a significant improvement over XML 1 0 DTDs note that the values of the character data and its location relative to the child elements cannot be constrained Pages 1 2 3 4 5 6 7 8 9 Next Page http www xml com pub a 2000 1 1 29 schemas part1 html page 5 1 di 2 10 05 2001 9 19 02 XML com Using W3C XML Schema Nov 29 2000 THIS SITE IS ON THE 3 Can the samba Story be Retold http www xml com pub a 2000 1 1 29 schemas part1 html page 5 2 di 2 10 05 2001 9 19 02 XML com Using W3C XML Schema Nov 29 2000 O REILLY A xml from the inside out O REILLY NETWORK ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS A
29. definition Well Formed External Parsed Entity 78 extParsedEnt 2 TextDecl content An internal general parsed entity is well formed if its replacement text matches the production labeled content All internal parameter entities are well formed by definition A consequence of well formedness in entities is that the logical and physical structures in an XML document are properly nested no start tag end tag empty element tag element comment processing instruction character reference or entity reference can begin in one entity and end in another 4 3 3 Character Encoding in Entities Each external parsed entity in an XML document may use a different encoding for its characters All XML processors must be able to read entities in both the UTF 8 and UTF 16 encodings The terms UTF 8 and UTF 16 in this specification do not apply to character encodings with any other labels even if the encodings or labels are very similar to UTF 8 or UTF 16 Entities encoded in UTF 16 must begin with the Byte Order Mark described by Annex F of ISO IEC 10646 Annex H of ISO IEC 10646 2000 section 2 4 of Unicode and section 2 7 of Unicode3 the ZERO WIDTH NO BREAK SPACE character xFEFF This is an encoding signature not part of either the markup or the character data of the XML document XML processors must be able to use this character to differentiate between UTF 8 and UTF 16 encoded documents Although an XML processor is requ
30. gt 72 PEDecl ENTITY S S Name S JE GN SC 73 EntityDef EntityValue ExternalID NDataDecl 74 PEDef EntityValue ExternalID The Name identifies the entity in an entity reference or in the case of an unparsed entity in the value of an ENTITY or ENTITIES attribute If the same entity is declared more than once the first declaration encountered is binding at user option an XML processor may issue a warning if entities are declared multiple times 1 4 2 1 Internal Entities Definition If the entity definition is an Ent ityValue the defined entity is called an internal entity There is no separate physical storage object and the content of the entity is given in the declaration T Note that some processing of entity and character references in the literal entity value may be required to produce the correct http www xml com axml testaxml htm 19 di 34 10 05 2001 9 26 16 The Annotated XML Specification replacement text see 4 5 Construction of Internal Entity Replacement Text An internal entity is a parsed entity Example of an internal entity declaration 4 2 2 External Entities Definition If the entity is not internal it is an external entity j 1 declared as follows External Entity Declaration Usl imesecenciaeuin e ac SYSTEM S SystemLiteral ESSEN CTS PubidLiteral S SystemLiteral 76 NDataDecl S NDATA T Sg VC N
31. information to the result tree 2 2 6 1 Pulling the input data http www xml com pub a 2000 08 holman s2_1 html page 3 6 di 8 10 05 2001 9 08 04 XML com Getting started with XSLT and XPath Aug 23 2000 When the stylesheet writer knows the location of and order of data found in the source tree and the writer wants to add to the result a value from or collection of that data then information can be pulled from the source tree on demand Two instructions are provided for this purpose one for obtaining or calculating a single string value to add to the result and one for adding rich markup to the result based on obtaining as many values as may exist in the tree The writer uses the lt xsl value of select XPath expression gt instruction in a stylesheet s element content to calculate a single value to be added to the result tree The instruction is always empty and therefore does not contain a template This value calculated can be the result of function execution the value of a variable or the value of a node selected from the source tree When used in the template of various XSLT instructions the outcome becomes part of the value of a result element attribute comment or processing instruction Note there is also a shorthand notation called an attribute value template that allows the equivalent to xsl value of to be used in a stylesheet s attribute content To iterate over locations in the source tree the lt
32. is similar to a copy and paste of the definitions of the included schema it s an inclusion and as such it doesn t allow any overriding of definitions of the included schema It can be used in this way lt xsd include schemaLocation character xsd gt The second inclusion mechanism xsd redefine is similar to xsd include except that it lets you redefine the declarations from the included schema lt xsd redefine schemaLocation characterl2 xsd gt lt xsd simpleType name nameType gt xsd restriction base xsd string gt lt xsd maxLength value 40 gt xsd restriction xsd simpleType xsd redefine Note that the declarations that are redefined must be placed in the xsd redefine element We ve already seen many features that can be used together with xsd include and xsd redefine to create libraries of schemas We ve seen how we can reference previously defined elements how we can define datatypes by derivation and use them and how we can define and use groups of attributes We ve also seen the parallel between elements and objects and datatypes and classes There are other features borrowed from object oriented design that can be used to create reusable schemas Abstract types The first feature derived from object oriented design is the substitution group Unlike the features we ve seen so far a substitution group isn t defined explicitly through a W3C XML Schema element but through referencing a common e
33. local any processContents skip lax strict strict any attributes with non schema namespace bv Content annotation any Can be included in choice sequence http www xml com pub a 2000 1 1 29 schemas structuresref html 1 di 7 10 05 2001 9 21 46 XML com W3C XML Schema Structures Reference Nov 29 2000 e anyAttribute ref Wildcard to replace any elements lt anyAttribute id ID namespace any other List of uriReference targetNamespace local any processContents skip lax strict strict any attributes with non schema namespace gt Content annotation anyAttribute Can be included in attributeGroup complexType extension e appInfo ref Information for an application appinfo Source uriReference Content any appinfo Can be included in e attribute ref Attribute declaration or reference attribute form qualified unqualified id ID name NCName ref QName type QName use prohibited optional required default fixed optional value string any attributes with non schema namespace gt Content annotation simpleType attribute Can be included in attributeGroup complexType extension schema e attributeGroup ref Group of attributes lt attributeGroup id ID name NCName ref QName any attributes with non schema namespace gt Content a
34. 04 11 07 36 Mi E3 File Edit Search Help lt xml version 1 6 gt lt xml stylesheet type text xsl href hello xsl gt lt greeting gt Hello world lt greeting gt Figure 2 2 An XML aware browser viewing the source of a document The canvas content matches what the non XML browser rendered in Figure 2 1 Note that View Source http Awww xml com pub a 2000 08 holman s2_1 html 5 di 6 10 05 2001 9 06 12 XML com Getting started with XSLT and XPath Aug 23 2000 displays the raw XML source and not the transformed XHTML result of applying the stylesheet Note I found it very awkward when first using browser based stylesheets to diagnose problems in my stylesheets Without access to the intermediate results of transformation it is often impossible to ascertain the nature of the faulty HTML generation One of the free resources found on the Crane Softwrights Ltd web site is a script for standalone command line invocation of the MSXML XSLT processor This script is useful for diagnosing problems by revealing the result of transformation This script has also been used extensively by some to create static HTML snapshots of their XML for delivery to non XML aware browsers Pages 1 2 3 THA TE www thawte com http www xml com pub a 2000 08 holman s2 1 html 6 di 6 10 05 2001 9 06 12 O REILLY o xml from the inside out XML COM RESOURCE gt CENTERS Business Graphics Metadata Mob
35. 1 0 gt 02 xml stylesheet type text xsl href hello xs1 03 sereeting Hello world s greeting Example 2 1 The first sample instance in XML 1 0 modified We will use this simple file as the source of information for our transformation Note that the stylesheet association processing instruction in line 2 refers to a stylesheet with the name hello xsl oftype XSL Recall that an XSLT processor is not obliged to respect the stylesheet association preference so let us first use a standalone XSLT processor with the following stylesheet he1lohtm xsl lt xml version 1 0 hellohtm xsl lt XSLT 1 0 http www CraneSoftwrights com training gt lt html xmlns xsl http www w3 org 1999 XSL Transform xsl version 1 0 lt head gt lt title gt Greeting lt title gt lt head gt lt body gt lt p gt Words of greeting lt br gt lt b gt lt i gt lt u gt lt xsl value of select greeting gt lt u gt lt i gt lt b gt lt p gt lt body gt amv Example 2 2 An implicitly declared simple stylesheet This file looks like a simple XHTML file an XML file using the HTML vocabulary Indeed it is just that but we are allowed to inject into the instance XSLT instructions using the prefix for the XSLT vocabulary declared on line 3 We can use any XML file as an XSLT stylesheet provided it declares the XSLT vocabulary within and indicates the version of XSLT being used Any prefix can be us
36. 10 05 2001 9 18 08 XML com Using W3C XML Schema Nov 29 2000 O REILLY 2S xml from the inside out O REILLY NETWORK ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF of Streaming Media Find it om the O Reilly Network FIND gt Search Article Archive XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List Find it on x An Interview With Tim Berners Lee OREILLY COM E search Using W3C XML Schema by Eric van der Vlist Pages 1 2 3 4 5 6 7 8 9 Defining Named Types We have seen that we can define Introducing Our First elements and attributes as we need them Schema Russian doll design or create them Slicing the Schema Print This Article first and reference them flat catalog Defining Named Types W3C XML Schema gives us a third Groups Compositors and mechanism which is to define data enn Derivation types either simple types that will be used for PCDATA elements or Content Types attributes or complex types that will be Constraints used only for elements and to use these Building Usable and types to define our
37. 2001 01 24 rdf html 2 di 3 10 05 2001 9 13 27 XML com What is RDF Jan 24 2001 Not Just For Searching The most common daily use of metadata is to aid our discovery of things But there are lots of other uses going on behind the scenes The library and video store are storing other metadata that you don t see how often the books and videos are being used how much it cost to buy them where to go for a replacement etc Running a library or a video store would be unthinkable without metadata Similarly the phone company of course uses its metadata most obviously to print the Yellow Pages but for many other internal management and administration tasks What About the Web The Web is a lot like a really really big library There are millions of things out there and if you know the URL in effect a kind of call number you can get them Since the Web has books movies and pizza joints the number of ways you might want to look things up includes all the things a library uses plus all the things the video store uses plus all the things the Yellow Pages use and lots more The problem at the moment is that there is hardly any metadata on the Web So how do we find things Mostly by using dumb brute force techniques The dumb brute force is supplied by the wandering web robots of search engine sites like Altavista Infoseek and Excite These sites do the equivalent of going through the library reading every book and all
38. First Schema Let s start by having a look at this simple document which describes a book lt xml version 1 0 encoding utf 8 gt Datatypes Reference qualification extroverted beagle W3C XML Schema lt qualification gt Structures Reference lt character gt lt character gt lt name gt Peppermint Patty lt name gt since 1966 08 22 since qualification bold brash and tomboyish lt qualification gt lt character gt lt book gt Get copy of libraryl xml for reference To write a schema for this document we could simply follow its structure and define each element as we find it To start we open an xsd schema element lt xml version 1 0 encoding utf 8 gt lt xsd schema xmlns xsd http www w3 org 2000 10 XMLSchema gt The schema element opens our schema It can also hold the definition of the target namespace and several default options of which we will see some in the following sections To match the start tag for the book element we define an element named book This element has attributes and non text children thus we consider it a complexType since the other datatype simpleType is reserved for datatypes holding only values and no element or attribute sub nodes The list of children of the book element is described by a sequence element lt xsd element name book gt xsd complexType http www xml com pub a 2000 1 1 29 schemas pa
39. Groups 6 Link Behavior 6 1 The Show Axis 6 2 The Actuate Axis 6 3 Combinations of the Show and Actuate Axes 7 Attribute Remapping 8 Conformance Oo Appendices A Unfinished Work A 1 Structured Titles B References 1 Introduction This document specifies constructs that may be inserted into XML resources to describe links between objects A link as the term is used here is an explicit relationship between two or more data objects or portions of data objects This specification is concerned with the syntax used to assert link existence and describe link characteristics Implicit unasserted relationships for example that of one word to the next or that of a word in a text to its entry in an on line dictionary are obviously important but outside its http www w3 org TR 1998 WD xlink 19980303 2 di 16 10 05 2001 9 30 10 XML Linking Language XLink scope Links are asserted by elements contained in XML documents The simplest case is very like an HTML A link and has these characteristics e The link is expressed at one of its ends similar to the A element in some document e Users can only initiate travel from that end to the other e The link s effect on windows frames go back lists stylesheets in use and so on is mainly determined by browsers not by the link itself For example traversal of A links normally replaces the current view perhaps with a user option to open a new window
40. ID attribute IDREF or IDREF S An IDREF attribute s value must be the value of a single ID attribute on some element in the document The value of an IDREFS attribute may contain multiple IDREF values separated by white space Section 2 3 production 3 ENTITY or ENTITIES An ENTITY attribute s value must be the name of a single entity see the discussion of entity declarations below The value of an ENTITIES attribute may contain multiple entity names separated by white space NMTOKEN or NMTOKENS Name token attributes are a restricted form of string attribute In general an NMTOKEN attribute must consist of a single word Section 2 3 production 7 but there are no additional constraints on the word it doesn t have to match another attribute or declaration The http www xml com pub a 98 10 guide2 html 5 di 10 10 05 2001 9 28 30 XML com What Do XML Documents Look Like Oct 03 1998 value of an NMTOKENS attribute may contain multiple NMTOKEN values separated by white space A list of names You can specify that the value of an attribute must be taken from a specific list of names This is frequently called an enumerated type because each of the possible values is explicitly enumerated in the declaration Alternatively you can specify that the names must match a notation name see the discussion of notation declarations below There are four possible default values REQUIRED The attribute must
41. It is often difficult to change traditional perspectives of transformation that focus on the source tree yet we must look at XSLT transformations focused on the result tree The predictable orders we traverse the source trees are not restricted to only source tree parse order also called document order Information in the source trees can be ignored or selectively processed The order of the result tree dictates the order in which we must access our source trees Note 8 I personally found this required orientation difficult to internalize having been focused on the creation of my source information long before addressing issues of transforming the sources to different results Understanding this orientation is key to quickly producing results using XSLT Itis not however an XSLT processor implementation constraint to serially produce the result tree This is an important distinction in the language design that supports parallelism An XSLT processor supporting parallelism can simultaneously produce portions of the result tree provided only that the end result is created as if it were produced serially 1 1 6 Namespaces To successfully use and distinguish element types in our instances as being from given vocabularies the Namespaces in XML Recommendation gives us means to preface our element type names to make them unique The Recommendation and the following widely read discussion document describe the precepts for using this techniqu
42. Maler and Steve DeRose editors XML Pointer Language XPointer V1 0 ArborText Inso and Brown University Burlington Seekonk et al World Wide Web Consortium 1998 See http www w3 org TR WD xptr ISO IEC 10744 ISO International Organization for Standardization ISO IEC 10744 1992 E Information technology Hypermedia Time based Structuring Language HyTime Geneva International Organization for Standardization 1992 Extended Facilities Annex Geneva International http www w3 org TR 1998 WD xlink 19980303 15 di 16 10 05 2001 9 30 10 XML Linking Language XLink Organization for Standardization 1996 See http www ornl gov sgml wg8 hytime html is 10744r html IETF RFC 1738 IETF Internet Engineering Task Force RFC 1738 Uniform Resource Locators 1991 See http www w3 org Addressing rfc1738 txt IETF RFC 1808 IETF Internet Engineering Task Force RFC 1808 Relative Uniform Resource Locators 1995 See http www w3 org Addressing rfc1808 txt TEI C M Sperberg McQueen and Lou Burnard editors Guidelines for Electronic Text Encoding and Interchange Association for Computers and the Humanities ACH Association for Computational Linguistics ACL and Association for Literary and Linguistic Computing ALLC Chicago Oxford Text Encoding Initiative 1994 CHUM Steven J DeRose and David G Durand 1995 The TEI Hypertext Guidelines In Computing and the Humanities 29 3 Reprinted in
43. Multilingual Plane Geneva International Organization for Standardization 1993 plus amendments AM 1 through AM 7 ISO IEC 10646 2000 ISO International Organization for Standardization ISO IEC 10646 1 2000 Information technology Universal Multiple Octet Coded Character Set UCS Part 1 Architecture and Basic Multilingual Plane Geneva International Organization for Standardization 2000 Unicode The Unicode Consortium 7he Unicode Standard Version 2 0 Reading Mass Addison Wesley Developers Press 1996 Unicode3 The Unicode Consortium The Unicode Standard Version 3 0 Reading Mass Addison Wesley Developers Press 2000 ISBN 0 201 61633 5 A 2 Other References Aho Ullman Aho Alfred V Ravi Sethi and Jeffrey D Ullman Compilers Principles Techniques and Tools Reading Addison Wesley 1986 rpt corr 1988 Berners Lee et al Berners Lee T R Fielding and L Masinter Uniform Resource Identifiers URI Generic Syntax and Semantics 1997 Work in progress see updates to RFC1738 Br ggemann Klein Br ggemann Klein Anne Formal Models in Document Processing Habilitationsschrift Faculty of Mathematics at the University of Freiburg 1993 See ftp ftp informatik uni freiburg de documents papers brueggem habil ps Briiggemann Klein and Wood Briiggemann Klein Anne and Derick Wood Deterministic Regular Languages Universitat Freiburg Institut fiir Informatik Bericht 38 Oktober 1991
44. S gt 53 AttDef S Name S AttType S DefaultDecl The Name in the Att 1istDecl rule is the type of an element At user option an XML processor may issue a warning if attributes are declared for an element type not itself declared but this is not an error T The Name in the AttDef rule is the name of the attribute When more than one Att 1istDecl is provided for a given element type T the contents of all those provided are merged When more than one definition is provided for the same attribute of a given element type the first declaration is binding and later declarations are ignored For interoperability writers of DTDs may choose to provide at most one attribute list declaration for a given element type at most one attribute definition for a given attribute name and at least one attribute definition in each attribute list declaration E For interoperability an XML processor may at user option issue a warning when more than one attribute list declaration is provided for a given element type or more than one attribute definition is provided for a given attribute but this is not an error 3 3 1 Attribute Types XML attribute types are of three kinds a string type a set of tokenized types and enumerated types The string type may take any literal string as a value the tokenized types have varying lexical and semantic constraints as noted ji Attribute T
45. Text Encoding Initiative Background and Context ed Nancy Ide and Jean V ronis ISBN 0 7923 3704 2 Copyright 1998 W3C MIT INRIA Keio All Rights Reserved W3C liability trademark document use and software licensing rules apply http www w3 org TR 1998 WD xlink 19980308 16 di 16 10 05 2001 9 30 10
46. The customer element is a child of the document element which is named purchase Although the presence of an explicit formal document model is useful to an XML processor or to a system working with XML instances that model has no impact on the implicit structural model and only minor influence on the interpretation of content found in the instance This point holds true whether the model is expressed in a DTD or in some of the other Recommendations for structural and content schemata being developed Consider the following valid XML instance purcdtd xml lt xml version 1 0 gt lt DOCTYPE purchase lt ELEMENT purchase customer prod lt ATTLIST purchase id ID REQUIRED gt lt ELEMENT customer EMPTY gt lt ATTLIST customer db CDATA REQUIREI lt ELEMENT product amount gt lt ATTLIST product db CDATA REQUIREI lt ELEMENT amount ESAMI lt purchase id p001 gt lt customer db cust123 gt lt product db prod345 gt lt amount gt 23 45 lt amount gt Onc oXe BIG TE lt purchase gt Example 1 2 A valid XML purchase order instance See how the information content is no different from the previous example but in this case an explicit document model using XML 1 0 DTD syntax is included it could have been included by reference to a separate resource A p
47. Thread What do all these situations have in common and what differences lie behind the scenes First of all each of these systems is based on metadata that is information about information In each case you need a piece of information the book s location the video s name the pizza joint s phone number you don t have In each case you use metadata information about information to get it We re all used to this stuff metadata ordinarily comes in named chunks subject director business category that associate lookup information donkeys John Huston Pizza South Side with the information you re really after Here s a subtle but important point in theory metadata is not really necessary you could go through the library one book at a time looking for donkey books or through the video store shelves until you found your movie or call all the numbers in your area code until you find pizza delivery But that would be very wasteful in fact it would be stupid Metadata is the way to go It s All Different Behind the Scenes In each of our scenarios we used metadata and we used it in remarkably similar ways Does this mean that the library the video store and the phone company all use the same metadata setup Of course not Every library has a choice among at least two systems for organizing their books and among many vendors who will sell them software to do the looking up The same is obviously true for video sto
48. Transformation Standards List Using XSLT and XPath covering the entire scope of the Submissions List W3C XSLT and XPath through working drafts and the final 1 0 recommendations This material is delivered by Crane in TOOLBOX instructor led sessions and is licensed to other training organizations around the world needing to teach these Syntax Checker exciting technologies XML Testbed Crane has rewritten the first two chapters of this material into prose These prose oriented chapters are published on XML com correspondingly as two main sections The FYB iD material assumes no prior knowledge of XSLT and XPath and PUBLICATIONS guides the reader through background context structure concepts and introductory terminology THIS SITE IS ON THE Table of Contents 1 The context of XSL Transformations and the XML Path Language Sponsored By 1 The XML family of Recommendations 1 1 1 Extensible Markup Language XML 1 1 2 XML Path Language XPath 1 1 3 Styling structured information 1 1 4 Extensible Stylesheet Language XSL 1 1 5 Extensible StylesheetLanguage Transformations XSLT 1 1 6 Namespaces 1 1 7 Stylesheet association 2 Transformation data flows 1 2 1 Transformation from XML to XML 1 2 2 Transformation from XML to XSL formatting semantics 1 2 3 Transformation from XML to non XML 1 2 4 Three tiered architectures 2 Getting started with XSLT and XPath 2 Stylesheet examples 2 1 1 Some s
49. Unparsed he Not recognized Included Included if if Forbidden Included Content validating Reference in Not recognized Included m 2 Forbidden Forbidden Included Attribute Value literal E ERE http Awww w3 org TR REC xml 27 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition Forbidden Forbidden Notify Not recognized Bypassed Bypassed Forbidden Included Reference in DTD Included as PE Forbidden Forbidden Forbidden Forbidden 4 4 1 Not Recognized Occurs as Attribute Value Not recognized Reference in Entity Value Included in literal Outside the DTD the character has no special significance thus what would be parameter entity references in the DTD are not recognized as markup in content Similarly the names of unparsed entities are not recognized except when they appear in the value of an appropriately declared attribute 4 4 2 Included Definition An entity is included when its replacement text is retrieved and processed in place of the reference itself as though it were part of the document at the location the reference was recognized The replacement text may contain both character data and except for parameter entities markup which must be recognized in the usual way m The string AT amp amp T expands to AT amp T and the remaining ampersand is not recognized as an entity refer
50. Words of greeting lt br gt Result Tree lt b gt lt i gt lt u gt lt xslivalue of select greeting gt lt u gt lt i gt lt b gt Template lt p gt lt boay lt html gt Literal Result Elements Figure 2 5 Components of an Implicit Stylesheet The XML declaration is consumed by the XML processor embedded within the XSLT processor thus the XSLT processor never sees it The remainder of the file is considered the result tree template for an implicit rule for the root of the document describing the shape of the entire outcome of the transformation The document element is named htm1 and contains the namespace and version declarations of the XSLT language Any element type within the result tree template that is qualified by the prefix assigned to the XSLT namespace URI is recognized as an XSLT instruction No extension instruction namespaces are declared thus all other element types in the instance are literal result elements Indeed the document element is a literal result element as it too is not an instruction 2 2 3 Stylesheet requirements Every XSLT stylesheet must identify the namespace prefix used therein for XSLT instructions The default namespace cannot be used for this purpose The namespace URI associated with the prefix must be the value http www w3 0rg 1999 XSL Transform ltis a common practice to use the prefix xs1 to identify the XSLT vocabulary though this is only convention and any valid prefix can
51. a draft document and may be updated replaced or obsoleted by other documents at any time It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than work in progress A list of current W3C working drafts can be found at http www w3 org TR This work is part of the W3C XML Activity for current status see http www w3 org MarkUp XML Activity For information about the XPointer language which is expected to be used with XLink see http www w3 org TR WD xptr See http www w3 org TR NOTE xlink principles for additional background on the design principles informing XLink Abstract This document specifies constructs that may be inserted into XML resources to describe links between objects It uses XML syntax to create structures that can describe the simple unidirectional hyperlinks of today s HTML as well as more sophisticated multi ended and typed links http www w3 org TR 1998 WD xlink 19980303 1 di 16 10 05 2001 9 30 10 XML Linking Language XLink XML Linking Language XLink Version 1 0 Table of Contents Introduction 1 1 Origin and Goals 1 2 Relationship to Existing Standards 1 3 Terminology 1 4 Notation 2 Locator Syntax Link Recognition 4 Linking Elements 4 1 Information Associated with Links 4 1 1 Locators 4 1 2 Link Semantics 4 1 3 Remote Resource Semantics 4 1 4 Local Resource Semantics 4 2 Simple Links 4 3 Extended Links 5 Extended Link
52. a given stylesheet While I am examining the results of stylesheet processing the post process determines whether or not the well formed file validates against the model to which I m designing the stylesheet When anomalies are seen I can check the validation for the possible source of a problem before diagnosing the stylesheet itself http www xml com pub a 2000 08 holman s1 html page 2 10 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 d 7 1 1 5 6 Multiple source files possible The first source file fed to the XSLT processor defines the first abstract tree of nodes the stylesheet uses The stylesheet may access arbitrary other source files or even itself as a source file to supplement the information found in the primary file The names of these supplementary resources can be hardwired into the stylesheet passed to the stylesheet as a parameter or the stylesheet can find them in the source files A separate node tree represents every resource accessed as a source file each with its own scope of unique node identifiers and global values When a given resource is identified more than once as a source file the XSLT processor creates only a single representation for that resource In this way a stylesheet is guaranteed to work unambiguously with source information 1 1 5 7 Stylesheet supplements source A given transformation result does not necessarily obtain all of its information from the source files It
53. addressing portion is based on XPath as a core just as with XSLT Pages 1 2 3 http www xml com pub a 2000 08 holman s1 html 7 di 8 10 05 2001 9 01 41 XML com What is XSLT I Aug 16 2000 XM Tsugre CONFERENCE amp EXPOSITION 21 25 May 2001 Berlin m www xmleurope com http www xml com pub a 2000 08 holman s1 html 8 di 8 10 05 2001 9 01 41 XML com What is XSLT I Aug 16 2000 O REILLY o xml from the inside out oenar wervon ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema THE BOOK OF BUSINESS What is RDF Mac Dev News V Roundup Find it in the Mac DevCenter FIND gt Search Article Archive FAQs Add the latest news from XML com to l your web site COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML e Y af y OREILLY COM UNIX and Linux gt Click to explore the AIX advantage Co W hatus XSLI What is XSLT I by G Ken Holman August 16 2000 The Context of XSL Transformations and the Table of Contents XML Path Language This first chapter examines the context of two W3C Recommendations Extensible Stylesheet Language Transformations XSLT and XML Path Language XPath
54. an x prefix XML processors should match character encoding names in a case insensitive way and should either interpret an IANA registered name as the encoding registered at IANA for that name or treat it as unknown processors are of course not required to support all IANA registered encodings In the absence of information provided by an external transport protocol e g HTTP or MIME it is an error for an entity including an encoding declaration to be presented to the XML processor in an encoding other than that named http www w3 org TR REC xml 26 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition in the declaration or for an entity which begins with neither a Byte Order Mark nor an encoding declaration to use an encoding other than UTF 8 Note that since ASCII is a subset of UTF 8 ordinary ASCII entities do not strictly need an encoding declaration It is a fatal error for a TextDecl to occur other than at the beginning of an external entity It is a fatal error when an XML processor encounters an entity with an encoding that it is unable to process It is a fatal error if an XML entity is determined via default encoding declaration or higher level protocol to be in a certain encoding but contains octet sequences that are not legal in that encoding It is also a fatal error if an XML entity contains no encoding declaration and its content is not legal UTF 8 or UTF 16 Examples of text declaration
55. and version declarations for the element to be recognized as an instruction The children of the wrapper element are the top level elements comprised of global constructs serialization information and certain maintenance instructions Template rules supply the stylesheet behavior for matching source tree conditions The content of a template rule is a result tree template containing both literal result elements and XSLT instructions The example above has only a single template rule that being for the root of the document 2 2 2 Implicitly declared stylesheets The simplest kind of XSLT stylesheet is an XML file implicitly representing the entire outcome of transformation The result vocabulary is arbitrary and the stylesheet tree forms the template used by the XSLT processor to build the result tree If no XSLT or extension instructions are found therein the stylesheet tree becomes the result tree If instructions are present the processor replaces the instructions with the outcomes of their execution http www xml com pub a 2000 08 holman s2_1 html page 3 2 di 8 10 05 2001 9 08 04 XML com Getting started with XSLT and XPath Aug 23 2000 van SITE IS ON THE XSLT Namespace Declaration lt xml version 1 0 gt lt html xmlns xsl http wuw w3 org 1999 XSL Transform xsliversion 1 0 gt Version of XSLT required lt head gt lt title gt Greeting lt title gt lt head gt by the Stylesheet lt body gt lt p gt
56. are busy deploying simpler more pragmatic applications for Web based content and metadata syndication All these themes meet sometimes productively sometimes confusingly on the RDF Interest Group list but they also typically each have a dedicated email list For example the RSS DEV group has produced the RDF Site Summary RSS 1 0 Specification which provides an RDF based channel format designed for interoperability with high level vocabularies such as Dublin Core as well as a variety of more application specific RDF vocabularies Notes on Update Dan Brickley This update to the 1998 article serves only to synchronize it with recent RDF terminology Since this document was first published the W3C has published the Model and Syntax http www xml com pub a 2001 01 24 rdf html page 3 3 di 4 10 05 2001 9 14 09 XML com What is RDF Jan 24 2001 specification as a Recommendation I have updated the markup example to use current RDF 1 0 syntax There have also been some terminology changes PropertyType became Property Property became Statement I have also added a brief mention of subject predicate object terminology and lowercased a few mentions Value since rdf object replaced rdf value for talking about the object of a statement Find it on O Reilly Network http www xml com pub a 2001 01 24 rdf html page 3 4 di 4 10 05 2001 9 14 09 XML com What is RDF Jan 24 2001 O REILLY xXx
57. as errors For example the content model b c b d is non deterministic because given an initial b the XML processor cannot know which b in the model is being matched without looking ahead to see which element follows the b In this case the two references to b can be collapsed into a single reference making the model read b c d An initial b now clearly matches only a single name in the content model The processor doesn t need to look ahead to see what follows either c or d would be accepted More formally a finite state automaton may be constructed from the content model using the standard algorithms e g algorithm 3 5 in section 3 9 of Aho Sethi and Ullman Aho Ullman In many such algorithms a follow set is constructed for each position in the regular expression i e each leaf node in the syntax tree for the regular expression if any position has a follow set in which more than one following position is labeled with the same element type name then the content model is in error and may be reported as an error Algorithms exist which allow many but not all non deterministic content models to be reduced automatically to equivalent deterministic models see Br ggemann Klein 1991 Br ggemann Klein F Autodetection of Character Encodings Non Normative The XML encoding declaration functions as an internal label on each entity indicating which character encoding is in use Before an XML processor can read the
58. born gt July 12 1884 lt born gt lt died gt January 24 1920 lt died gt lt biography gt p In 1906 Modigliani settled in Paris where p lt biography gt lt artistinfo gt Also brief descriptions of time periods are included in separate files such as lt xml version 1 0 gt lt period gt lt city gt Paris lt city gt lt country gt France lt country gt lt timeframe begin 1900 end 1920 gt lt title gt Paris in the early 20th century lt end gt Amadeo lt end gt lt description gt lt p gt During this period Russian lt description gt lt period gt up to the twenties lt title gt Italian lt p gt Fulfilling our requirement i e creating a file that relates artists to their influences and periods is a task an beyond a simple strategy like adding a or img links to the above documents for several reasons e A single artist has many influences a link points from one resource to many e A single artist has associations with many periods e The link itself must be semantically meaningful Having an influence is not the same as belonging to a period and we want to express that in our document The XLink Solution In XLink we have two type of linking elements simple like a and img in HTML and extended Links are represented as elements However XLink does not impose any particular correct name for your links instead it lets you decide which elements of your
59. bound to prove useful in future projects We will wrap up by presenting some pointers to useful XLink tools Tools and references The following is a non exhaustive list of XLink aware tools and references you might find useful for your projects 1 Mozilla M17 Browser Mozilla Open source browser with restricted XLink support 2 Link Justin Ludwig A small XLink aware XML browser 3 psgml xpointer el David Megginson A very useful extension to psgml for emacs that generates XPointer expressions 4 Reusable XLink XSLT transformations Fabio Arciniegas A This set of XSLT templates allow the transformation of extended links to HTML and JavaScript representations 5 The XLink Specification W3C July 3 2000 6 XMLhack XLink news Latest XLink news and software releases Conclusion XLink is a powerful and compact specification for the use of links in XML documents This article has explored the structure and basic uses of XLink as described in the current W3C spec July 3rd 2000 Even though XLink has not been implemented in any of the major commercial browsers yet its impact will be crucial for the XML applications of the near future Its extensible and easy to learn design should prove an advantage as the new generation of XML applications develop For questions and comments please contact the author J The Who What How and Why of P2P comingsoon The O Reilly P2P Research Report http www xml com
60. by explicit markup The logical and physical structures must nest properly as described in 4 3 2 Well Formed Parsed Entities 2 1 Well Formed XML Documents Definition A textual object is a well formed XML document if 1 Taken as a whole it matches the production labeled document Ji 2 It meets all the well formedness constraints given in this specification 3 Each of the parsed entities which is referenced directly or indirectly within the document is well formed Document 1 document prolog element Misc T Matching the document production implies that 1 It contains one or more elements 2 Definition There is exactly one element called the root or document element no part of which appears in the content of any other element For all other elements if the start tag is in the content of another element the end tag is in the content of the same element More simply stated the elements delimited by start and end tags nest properly within each other T Definition As a consequence of this for each non root element C in the document there is one other element P in the document such that C is in the content of P but is not in the content of any other element that is in the content of P P is referred to as the parent of C and C as a child of P M 2 2 Characters Definition A parsed entity contains text a sequence of characters which may represent markup or character data Definition
61. children of that customer find that child whose idre f attribute is the value of the id attribute of the focus element When there is no such child the column value is empty and processing continues As many columns are produced for a body row as for the header row and our output becomes perfectly aligned Finally lines 23 through 28 build the bottom row of the table with the totals calculated for each product After the boilerplate leftmost column line 24 uses the same product expression as on lines 10 and 17 to generate the same number of table columns The focus changes to each product for lines 25 through 28 A local scope variable is bound with the focus position in the tree Each column is then calculated using a built in function as the sum of all lt prodsale gt elements that reference the column being totaled The XPath designers having provided the sum function in the language keep the stylesheet writer from having to implement complex counting and summing code rather the writer merely declares the need for the summed value to be added to the result on demand by using the appropriate XPath expression The file prod exp xs1 is an explicit XSLT stylesheet with a number of result templates for handling source information 01 lt xml version 1 0 prod exp xsl 02 XS 10 Nro wwweCrsanesotawalghis COm Tr rainne gt 03 lt xsl stylesheet xmlns xsl http www w3 org 1999 XSL Transform 04 v
62. documents are conforming SGML documents XML documents are made up of storage units called entities which contain either parsed or unparsed data Parsed data is made up of characters some of which form character data and some of which form markup Markup encodes a description of the document s storage layout and logical structure XML provides a mechanism to impose constraints on the storage layout and logical structure Definition A software module called an XML processor is used to read XML documents and provide access to their content and structure Definition It is assumed that an XML processor is doing its work on behalf of another module called the application This specification describes the required behavior of an XML processor in terms of how it must read XML data and the information it must provide to the application http www w3 org TR REC xml 3 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition 1 1 Origin and Goals XML was developed by an XML Working Group originally known as the SGML Editorial Review Board formed under the auspices of the World Wide Web Consortium W3C in 1996 It was chaired by Jon Bosak of Sun Microsystems with the active participation of an XML Special Interest Group previously known as the SGML Working Group also organized by the W3C The membership of the XML Working Group is given in an appendix Dan Connolly served as the WG s contact with the W3C The desi
63. e The link goes to only one destination although a server may have great freedom in finding or dynamically creating that destination While this set of characteristics is already very powerful and obviously has proven itself highly useful and effective each of these assumptions also limits the range of hypertext functionality The linking model defined here provides ways to create links that go beyond each of these specific characteristics thus providing features previously available mostly in dedicated hypermedia systems 1 1 Origin and Goals Following is a summary of the design principles governing XLink 1 XLink shall be straightforwardly usable over the Internet 2 XLink shall be usable by a wide variety of link usage domains and of classes of linking application software The XLink expression language shall be XML The XLink design shall be prepared quickly The XLink design shall be formal and concise XLinks shall be human readable XLinks may reside outside the documents in which the participating resources reside XLink shall represent the abstract structure and significance of links O oo NDARA XLink must be feasible to implement 1 2 Relationship to Existing Standards Three standards have been especially influential e HTML Defines several SGML element types that represent links e HyTime Defines inline and out of line link structures and some semantic features including traversal control and pr
64. elements must be included in an Defining Named Types xsd annotation element They accept optional xm1 lang and source Groups Compositors and attributes The source attribute is a URI reference that can be used to indicate Derivation the purpose of the appinfo to the processing application Content Types Constraints The xsd annotation elements can be added at the beginning of most schema constructs as shown in example below The appinfo section demonstrates how custom namespaces and schemes might allow the binding of an element to a Java class from within the schema Building Usable and Reusable Schemas Namespaces lt xsd element name book gt W3C XML Schema and lt xsd annotation gt Instance Documents lt xsd documentation xml lang en gt W3C XML Schema Top level element Datatypes Reference lt xsd documentation gt W3C XML Schema xsd documentation xml lang fr i Structures Reference Element racine ees lt xsd documentation gt lt xsd appinfo source http example com foo gt lt bind xmlns http example com bar gt lt class name Book gt lt bind gt lt xsd appinfo gt lt xsd annotation gt Composing schemas from multiple files For those who want to define a schema using several XML documents either to split up a large schema or to use libraries of schema snippets W3C XML Schema provides two mechanisms for including external schemas The first xsd include
65. gt http www xml com pub a 98 10 guide2 html 4 di 10 10 05 2001 9 28 30 XML com What Do XML Documents Look Like Oct 03 1998 Attribute List Declarations Attribute list declarations Section 3 3 identify which elements may have attributes what attributes they may have what values the attributes may hold and what value is the default A typical attribute list declaration looks like this lt ATTLIST oldjoke name ID REQUIRED label CDATA IMPLIED status funny notfunny funny In this example the o1d joke element has three attributes name which is an ID and is required 1abe1 which is a string character data and is not required and status which must be either funny or not funny and defaults to funny if no value is specified Each attribute in a declaration has three parts a name a type and a default value You are free to select any name you wish subject to some slight restrictions Section 2 3 production 5 but names cannot be repeated on the same element There are six possible attribute types CDATA CDATA attributes are strings any text is allowed Don t confuse CDATA attributes with CDATA sections they are unrelated ID The value of an ID attribute must be a name Section 2 3 production 5 All of the ID values used in a document must be different IDs uniquely identify individual elements in a document Elements can have only a single
66. gt 24 VersionInfo 2 S version Eq VersionNum VersionNum EMEN ZE Fe 25 Eq pe p 2T ns 26 VersionNum a zA Z0 9_ 27 Misc z2 Comment PI S Definition The XML document type declaration contains or points to markup declarations that provide a grammar for a class of documents This grammar is known as a document type definition or DTD The document type declaration can point to an external subset a special kind of external entity containing markup declarations or can contain the markup declarations directly in an internal subset or can do both The DTD for a document consists of both subsets taken together Definition A markup declaration is an element type declaration an attribute list declaration an entity declaration or a notation declaration These declarations may be contained in whole or in part within parameter entities as described in the well formedness and validity constraints below For further information see 4 Physical Structures Document Type Definition http Awww w3 org TR REC xml 9 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition 28 doctypedecl DOCTYPE S Name S VC Root Element Type ExternalID S markupdecl DeclSep S gt WEC External Subset fft 28a DeclSep PEReference S WEC PE Between Declarations 29 markupdecl element
67. gt lt history xlink type locator xlink label period xlink href paris xml gt lt history xlink type locator xlink label period xlink href kisling xml gt lt environment gt Only one thing is missing We must specify how the resources relate to each other We do this by specifying arcs between them environment xmlns xlink http www w3 org 1999 xlink xlink type extended gt an artist is bound to his influences and history gt artist xlink type locator xlink role artist xlink href modigliani xml gt influence xlink type locator xlink label inspiration xlink href cezanne xml gt influence xlink type locator xlink label inspiration xlink href lautrec xml gt influence xlink type locator xlink label inspiration xlink hre rouault xml history xlink type locator xlink label period xlink href paris xml gt lt history xlink type locator xlink label period xlink href kisling xml gt bind xlink type arc xlink from artist xlink to inspiration gt bind xlink type arc xlink from artist xlink to period gt lt environment gt h w As you can see using XLink our problem is reduced to creating an XML file full of elements like the above where all the resources and their relationships are clearly and elegantly specified In this section we saw a small example of the use and syntax of XLink In t
68. has another two XLink based attributes besides xlink type The first one title is a semantic attribute used to give a short description of the resource The second one label is a traversal attribute used to identify the element later when we build arcs The third attribute role is used for describing a property of the resource An actress element may look like the following actress xlink label maria gt first name Brigitte first name lt surname gt Helm lt surname gt lt actress gt It is important to note also that the subelements of resource type elements here the first_name and surname elements have no significance for XLink see Table 2 As we mentioned before remote resources are pointed to by locators Here is the DTD for a locator type element lt ELEMENT movie EMP TY gt http www xml com pub a 2000 09 xlink index html page s3 2 di 5 10 05 2001 9 11 35 XML com What is XLink Sep 18 2000 lt ATTLIST movie xlink type locator FIXED locator xlink title CDATA IMPLIED xlink role CDATA IMPLIED xlink label NMTOKEN IMPLIED xlink href CDATA REQUIRED gt Locators can have the same attributes as resources i e title label and role plus a required href semantic attribute which points to the remote resource A locator movie element will look like the following movie xlink label metropolis xlink href metropolis xml gt Naviga
69. have an explicitly specified value on every occurrence of the element in the document IMPLIED The attribute value is not required and no default value is provided If a value is not specified the XML processor must proceed without one value An attribute can be given any legal value as a default The attribute value is not required on each element in the document and if it is not present it will appear to be the specified default F IXED value An attribute declaration may specify that an attribute has a fixed value In this case the attribute is not required but if it occurs it must have the specified value If it is not present it will appear to be the specified default One use for fixed attributes is to associate semantics with an element A complete discussion is beyond the scope of this article but you can find several examples of fixed attributes in the XLink specification The XML processer performs attribute value normalization Section 3 3 3 on attribute values character references are replaced by the referenced character entity references are resolved recursively and whitespace is normalized Entity Declarations Entity declarations Section 4 2 allow you to associate a name with some other fragment of content That construct can be a chunk of regular text a chunk of the document type declaration or a reference to an external file containing either text or binary data A few typical
70. in the DTD must consist of a series of complete markup declarations of the types allowed by the non terminal symbol markupdecl interspersed with white space or parameter entity references However portions of the contents of the external subset or of external parameter entities may conditionally be ignored by using the conditional section construct this is not allowed T y in the internal subset http Awww xml com axml testaxml htm 8 di 34 10 05 2001 9 26 16 The Annotated XML Specification 30 extSubset TextDecl extSubsetDecl T 31 extSubsetDecl markupdecl conditionalSect PEReference S The external subset and external parameter entities also differ from the internal subset in that in them parameter entity references are permitted within markup declarations not only between markup declarations An example of an XML document with a document type declaration The system identifier hello dtd gives the URI of a DTD for the document T The declarations can also be given locally T as in this example If both the external and internal subsets are used the internal subset is considered to occur before the external subset _ This has the effect that entity and attribute list declarations in the internal subset take precedence over those in T the external subset 2 9 Standalone Document Declaration Markup declarations can affect the content of the document as passed from an X
71. information is projected into a table orientation on the left canvas and a list orientation on the right canvas The one authored order is delivered in two different presentation orders Both results include titles from boilerplate text not found in the source The table information on the left includes calculations of the sums of quantities in the columns generated by the stylesheet and not present explicitly in the source The implicit stylesheet prod imp xslis an XHTML file utilizing the XSLT vocabulary for instructions to fill in the one result template by pulling data from the source http www xml com pub a 2000 08 holman s2_1 html page 2 3 di 7 10 05 2001 9 07 18 XML com Getting started with XSLT and XPath Aug 23 2000 lt xml sweet gums 1 s 0 9 2S lt 938691035 5 x8 1l gt lt XSLT 1 0 http www CraneSoftwrights com training gt html xmlns xsl http www w3 org 1999 XSL Transform Xs lik version B NO lt head gt lt title gt Product Sales Summary lt title gt lt head gt lt body gt lt h2 gt Product Sales Summary lt h2 gt lt table summary Product Sales Summary border 1 gt lt I ller jorocluers gt lt th align center gt lt xsl for each select product gt lt td gt lt b gt lt xsl value of select gt lt b gt lt td gt xsl for each th x cies olea xsl for each select sales record cust lt xsl variable mema cGuscomac seleet e V z
72. instance one might use multiple titles in different languages to provide localization features The contents of title type elements are not constrained by XLink Simple links Simple links are conceptually a subset of extended links They exist as a notation for links where you don t need the overhead of an entire extended link All the XLink related aspects of a simple link are encapsulated on one element i e XLink doesn t care about the subelements of a simple link The valid XLink attributes of a simple link are href just like in HTML s a or img title role arcrole show and actuate which keep the same semantics as when used in arc type elements The following shows a typical simple link element first a DTD declaration lt ELEMENT director PCDATA gt lt ATTLIST director xmlns xlink CDATA FIXED http www w3 0rg 1999 xlink xlink type simple FIXED simple xlink href CDATA IMPLIED xlink show new FIXED new http www xml com pub a 2000 09 xlink index html page 3 4 di 5 10 05 2001 9 11 35 XML com What is XLink Sep 18 2000 xlink actuate onRequest FIXED onRequest gt lt now a typical instance gt lt director xlink href fincher xml gt David Fincher lt director gt That s all there is to it We have covered all the types and attributes of XLink As you can see this is a powerful but compact specification that is
73. internal label however it apparently has to know what character encoding is in use which is what the internal label is trying to indicate In the general case this 1s a hopeless situation It is not entirely hopeless in XML however because XML limits the general case in two ways each http www w3 org TR REC xml 38 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition implementation is assumed to support only a finite set of character encodings and the XML encoding declaration is restricted in position and content in order to make it feasible to autodetect the character encoding in use in each entity in normal cases Also in many cases other sources of information are available in addition to the XML data stream itself Two cases may be distinguished depending on whether the XML entity is presented to the processor without or with any accompanying external information We consider the first case first F 1 Detection Without External Encoding Information Because each XML entity not accompanied by external encoding information and not in UTF 8 or UTF 16 encoding must begin with an XML encoding declaration in which the first characters must be lt xm1 any conforming processor can detect after two to four octets of input which of the following cases apply In reading this list it may help to know that in UCS 4 lt is x0000003C and is x0000003F and the Byte Order Mark required of UTF 16 dat
74. linking structures of the Web today are not enough for the growing needs of an XML world The official W3C solution for linking in XML is called XLink XML Linking Language This article explains its structure and use according to the most recent Candidate Recommendation July 3 2000 Overview Every developer is familiar with the linking capabilities of the Web today However as the use of XML grows we quickly realize that simple tags like A HREF elem_lessons html gt Freud lt A gt are not going to be enough for many of our needs Consider for example the problem of creating an XML based help system similar to ones used in some PC applications Among other things such as displaying amusingly animated characters the system might be capable of performing the following actions when a user clicks on a topic e Opening an explanatory text with a link back to the main index http www xml com pub a 2000 09 xlink index html 1 di 2 10 05 2001 9 10 45 O Register Now E 7 conferences oreilly com INNOVATE COLLABORATE DISCOVER XML com What is XLink Sep 18 2000 Style Matters XML Q amp A Transforming XML Perl and XML gt GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIONS THIS SITE IS ON THE e Opening a window and simulate the actions to be taken e g going to the
75. m e Name WFC Entity Declared VC Entity Declared WFC Parsed Entity WFC No Recursion Name VC Entity Declared WFC No Recursion WFC In DTD oe 69 PEReference Well formedness constraint Entity Declared In a document without any DTD a document with only an internal DTD subset which contains no parameter entity references or a document with standalone yes for an entity reference that does not occur within the external subset or a parameter entity the Name given in the entity reference must match that in an entity declaration that does not occur within the external subset or a parameter entity except that well formed documents need not declare any of the following entities amp 1t gt apos quot The declaration of a general entity must precede any reference to it which appears in a default value in an attribute list declaration Note that if entities are declared in the external subset or in external parameter entities a non validating processor is not obligated to read and process their declarations for such documents the rule that an entity must be declared is a well formedness constraint only if standalone yes Validity constraint Entity Declared y In a document with an external subset or external parameter entities with st andalone no the Name given in the entity reference must match that in an entity declaration For interoperability valid documents shou
76. margin adjusted for left edge hole punching or binding http www cranesoftwrights com training 2 di 5 10 05 2001 9 01 00 Crane Softwrights Ltd Training Programmes and Training Material e cut stacked refers to the act of cutting the pages in half after being printed and stacking the left stack on top of the right stack before binding e short edge duplex and long edge duplex refer to the orientation edge when printing double sided e a separate ZIP file with all XML and XSLT files used in the material can be downloaded separately See the Crane Course Schedule for more details of when these published materials are delivered face to face at conferences or host locations For each of the course or presentation publications available the overview pages from each module are collected above for free download and distribution to review the content of the publication To be informed of the availability of this material for purchase please send your request to publications CraneSoftwrights com 1 1 Introduction to XSLT Third Edition ISBN 1 894049 00 4 1999 06 08 This publication has been entirely replaced by Practical Transformation Using XSLT and XPath and is no longer available All customers of this and other editions have equal access to any replacement publication 1 2 Practical Transformation Using XSLT and XPath XSL Transformations and the XML Path Language Ninth Edition ISBN 1 894049 06 3 2001 01 19 Th
77. markup and physically entities such as files or other resources they are not the only means by which relationships are specified For example a quantum of information can arbitrarily point or refer to other information elsewhere through use of unique identifiers Two basic objectives of representing information hierarchically are satisfied by the XML Recommendation It provides e an unambiguous mechanism for constraining structure in a stream of information XML defines the concept of well formedness Well formedness dictates the syntax used for markup languages within the content of an instance of information This is the syntax of using angle brackets lt and and the ampersand amp to demarcate and identify constituent components of information within a file a resource or a bound data stream Users of the Hypertext Markup Language HTML will recognize the use of these characters for marking the vocabulary described by the designers of the World Wide Web in their web documents e alanguage for specifying how a system can constrain the allowed logical hierarchy of information structures XML defines the concept of validity with a syntax for a meta markup language used to specify vocabularies A Document Type Definition DTD describes the structural schema mandating the user defined constraints on well formed information The designers of HTML have formalized their vocabulary through such a DTD thus declaring the allow
78. may transform a source instance which is based on a particular vocabulary and deliver the results to a legacy application that expects a different vocabulary as input In other words we can use XSLT in a non rendering situation when it doesn t matter what syntax is utilized to represent the content when only the parsed result of the syntax is material An example of using such a legacy vocabulary for the XSLT processor would be 01 lt xsl template match customer 02 lt buyer gt lt xsl value of select db gt lt buyer gt 03 lt xsl template gt Example 1 11 Example XSLT template rule for a legacy vocabulary The transformation would then produce the following result acceptable to the legacy application 01 lt buyer gt cust123 lt buyer gt Example 1 12 Example legacy vocabulary for customer information The designers of XSLT have focused on the results of delivering parsed XML information to a rendering agent or to some other application employing an XML processor as the means to access information in an http www xml com pub a 2000 08 holman s1 html page 2 8 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 XML instance The information being delivered represents the parsed result of working with the entire XML instance and if supplied the XML document model The actual markup within the source XML instance is not considered material to the application All that counts is the result o
79. means to allow the possibility of automatic version recognition should it become necessary Processors may signal an error if they receive documents labeled with versions they do not support The function of the markup in an XML document is to describe its storage and logical structure and to associate attribute value pairs with its logical structures XML provides a mechanism the document type declaration j to define constraints on the logical structure and to support the use of predefined storage units Definition An XML document is valid if it has an associated document type declaration T and if the document complies with the constraints expressed in it T The document type declaration must appear before the first element in the document Prolog http www xml com axml testaxml htm 7 di 34 10 05 2001 9 26 15 The Annotated XML Specification Definition The XML document type declaration contains or points to markup declarations that provide a grammar for a class of documents This grammar is known as a document type definition U or DTD The document type declaration can point to an external subset a special kind of external entity T containing markup declarations or can contain the markup declarations directly in an internal subset or can do both The DTD for a document consists of both subsets taken together Definition A markup declaration is an element type declaration an attribute list declaratio
80. of respectively standalone and browser based XSLT XPath implementations without prejudice to other conforming implementations The code samples only use syntax conforming to XSLT 1 0 and XPath 1 0 recommendations O REILLY xn http www xml com pub a 2000 08 holman s2_1 html page 1 1 di 6 10 05 2001 9 06 36 FIND gt Search Article Archive FAQs Add the latest news from XML com to I your web site Click here D COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker XML Testbed SEYBOLD PUBLICATIONS XML com Getting started with XSLT and XPath Aug 23 2000 and will work with any conformant XSLT processor 2 2 3 Stylesheet requirements ons and literal Note The current 4 14 2000 Internet Explorer 5 production release supports only an archaic experimental dialect of XSLT based on an early working draft of the recommendation The examples in this book will not run on the production release of IES The production implementation of the old dialect is described in http msdn microsoft com xml XSLGuide conformance asp 2 1 1 Some simple examples Consider the following XML file he11o xml obtained from the XML 1 0 Recommendation and modified to declare an associated stylesheet 01 lt xml version
81. of entities use different forms of reference and are recognized in different contexts Furthermore they occupy different namespaces a parameter entity and a general entity with the same name are two distinct entities 4 1 Character and Entity References Definition A character reference refers to a specific character in the ISO IEC 10646 character set for example one not directly accessible from available input devices Character Reference 66 CharRef amp 0 9 amp x 0 9a fA F WEC Legal Character http Awww w3 org TR REC xml 22 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition Well formedness constraint Legal Character Characters referred to using character references must match the production for Char If the character reference begins with amp x the digits and letters up to the terminating provide a hexadecimal representation of the character s code point in ISO IEC 10646 If it begins just with amp the digits up to the terminating provide a decimal representation of the character s code point Definition An entity reference refers to the content of a named entity Definition References to parsed general entities use ampersand amp and semicolon as delimiters Definition Parameter entity references use percent sign and semicolon as delimiters Entity Reference 67 Reference EntityRef CharRef 68 EntityRef
82. of the conditional section is IGNORE then the contents of the conditional section are not logically part of the DTD Note that for reliable parsing the contents of even ignored conditional sections must be read in order to detect nested conditional sections and ensure that the end of the outermost ignored conditional section is properly detected If a conditional section with a keyword of INCLUDE occurs within a larger conditional section with a keyword of IGNORE both the outer and the inner conditional sections are ignored If the keyword of the conditional section is a parameter entity reference the parameter entity must be replaced by its content before the processor decides whether to include or ignore the conditional section T An example http www xml com axml testaxml htm 17 di 34 10 05 2001 9 26 16 The Annotated XML Specification Se 4 Physical Structures Definition An XML document may consist of one or many storage units These are called entities they all have content and are all except for the document entity see below and the external DTD subset identified by name Each XML document has one entity called the document entity which serves as the starting point for the XML processor and may contain the whole document T Entities may be either parsed or unparsed J Definition A parsed entity s contents are referred to as its replacement text this text is considered an integral part of
83. omitting the definition of a child element The following See 3 eContent Types construct defines an empty book element accepting an isbn attribute Coie Constraints Building bl d lt xsd element name book gt uilding Usable an lt xsd complexType gt Reusable Schemas Products xsd attribute name isbn type isbnType gt Namespaces xsd complexType W3C XML Schema and xsd element Instance Documents Tools Simple content elements i e character data elements with attributes can be derived ONG AME Sen rary from simple types using xsd simpleContent The book element defined above Datatypes Reference Training W3C XML Schema can thus be extended to accept a text value using Structures Reference lt xsd element name book gt lt xsd complexType gt lt xsd simpleContent gt lt xsd extension base xsd string gt lt xsd attribute name isbn type isbnType gt lt xsd extension gt lt xsd simpleContent gt lt xsd complexType gt lt xsd element gt Note the location of the attribute definition showing that the extension is achieved through the addition of the attribute This definition will accept the following XML element lt book isbn 0836217462 gt Funny book by Charles M Schulz Its title Being a Dog Is a Full Time Job says it all lt book gt W3C XML Schema supports mixed content though the mixed attribute in the xsd complexType element Consider lt xsd element name
84. on well formed information The designers of HTML have formalized their vocabulary through such a DTD thus declaring the allowed or expected relationships between components of a hypertext document There is an implicit document model for an instance of well formed http www xml com pub a 2000 08 holman s1 html page 1 3 di 8 10 05 2001 9 02 26 XML com What is XSLT I Aug 16 2000 XML defined by the mere presence of nested elements found in the information There is no need to declare this model because the syntax rules governing well formedness guarantee the information to be seen properly as a hierarchy As with all hierarchies there are family tree like relationships of parent child and sibling constructs relative to each construct found Consider the following well formed XML instance purc xml swa wersiom 1 0 2x lt purchase id p001 gt lt customer db cust123 gt lt product db prod345 gt lt amount gt 23 45 lt amount gt lt product gt lt purchase gt Example 1 1 A well formed XML purchase order instance Observe the content nesting whitespace has been added only for illustrative purposes The instance follows the lexical rules for XML markup and the hierarchical model is implicit by the nesting of elements Pay particular attention to the markup on line 3 for the empty element named customer with the attribute named db It will be used later in examples throughout this chapter
85. parameter entity references are permitted within markup declarations not only between markup declarations An example of an XML document with a document type declaration The system identifier hello dtd gives the address a URI reference of a DTD for the document The declarations can also be given locally as in this example If both the external and internal subsets are used the internal subset is considered to occur before the external subset This has the effect that entity and attribute list declarations in the internal subset take precedence over those in the external subset 2 9 Standalone Document Declaration Markup declarations can affect the content of the document as passed from an XML processor to an application examples are attribute defaults and entity declarations The standalone document declaration which may appear as a component of the XML declaration signals whether or not there are such declarations which appear external to the document entity or in parameter entities Definition An external markup declaration is defined as a markup declaration occurring in the external subset or in a parameter entity external or internal the latter being included because non validating processors are not required to read them Standalone Document Declaration 32 SDDecl S standalone Eq yes VC Standalone Document no EL ES yes not Declaration Dat In a standalone document decl
86. quot 2 5 Comments Definition Comments may appear anywhere in a document outside other markup T in addition they may appear within the document type declaration at places allowed by the grammar They are not part of the document s character data an XML processor may but need not make it possible for an application to retrieve the text of comments T For compatibility the string double hyphen must not occur within comments An example T of a comment ea a 2 6 Processing Instructions Definition Processing instructions PIs allow documents to contain instructions for applications T http Awww xml com axml testaxml htm 6 di 34 10 05 2001 9 26 15 The Annotated XML Specification 16 i p Prtarcict S ee Cham 7 UC ESO UD 17 PITarget QP Vze j QUIM aav Come L T PIs are not part of the document s character data but must be passed through to the application The PI begins with a target PITarget used to identify the application to which the instruction is directed The target names XML xml and so on are reserved for standardization in this or future versions of this specification The XML Notation mechanism may be used for formal declaration of PI targets 2 7 CDATA Sections Definition CDATA sections may occur anywhere character data may occur they are used to escape blocks of text containing characters which would otherwise be recognized as markup T CDATA
87. resources e One or more locators to identify the remote resources participating in the link a locator is required for each remote resource e Semantics of the link e Semantics of the remote resources e Semantics of the local resource if the link is inline This information is supplied in the form of attributes on linking elements In the following sections parameter entities are used to group these attributes 4 1 1 Locators A locator string identifies a participating resource A link must supply a locator for each remote resource A locator takes the form of an attribute called href Following is a sample declaration of this attribute enclosed ina locator att parameter entity 4 1 2 Link Semantics The following semantic information can be provided for a link e Whether the link is inline If the link is inline its content counts as a local resource of the link However any locator subelements inside the linking element are not considered part of the local resource they are simply part of the linking element machinery If the link is out of line its content does not count as a local resource Every link is either inline or out of line The inline status of a link is indicated with an attribute called inline It can have the value t rue the default or false e The role of the link to identify to application software the meaning of the link Links express various kinds of conceptual relationships between the data obje
88. source documents for validity can be very useful for diagnostic purposes all of the hierarchical relationships of content are based on what is found inside of the instance not what is found in the document model The behavior of the stylesheet is specified against the presence of markup in an instance as the implicit model not against the allowed markup prescribed by any explicit model Because of this an XSLT stylesheet is independent of any Document Type Definition DTD or other explicit schema that may have been used to constrain the instance at other stages This is very handy when working with well formed XML that doesn t have an explicit document model If an explicit document model is supplied certain information such as attribute types and defaulted values enhance the processor s knowledge of the information found in the input documents Without this information the processor can still perform stylesheet processing as long as the absence of the information does not influence the desired results Without a reliance on the document model for the instance we can design a single stylesheet that can process instances of different models When the models are very similar much of the stylesheet operates the same way each time and the rest of the stylesheet only processes that which it finds in the sources It may be obvious but should be stated for completeness that a given source file can be processed with multiple stylesheets for different pu
89. source hierarchy using parent child relationships The XSLT processor s initial focus is the root of the document which is considered the parent of the document element Our XPath expression value greeting selects the child named greeting from the current focus thus returning the value of the document element named greeting from the instance Using an MS DOS command line invocation to execute the standalone processor we see the following result X Nsamp xt hello xml hellohtm xsl hellohtm htm X samp gt type hellohtm htm html head lt title gt Greeting lt title gt lt head gt lt body gt lt p gt Words of greeting lt br gt lt b gt lt i gt lt u gt Hello world lt u gt lt i gt lt b gt lt p gt lt body gt lt html gt X samp gt Example 2 3 Explicit invocation of Example 2 2 Note how the end result contains a mixture of the stylesheet markup and the source instance content without any use of the XSLT vocabulary The processor has recognized the use of HTML by the name of the document element and has engaged SGML lexical conventions The SGML lexical conventions are evidenced on line 8 where the lt br gt empty element has been serialized without the XML lexical convention for the closing delimiter This corresponds to line 6 of our stylesheet in Example 2 2 where this element is marked up as lt br gt according to XML rules Our inputs are always XML but the XSLT processor may
90. stylesheet gt e LINK REL alternate stylesheet gt 1 1 7 2 Ancillary markup A processing instruction is ancillary to the XML document model constraining the creation and validation of an instance Therefore we do not have to model the presence of this construct when we design our document model Any instance can have any number of stylesheet associations added into the document during or after creation or even removed without impacting on the XML content itself http www xml com pub a 2000 08 holman s1 html page 2 17 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 An application respecting this construct will process the document content with the stylesheet before delivering the content to the application logic Two cases of this are the use of a stylesheet for rendering to a browser canvas and the use of a transformation script at the front end of an e commerce application The following two examples illustrate stylesheet associations that respectively reference an XSL resource and a Cascading Stylesheet CSS resource 01 lt xml stylesheet href fancy xsl type text xsl Example I 13 Associating an XSL stylesheet 01 lt xml stylesheet href normal css type text css gt Example 1 14 Associating a CSS stylesheet The following example naming the association for later reference and indicating that it is not the primary stylesheet resource is less typical but is allo
91. suited to Boake and papers abont computer hardware and software though it is by no means limited to these applications What s New 12 March 2001 Published updated RELAX TREX Schemas Published D Published Math 23 February 2001 Published minutes from the 23 February 2001 TC meeting 01 February 2001 DocBook 4 becomes an Official OASIS cation The DocBook 4 1 Specification includes both the DocBook V4 1 DTD and the DocBook XML V4 1 2 DTD 12 January 2001 Published experimental RE and TRE pchetnas for DocBook V4 7 2 Updated itis version 10 January 2001 Published minutes from the 07 December TC meeting Made small updates to the XML Schema version of DocBook and moved it to the OASIS site Feedback http Awww oasis open org docbook 1 di 2 10 05 2001 9 29 48 OASIS http www oasis open org docbook 2 di 2 10 05 2001 9 29 48 XML Linking Language XLink Ws WD xlink 19980303 XML Linking Language XLink World Wide Web Consortium Working Draft 3 March 1998 This version http www w3 org TR 1998 WD xlink 19980303 Previous version http www w3 org TR WD xml link 970731 Latest version http www w3 org TR WD xlink Editors Eve Maler ArborText elm arbortext com gt Steve DeRose Inso Corp and Brown University sderose eps inso com gt Status of this document This is a W3C Working Draft for review by W3C members and other interested parties It is
92. the information captures an invoice related transaction between computers or the content of a user manual rendered on paper Sponsored By XML Path Language XPath XPath is a string syntax for building addresses to the information found in an XML document We use this language to specify the locations of document structures or data found in an XML document when processing that information using XSLT XPath allows us from any location to address any other location or content Extensible Stylesheet Language Family XSLT XSL Two vocabularies specified in separate W3C Recommendations provide for the two distinct styling processes of transforming and rendering XML instances We can transform information using one vocabulary into an alternate form by using the Extensible Stylesheet Language Transformations XSLT The Extensible Stylesheet Language XSL is a rendering vocabulary describing the semantics of formatting information for different media Namespaces We use XML namespaces to distinguish information when mixing multiple vocabularies in a single instance Without namespaces our processes would find the information ambiguous when identical names have been chosen by the designers of the vocabularies we use Stylesheet Association We declare our choice of an associated stylesheet for an XML instance by embedding the construct described in the Stylesheet Association Recommendation Recipients and applications can choose
93. the grammar content particles occurring in a sequence list must each appear in the element content in the order given in the list The optional character following a name or list governs whether the element or the content particles in the list may occur one or more zero or more or zero or one times The absence of such an operator means that the element or content particle must appear exactly once This syntax and meaning are identical to those used in the productions in this specification The content of an element matches a content model if and only if it is possible to trace out a path through the content model obeying the sequence choice and repetition operators and matching each element in the content against an element type in the content model For compatibility it is an error if an element in the document can match more than one occurrence of an element type in the content model For more information see E Deterministic Content Models Validity constraint Proper Group PE Nesting Parameter entity replacement text must be properly nested with parenthesized groups That is to say if either of the opening or closing parentheses in a choice seq or Mixed construct is contained in the replacement text for a parameter entity both must be contained in the same replacement text For interoperability if a parameter entity reference appears in a choice seq or Mixed construct its replacement text should contain at
94. the node expression in the select attribute The writer can choose any relative absolute or arbitrary location or locations to be visited Each node visited is pushed through the stylesheet to be caught by template rules Template rules specify the template to be processed and added to the result tree The template added is dictated by the template rule matched for the node being pushed not by a template supplied by the instruction when a node is being pulled This distinguishes the behavior as being a data driven approach to creating the result in that the source determines the ultimate order of the result http www xml com pub a 2000 08 holman s2 1 html page 3 7 di 8 10 05 2001 9 08 04 XML com Getting started with XSLT and XPath Aug 23 2000 An implicitly declared stylesheet can only push information through built in template rules which is of limited value As well the built in rules can be mimicked entirely by using pull constructs thus they need never be used There is no room in the stylesheet to declare template rules in an implicitly declared stylesheet since there is no wrapper stylesheet instruction An explicitly declared stylesheet can either push or pull information because there is room in the stylesheet to define the top level elements including any number of template rules required for the transformation Putting it all together We are not obliged to use only one approach when we write our stylesheets It is ve
95. the same template we were discussing earlier a set of result tree nodes and an instruction The XSLT processor begins processing by visiting the root of the document This gives control to the stylesheet writer Either the supplied template rule or built in template rule for the root of the document is processed based on what the writer has declared in the stylesheet The writer is in complete control at this early stage and all XSLT processor behavior is dictated what the writer asks to be calculated and where the writer asks the XSLT processor to Visit 2 2 6 Approaches to stylesheet design The last discussion in this two chapter introduction regards how to approach using templates and instructions when writing a stylesheet Two distinct approaches can be characterized Choosing which approach to use when depends on your own preferences the nature of the source information and the nature of the desired result Note I refer to these two approaches as either stylesheet driven or data driven though the former might be misconstrued Of course all results are stylesheet driven because the stylesheet dictates what to do so the use of the term involves some nuance By stylesheet driven I mean that the order of the result is a result of the stylesheet tree having explicitly instructed the adding of information to the result tree By data driven I mean that the order of the result is a result of the source tree ordering having dictated the adding of
96. to our needs 1 1 2 2 Addressing identifies a hierarchical position or positions XPath defines common semantics and syntax for addressing XML expressed information and bases these primarily on the hierarchical position of components in the tree This ordering is referred to as document order in XPath while in other contexts this 1s often termed either parse order or depth first order Alternatively we can access an arbitrary location in the tree based on points in the tree having unique identifiers We convey XPath addresses in a simple and compact non XML syntax This allows us to use an XPath expression as the value of an attribute in an XML vocabulary as in the following examples http www xml com pub a 2000 08 holman s1 html 6 di 8 10 05 2001 9 01 41 XML com What is XSLT I Aug 16 2000 01 select answer Example 1 3 A simple XPath expression in a select attribute The above attribute value expresses all children named answer of the current focus element 01 match question answer Example 1 4 An XPath expression in a mat ch attribute The above attribute value expresses a test of an element being in the union of the element types named question and answer The XPath syntax looks a lot like addressing subdirectories in a file system or as part of a Universal Resource Identifier URI Multiple steps in a location path are separated by either one or two oblique characters Filters can be sp
97. to respect or ignore this choice but the declaration indicates that we have tied some http www xml com pub a 2000 08 holman s1 html 2 di 8 10 05 2001 9 01 41 XML com What is XSLT I Aug 16 2000 process typically rendering to our data which specifies how to consume or work with our information 1 1 The XML family of Recommendations Now let s look at the objectives of these selected Recommendations 1 1 1 Extensible Markup Language XML Historically the ways we have expressed created stored and transmitted our electronic information have been constrained and controlled by the vendors we choose and the applications we run Alternatively we now can express our data in a structured fashion oriented around our perspective of the nature of the information itself rather than the nature of an application s choice of how to represent our information With Extensible Markup Language XML we describe our information using embedded markup of elements attributes and other constructs in a tree like structure e http www w3 org TR REC xml 1 1 1 1 Structuring information Contrasted to a file format where information identification relies on some proprietary hidden format predetermined ordering or some kind of explicit labeling the tree like hierarchical storage structure infers relationships by the scope of values encompassing the scopes of other values Though trees shape a number of areas of XML both logically
98. unaltered XML version of the spec The footnoted HTML version that you see on the screen is program generated The annotations are flagged as follows H Historical or cultural commentary some entertainment value Technical explanations including amplifications corrections and answers to Frequently Asked Questions Advice on how to use this specification im Examples to illustrate what the spec is saying M Annotations that it s hard to find a category for Copyright 1998 Tim Bray All rights reserved The Annotated XML Specification 2 5 Comments 2 6 Processing Instructions 2 7 CDATA Sections 2 8 Prolog and Document Type Declaration 2 9 Standalone Document Declaration 2 10 White Space Handling 2 11 End of Line Handling 2 12 Language Identification 3 Logical Structures 3 1 Start Tags End Tags and Empty Element Tags 3 2 Element Type Declarations 3 2 1 Element Content 3 2 2 Mixed Content 3 3 Attribute List Declarations 3 3 1 Attribute Types 3 3 2 Attribute Defaults 3 3 3 Attribute Value Normalization 3 4 Conditional Sections 4 Physical Structures 4 Character and Entity References 4 2 Entity Declarations 4 2 1 Internal Entities 4 2 2 External Entities 4 3 Parsed Entities 4 3 1 The Text Declaration 4 3 2 Well Formed Parsed Entities 4 3 3 Character Encoding in Entities 4 4 XML Processor Treatment of Entities and References 4 4 1 Not Recognized 4 4 2 Included 4 4 3 Included If Validati
99. valid and so is this The version number 1 0 should be used to indicate conformance to this version of this specification it is an error for a document to use the value 1 0 if it does not conform to this version of this specification It is the intent of the XML working group to give later versions of this specification numbers other than 1 0 but this intent does not indicate a commitment to produce any future versions of XML nor if any are produced to use any particular numbering scheme Since future versions are not ruled out this construct is provided as a means to allow the possibility of automatic version recognition should it become necessary Processors may signal an error if they receive documents labeled with versions they do not support The function of the markup in an XML document is to describe its storage and logical structure and to associate attribute value pairs with its logical structures XML provides a mechanism the document type declaration to define constraints on the logical structure and to support the use of predefined storage units Definition An XML document is valid if it has an associated document type declaration and if the document complies with the constraints expressed in it The document type declaration must appear before the first element in the document Prolog 22 prolog 23 XMLDecl XMLDecl Misc doctypedecl Misc xml VersionInfo EncodingDecl SDDecl S
100. want to look things up includes all the things a library uses plus all the things the video store uses plus all the things the Yellow Pages use and lots more The problem at the moment is that there is hardly any metadata on the Web So how do we find things Mostly by using dumb brute force techniques The dumb brute force is supplied by the wandering web robots of search engine sites like Altavista Infoseek and Excite These sites do the equivalent of going through the library reading every book and allowing us to look things up based on the words in the text It s not surprising that people complain about search results or that the robots are always way behind the growth and change of the Web In fact there is one metadata based general purpose lookup facility Yahoo Yahoo doesn t use a robot When you search through Yahoo you re searching through human generated subject categories and site labels Compared to the amount of metadata that a library maintains for its books Yahoo is pitiful but its popularity is clear evidence of the power of even limited metadata Pages 1 2 3 Next Page gt THA TE www thawte com http www xml com pub a 2001 01 24 rdf html page 1 3 di 3 10 05 2001 9 14 28 XML com Using W3C XML Schema Nov 29 2000 O REILLY o xml from the inside out XML COM O REILLY NETWORK ONJAVA COM O REILLY July 23 27 San Diego conferences o OPEN SOURC CONVENTION OR
101. which family of encodings is in use Since in practice all widely used character encodings fall into one of the categories above the XML encoding declaration allows reasonably reliable in band labeling of character encodings even when external sources of information at the operating system or transport protocol level are unreliable Character encodings such as UTF 7 that make overloaded usage of ASCII valued bytes may fail to be reliably detected Once the processor has detected the character encoding in use it can act appropriately whether by invoking a separate input routine for each case or by calling the proper conversion function on each character of input Like any self labeling system the XML encoding declaration will not work if any software changes the entity s character set or encoding without updating the encoding declaration Implementors of character encoding routines should be careful to ensure the accuracy of the internal and external information used to label the entity F 2 Priorities in the Presence of External Encoding Information The second possible case occurs when the XML entity is accompanied by encoding information as in some file systems and some network protocols When multiple sources of information are available their relative priority and the preferred method of handling conflict should be specified as part of the higher level protocol used to deliver XML In particular please refer to IETF RFC 2376 or its succes
102. whitespace characters are significant The special attribute xml space may be used to indicate explicitly that white space is significant On any element which includes the attribute specification xml space preserve all white space within that element and within subelements that do not explicitly reset xml space is significant The only legal values for xm1 space are preserve and default The value default indicates that the default processing is desired In a DTD the xml space attribute must be declared as an enumerated type with only http www xml com pub a 98 10 guide2 html 9 di 10 10 05 2001 9 28 30 XML com What Do XML Documents Look Like Oct 03 1998 those two values One last note about white space in parsed text XML processors are required to normalize all end of line markers to a single line feed character amp A Section 2 11 This is rarely of interest to document authors but it does eliminate a number of cross platform portability issues Attribute Value Normalization The XML processer performs attribute value normalization Section 3 3 3 on attribute values character references are replaced by the referenced character entity references are resolved recursively and whitespace is normalized Language Identification Many document processing applications can benefit from information about the natural language in which a document is written XML defines the attribute xm1 Lang
103. within the growing family of Recommendations related to the Extensible Markup Language XML Later we will look at detailed examples but first let s focus on XSLT and XPath in the context of a few of the Recommendations in the XML family and examine how these two Recommendations work together to address separate and distinct functionality required when working with structured information technologies This chapter does not attempt to address all of the numerous XML related Recommendations currently released or in development Specifically we will be looking at only the following as they relate to XSLT and XPath Extensible Markup Language XML For years applications and The context of XSL Transformations and the XML Path This Article Language 1 The XML family of Recommendations 1 1 1 Extensible Markup Language XML 1 1 2 XML Path Language XPath 1 1 3 Styling structured information 1 1 4 Extensible Stylesheet Language XSL 1 1 5 Extensible Stylesheet Language Transformations XSLT 1 1 6 Namespaces 1 1 7 Stylesheet association 1 2 Transformation data flows 1 2 1 Transformation from XML to XML 1 2 2 Transformation from XML to XSL formatting semantics 1 2 3 Transformation from XML to non XML http www xml com pub a 2000 08 holman s1 html page 1 1 di 8 10 05 2001 9 02 26 XML Products Tools Training Sp
104. x0B57 xOBC6 x0BC8 xOC4A x0C4D xOCBE x0CC4 xOCD5 x0CD6 x0D46 4x0D48 x0E34 4x0E3A xOF18 x0F19 xOF3F xOF 90 x0F95 xOFB9 1x3099 xO6FO0 x06F9 4x0A66 4x0A6F 4xOBE7 4xOBEF 4x0D66 4xOD6F x0F20 4x0F29 x0640 x0E46 x309D x309E Extensible Markup Language XML 1 0 Second Edition The character classes defined here can be derived from the Unicode 2 0 character database as follows e Name start characters must have one of the categories LI Lu Lo Lt NI e Name characters other than Name start characters must have one of the categories Mc Me Mn Lm or Nd e Characters in the compatibility area i e with character code greater than xF900 and less than xFFFE are not allowed in XML names e Characters which have a font or compatibility decomposition i e those with a compatibility formatting tag in field 5 of the database marked by field 5 beginning with a are not allowed e The following characters are treated as name start characters rather than name characters because the property file classifies them as Alphabetic x02BB x02C1 x0559 x06E5 x06E6 e Characters x20DD x20E0 are excluded in accordance with Unicode 2 0 section 5 14 e Character x00B7 is classified as an extender because the property list so identifies it e Character x0387 is added as a name character because x00B7 is its canonical equivalent e Cha
105. xsl for each select XPath node set expression gt instruction defines a template to be processed for each instance possibly repeated of the selected locations This template can contain literal result elements or any instruction to be executed When processing the given template the focus of the processor s view of the source tree shifts to the location being visited thus providing for relative addressing while moving through the information These instructions give the writer control over the order of information in the result The data is being pulled from the source on demand and added to the result tree in the stylesheet determined order When collections of nodes are iterated the nodes are visited in document order This implements a stylesheet driven approach to creating the result An implicitly declared stylesheet is obliged to use only these pull instructions and must dictate the order of the result with the above instructions in the lone template 2 2 6 2 Pushing the input data The stylesheet writer may not know the order of the data found in the source tree or may want to have the source tree dictate the ordering of content of the result tree In these situations the writer instructs the XSLT processor to visit source tree nodes and to apply to the result the templates associated with the nodes that are visited The xsl apply templates select XPath node expression instruction visits the source tree nodes described by
106. 01 9 29 13 Extensible Markup Language XML 1 0 Second Edition more characters XN where N is a hexadecimal integer the expression matches the character in ISO IEC 10646 whose canonical UCS 4 code value when interpreted as an unsigned binary number has the value indicated The number of leading zeros in the xN form is insignificant the number of leading zeros in the corresponding code value is governed by the character encoding in use and is not significant for XML a zA Z xN xN matches any Char with a value in the range s indicated inclusive abc xN xN XN matches any Char with a value among the characters enumerated Enumerations and ranges can be mixed in one set of brackets a z fxN 4xN matches any Char with a value outside the range indicated abc xN XN XN matches any Char with a value not among the characters given Enumerations and ranges of forbidden values can be mixed in one set of brackets string matches a literal string matching that given inside the double quotes string matches a literal string matching that given inside the single quotes These symbols may be combined to match more complex patterns as follows where A and B represent simple expressions expression expression is treated as a unit and may be combined as described in this list A matches A or nothing optional A A B matches A followed by B This operator has higher precedence than alternation th
107. 09DD x09DF x09E1 x09F0 x09F1 Uh x0A05 4 x0A0A xOAOF x0A10 x0A13 x0A28 xOA2A x0A30 XO0A32 x0A33 x0A35 4x0A36 x0A38 4x0A39 x0A59 x0A5C x0A5E x0A72 x0A74 J x0A85 4x0A8B x0A8D xOA8F x0A91 x0A93 4x0AA8 x0AAA x0AB0 x0AB2 x0AB3 x0AB5 x0AB9 x0ABD x0AEO Ui x0B05 x0B0C xOBOF 4x0B10 x0B13 x0B28 x0B2A 4 x0B30 x0B32 4x0B33 1x0B36 4x0B39 x0B3D x0B5C 4x0B5D xOBSF x0B61 Ui x0B85 4x0B8A xOB8E x0B90 x0B92 x0B95 x0B99 x0B9A xOB9C dSxOB9E 4x0B9F xOBA3 x0BA4 xOBA8 x0BAA xOBAE 4x0BB5 xO0BB7 x0BB9 i Ui x0CO5 x0COC xOCOE x0C10 xO0CI2 x0C28 xOC2A x0C33 OCIS HAC SS xO0C60 x0C61 Ui x0C85 4x0C8C xO0C8E x0C90 xO0C92 x0CA8 xOCAA x0CB3 xOCB5 4x0CB9 xOCDE x0CE0 x0CE1 x0D05 x0D0C xODOE x0D10 x0D12 x0D28 Tx0D2A x0D39 x0D60 x0D61 J x0E01 x0E2E Fx0E30 X0E32 X0E33 http www xml com axml testaxml htm 28 di 34 10 05 2001 9 26 16 The Annotated XML Specification x0 x0 xOE x0 FxOE x0 x0 x0 xOE dx dix x0I dx x0I x0 4 El EA ee E40 E81 84 E87 1 8A E94 1 E99 EA1 A5 EAA EAD BO EB2 BD ECO 4 XO x0 x0 dx x0 x0 x0 x x01 01 E88 OE mr EOF EA3 EA7 EAB xOE AE x0 EB3 x0 E45 E82 ECA xO0F40 4 x0F49 1 x0OF47 xOF69 il dx 1
108. 0A0 1 10D0 1 L100 1102 4 x10C5 x10F6 l SALAS 1105 4 1109 110B 4 110E 4 LLC BET 14 1154 4 159 115F 4 163 167 116D 4 1172 4 175 1A8 11AE 4 11B7 4 1BA 11BC 4 F igi se ze Eie exe X113E X1 X1 Solel xiI x1165 X1 xi EMT x1 X1 sell il x11 x1 LO7 LOC eZ L14C LES 55 L61 LL69 6E T3 19E I L1AB AR LB8 Lez x xl L1FO EIB x HDS Ii xX3041 x30A1 4 2105 H xAC00 ee LIS 4x2182 XEM KTD x1F45 x1F4D KIRS x1F5B UE TID x1lFB4 sc ILin Ee xIFCA LIEGE xLEDS x1FDB lime xlFF4 KEEN x3094 x30FA KILE xD7A3 U http www xml com axml testaxml htm 29 di 34 10 05 2001 9 26 16 The Annotated XML Specification 86 Ideographic x4E00 x9FA5 x3007 x3021 x3029 U 87 CombiningChar x0300 x0345 4 x0360 x0361 lJ x0483 x0486 x0591 x05A1 xX05A3 x05B9 x05BB x05BD x05BF x05C1 x05C2 xO5C4 Ui x064B 4x0652 x0670 x06D6 4x06DC x06DD 4x06DF d x06E0 4x06EA x06E7 4x06E8 x0 6EA x06ED Ui x0901 4x0903 x093C xX093E x094C x094D x0951 x0954 x0962 x0963 Ui xX0981 x0983 x09BC 0 9BI FxO9BF x09CO x09C4 x09C7 x09C8 x09CB x09CD BE x09D7 x09E2 x09E3 x0A02 x0A3C XOA3E 4x
109. 0AS3F x0A40 4x0A42 x0A47 x0A48 xO0A4B x0A4D xOA70 x0A71 Ui x0A81 x0A83 xOABC xOABE x0AC5 xO0AC7 x0AC9 xOACB x0ACD Uh x0B01 4x0B03 ESDIESSG x0B3E 4x0B43 x0B47 x0B48 x0BAB 4x0BAD x0B56 x0B57 J x0B82 4x0B83 xOBBE x0BC2 x0BC6 4x0BC8 xOBCA 4x0BCD FxOBD7 x0C01 4x0C03 xOC3E x0C44 x0C46 4x0C48 xOC4A x0C4D x0C55 x0C56 UU x0C8i2 gt x0CS3 xXOCBE x0CC4 x0CC6 4x0CC8 xOCCA x0CCD x0CD5 x0CD6 Ui x0D02 4x0D03 xXOD3E x0D43 x0D46 x0D48 x0D4A x0D4D xOD57 J x0E31 http www xml com axml testaxml htm 30 di 34 10 05 2001 9 26 16 The Annotated XML Specification 88 89 XOE34 x0E3A xX0E47 x0E4E Ui x0EB1 x0EB4 x0EB9 x0EBB x0EBC x0EC8 x0ECD j x0F18 x0F19 xOF35 x0F37 xOF39 xO0F3E xOF3F XOF71 x0F84 xXOF86 xX0F8B x0F90 x0F95 OTOT x0F99 x0FAD x0FB1 x0FB7 xOFB9U x20D0 x20DC x20El Lp x302A x302F U x3099 x309AU Digit 4x0030 4x0039 x0660 4x0669 J x06F0 x06F9 X0966 X096F x0 9E6 x0 9EF x0A66 x0A6F x0AE6 X0AEF x0B66 x0B6F X0BE7 X0BEF x0C66 xX0C6F XOCE6 XOCEF x0D66 x0D6F Extender xX309D x309E X30FC xX30FE The character classes defined here can be derived from the Unicode character da
110. 2000 08 holman s2_1 html page 3 5 di 8 10 05 2001 9 08 04 XML com Getting started with XSLT and XPath Aug 23 2000 The criteria for adding a written template rule s template to the result tree are specified in a number of attributes one of which must be the mat ch attribute This attribute is an XPath pattern expression which is a subset of XPath expressions in general The pattern expression describes preconditions of source tree nodes The stylesheet writer is responsible for writing the preconditions and other attribute values in such a way as to unambiguously provide a single written or built in template for each of the anticipated source tree conditions In an implicitly declared stylesheet the entire file is considered the template for the template rule for the root of the document This template rule overrides the built in rule implicitly available in the XSLT processor Back to the simple example in our explicitly declared stylesheet used earlier in this chapter the following template rule is declared 01 lt xsl template match gt 02 lt b gt lt i gt lt u gt lt xsl value of select greeting gt lt u gt lt i gt lt b gt 03 lt xsl template gt Example 2 11 Simple template rule in Example 2 4 This template rule defines the template to be added to the result tree when the root of the document is visited This written rule overrides the built in rule implicitly available in the XSLT processor The template is
111. 3 2000 Overview Every developer is familiar with the linking capabilities of the Web today However as the use of XML grows we quickly realize that simple tags like A HREF elem_lessons html gt Freud lt A gt are not going to be enough for many of our needs Consider for example the problem of creating an XML based help system similar to ones used in some PC applications Among other things such as displaying amusingly animated characters the system might be capable of performing the following actions when a user clicks on a topic e Opening an explanatory text with a link back to the main index http www xml com pub a 2000 09 xlink index html page 1 1 di 2 10 05 2001 9 11 56 P2P Research Report E e conferences oreilly com INNOVATE COLLABORATE DISCOVER XML com What is XLink Sep 18 2000 Style Matters e Opening a window and simulate the actions to be taken XML Q amp A e g going to the Edit menu and pressing Include Transforming XML Image Perl and XML e Opening up a relevant dialog e g a file chooser for the image to include GUIDES m Trying to code something like this links with multiple XML Resources targets directions and roles in XML while having old a Buyer s Guide href in mind is confusing and leads people to questions Events Calendar like the following Standards List e What is the correct tag for links in XML Submissions List e If there is such a
112. 46 XML com W3C XML Schema Structures Reference Nov 29 2000 e documentation ref Human targeted documentation documentation Source uriReference xml lang language Content any lt documentation gt Can be included in annotation e duration ref Facet to define a duration lt duration id ID value timeDuration fixed boolean false any attributes with non schema namespace gt Content annotation duration Can be included in restriction e element ref Element declaration or reference element abstract boolean false block fall List of substitution extension default string final fall List of extension restriction fixed string form qualified unqualified id ID maxOccurs nonNegativeInteger unbounded Lb minOccurs nonNegativeInteger 1 name NCName nullable boolean false ref QName substitutionGroup QName type QName any attributes with non schema namespace gt Content annotation simpleType complexType key keyref unique lt element gt Can be included in all choice schema sequence e encoding ref Facet to define the encoding for binary streams encoding id ID value hex base64 fixed boolean false any attributes with non schema namespace gt Content annotation encoding Can be included in restriction e enumeration ref Facet to restric
113. 9 2000 O REILLY o xml from the inside out O REILLY O REILLY NETWORK ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Find it at openp2p com FIND Search Article Archive FAQs Add the latest news from XML com to Im your web site Click X COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker XML Testbed EYBOLD PUBLICATIONS THIS SITE IS ON THE z W3C XML Schema Structures Reference by Eric van der Vlist November 29 2000 The quick reference below has been created using material from the W3C XML Schema Candidate Recommendation 24 October 2000 Namespaces July 23 27 OPEN SOURCE CONVENTION conferences o OREILLY COM amp Print This Article search Links to the original document are provided for each element labeled as ref after each element name http www w3 org 2000 10 XMLSchema Namespace to be used for W3C XML Schema itself Identified below without prefix XML http www w3 org 2000 10 XMLSchema instance Products Namespace to be used
114. A blank space indicates an invalid combination Table 2 shows which XLink elements are permitted which XLink subelements Attribute simple extended locator arc resource title type R R R R R R href O R role O O 0 O arcrole O O title O O Oo O jO show O O actuate O O label Oo O from O to O Table 1 Attribute usage from the W3C specification Parent type Significant child element types simple extended locator arc resource title locator title arc title resource title Table 2 Significant child types from the W3C specification XLink Types Use and Composition Let s review each of the XLink types To do this we ll use an example of linking actresses and the movies they played in Resources resource type and locator type elements The resources involved in a link can be either local resource type elements or remote pointed to by locator type elements For a rough equivalent in HTML think of resource type elements as lt a name gt and locator type elements as lt a href gt The following code shows a DTD declaration of a resource element lt ELEMENT actress first_name surname gt lt ATTLIST actress xlink type resource FIXED resource xlink title CDATA IMPLIED xlink label NMTOKEN IMPLIED gt xlink role CDATA IMPLIED Note that the element
115. A character is an atomic unit of text as specified by ISO IEC 10646 T ISO IEC 10646 Legal characters T are tab carriage return line feed and the legal graphic characters of Unicode and ISO IEC 10646 The use of compatibility characters as defined in section 6 8 of Unicode is discouraged T Character Range http www xml com axml testaxml htm 4 di 34 10 05 2001 9 26 15 The Annotated XML Specification The mechanism for encoding character code points into bit patterns may vary from entity to entity T All XML processors must accept the UTF 8 and UTF 16 encodings of 10646 the mechanisms for signaling which of the two is in use or for bringing other encodings into play are discussed later in 4 3 3 Character Encoding in Entities 2 3 Common Syntactic Constructs This section defines some symbols used widely in the grammar S white space consists of one or more space x20 characters carriage returns line feeds or tabs TD Characters are classified for convenience as letters digits or other characters Letters consist of T an alphabetic or syllabic base character possibly followed by one or more combining characters or of an ideographic character Full definitions of the specific characters in each class are given in B Character Classes Definition A Name is a token beginning with a letter or one of a few punctuation characters and continuing with letters digits hyphens underscores col
116. AE XOEBO xOEB2 4xOEB3 xOEBD 43xOECO 4xOECA 3xOF40 4x0F47 xOF49 x0F69 x10A0 x10C5 x10D0 x10F6 x1100 x1102 x1103 x1105 x1107 x1109 x110B x110C http www w3 org TR REC xml 35 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition 86 87 88 89 Ideographic CombiningChar Digit Extender xlEOO x1E9B x1F18 x1F1D x1lF50 x1F57 x1F5F x1F7D xlFDO x1FD3 xX1lFF2 x1FF4 41x212A 4x212B x3041 x3094 xACOO0 xD7A3 x4E00 4x9FA5 x0300 x0345 x0591 x05A1 xOA40 x0A42 xOA70 x0A71 xOABE x0AC5 x0B01 x0B03 x0B47 x0B48 x0B82 x0B83 xOBCA xO0BCD xOC3E x0C44 4 x0C55 4x0C56 x0OCC6 4x0CC8 413x0D02 4x0D03 xOD4A x0D4D xOER47 x0E4E xOEBB xX0EBC XOF35 4x0F37 xOF71 x0F84 XOF97 x20D0 x20DC X309A x0030 x0039 x0966 x096F 4xOAE6 4xOAEF x0C66 4x0C6F 4 x0E50 4x0E59 x00B7 x02D0 XOEC6 x3005 x30FC x30FE http www w3 org TR REC xml 36 di 41 10 05 2001 9 29 13 x1FBE x1FC2 x1FC4 XO5BF x05C1 x05C2 x05C4 x0670 x06D6 x06DC 4x06E0 4x06E4 f x06E7 4x06E8 x0901 x0903 X093C x0951 x0954 x0962 x0963 x09BC x09BE x0 9BF xO09C7 x09C8 x09CB x09CD xX09E2 x09E3 4x0A02 XOA3C xOF99 xOFAD
117. Built in Transformation from XML to Arbitrary Non XML The XT XSLT processor implements an extension serialization method named NXML for non XML Customized XSLT Engine result file 01 xmlns prefix http www jclark com xt 02 lt xsl output method prefix nxml Example 1 18 Using the XT namespace to specify the NXML extension serialization method Comment the namespace declaration attribute on line 1 must be somewhere in the element or the ancestry of the instruction on line 2 Second this extensibility opens up the opportunity to use an XSLT processor as a front end to any application that can be modified to access the result tree The intermediate result tree of CVML is not serialized externally rather it is fed directly to the application and the application interprets the internal representation of the content that would have been serialized to a custom format Time is saved by not serializing the result tree and having the application parse the reified file back into a memory representation performance is enhanced by the application directly accessing the result of transformation When generalized a vendor s non XML based application can use this approach to accommodate arbitrary customers XML vocabularies merely by writing W3C conforming XSLT stylesheets as the interpretation specification Some XSLT processors can build a DOM representation of result tree or deliver the result tree as Simple API for XML SAX event
118. Constraint Name Token Values of type NMTOKEN must match the Nmt oken production values of type NMTOKENS must match Nmtokens Definition Enumerated attributes can take one of a list of values provided in the declaration There are two kinds of enumerated types A NOTATION attribute identifies a notation declared in the DTD with associated system and or public identifiers to be used in interpreting the element to which the attribute is attached T Validity Constraint Notation Attributes Values of this type must match one of the notation names included in the declaration all notation names in the declaration must be declared Validity Constraint Enumeration Values of this type must match one of the Nmt oken tokens in the declaration T For interoperability the same Nmtoken should not occur more than once in the enumerated attribute types of a single element type H 3 3 2 Attribute Defaults An attribute declaration provides information on whether the attribute s presence is required and if not how an XML processor should react if a declared attribute is absent in a document In an attribute declaration REQUIRED means that the attribute must always be provided IMPLIED that no default value is provided T Definition If the declaration is neither REQUIRED nor IMPL IED D then the AttValue value contains the declared default value the FIXED keyword states that the attribute must always have the default va
119. EILLY COM E I RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Can the Story be Retold Find it on O Reilly Network FIND gt Search Article Archive FAQs Add the latest news from XML com to your web site EEEN Click here X COLUMNS XML Deviant Style Matters XML O amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List Sc h m a S Print This Article ATE Using W3C XML Schema by Eric van der Vlist November 29 2000 XML Schemas are an XML language for describing and constraining the content of XML documents XML Schemas are currently in the Candidate Recommendation Introducing Our First phase of the W3C development process Schema Slicing the Schema Defining Named Types Groups Compositors and Derivation Content Types Constraints book isbn 0836217462 gt Building Usable and lt title gt Being a Dog Is a Full Time Job4 ReusabteSchemas author Charles M Schulz author Namespaces lt character gt W3C XML Schema and lt name gt Snoopy lt name gt Instance Documents lt friend of gt Peppermint Patty lt friend d tWaC XML Schema since 1950 10 04 since Table of Contents i Introducing Our
120. Extended abstract in A Finkel M Jantzen Hrsg STACS 1992 S 173 184 Springer Verlag Berlin 1992 Lecture Notes in Computer Science 577 Full version titled http www w3 org TR REC xml 33 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition One Unambiguous Regular Languages in Information and Computation 140 2 229 253 February 1998 Clark James Clark Comparison of SGML and XML See http www w3 org TR NOTE sgml xml 971215 IANA LANGCODES Internet Assigned Numbers Authority Registry of Language Tags ed Keld Simonsen et al See http www isi edu in notes iana assignments languages IETF RFC2141 IETF Internet Engineering Task Force RFC 2141 URN Syntax ed R Moats 1997 See http www ietf org rfc rfc2141 txt IETF RFC 2279 IETF Internet Engineering Task Force RFC 2279 UTF 8 a transformation format of ISO 10646 ed F Yergeau 1998 See http www ietf org rfc rfc2279 txt IETF RFC 2376 IETF Internet Engineering Task Force RFC 2376 XML Media Types ed E Whitehead M Murata 1998 See http www ietf org rfc rfc2376 txt IETF RFC 2396 IETF Internet Engineering Task Force RFC 2396 Uniform Resource Identifiers URI Generic Syntax T Berners Lee R Fielding L Masinter 1998 See http www ietf org rfc rfc23906 txt IETF RFC 2732 IETF Internet Engineering Task Force RFC 2732 Format for Literal IPv6 Addresses in URL s R Hinden B Carpenter L Masinter
121. FEB FAQs document XSLT Process i Add the latest news from XML com to BRI pre transformation sop documents gt COLUMNS XML Deviant 2 Style Matters Fam XML Q amp A Process p Transforming XML source Perl and XML document gt GUIDES XML Resources i fent Buyer s Guide ransformation xi Events Calendar oil ol Standards List Submissions List TOOLBOX Syntax Checker XML Testbed EIL An XSLT stylesheet can be applied to more than one XML document each stylesheet producing a possibly usually Sponsored By different result Nothing in XSLT inherently ties the stylesheet to a single instance though the stylesheet writer can SEYBO LD employ techniques to abort processing based on processing undesirable input PUBLICATIONS An XML document can have more than one XSLT stylesheet applied each stylesheet producing a possible usually different result Even when stylesheet association indicates an author s preference for a stylesheet to use for processing THIS SITE IS ON E tools should provide the facility to override the preference with the reader s preference for a stylesheet Nothing in XML prevents more than a single stylesheet to be applied http www xml com pub a 2000 08 holman s1 html page s3 2 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 Note 12 In all cases in this chapter the depictions show the normative result of the XSLT processor s as the dotted triangle a
122. ID value string fixed boolean false any attributes with non schema namespace gt Content annotation minLength Can be included in restriction e notation ref Declaration of a notation notation id ID name NCName public A public identifier per ISO 8879 system uriReference any attributes with non schema namespace gt Content annotation notation Can be included in schema e pattern ref Facet to define a regular expression pattern constraint pattern http www xml com pub a 2000 1 1 29 schemas structuresref html 5 di 7 10 05 2001 9 21 46 XML com W3C XML Schema Structures Reference Nov 29 2000 id ID value string fixed boolean false any attributes with non schema namespace Content annotation lt pattern gt Can be included in restriction e period ref Facet to define a period period id ID value timeDuration fixed boolean false any attributes with non schema namespace Content annotation period Can be included in restriction e precision ref Facet to define the precision of a numeric datatype precision id ID value nonNegativeInteger fixed boolean false any attributes with non schema namespace Content annotation lt precision gt Can be included in restriction e redefine ref Import of a W3C XML Schema for the same namespace with possible overide lt redefine schemaLocat
123. L documents into their final display form by transforming instances of our XML vocabularies into instances of a particular rendering vocabulary This Working Draft normatively references XSLT as an integral component of XSL A stylesheet could be written with both the transformation vocabulary and the formatting semantics vocabulary together it would style an XML instance by rendering the results of transformation This result need not be serialized in XML syntax rather an XSLT XSL processor can utilize the result of transformation to create a rendered result by interpreting the abstract hierarchy of information without seeing syntax 1 1 4 2 Target of transformation When using a formatting semantics vocabulary as the rendering language the objective for a stylesheet writer is to convert an XML instance of some arbitrary XML vocabulary into an instance of the formatting semantics vocabulary The result of transformation cannot contain any user defined vocabulary construct for example an address customer identifier or purchase order number construct because the rendering agent would not know what to do with constructs labeled with these foreign unknown identifiers Consider two examples HTML for rendering in a web browser and XSL for rendering on screen on paper or audibly In both cases the rendering agents only understand the vocabulary expressing their respective formatting semantics and wouldn t know what to do with alien element types d
124. L vocabularies we have now reduced the problem to XML instance transformation Our objective is simplified to produce XML instances of CVML from instances of our many input XML vocabularies This is a classical XSLT situation and we need only write XSLT stylesheets combining the XSLT instructions with CVML as the result vocabulary Our investment in XSLT for our colleagues is leveraged by the CVML Instance Interpreter so that they can now take their XML and use stylesheets to produce the binary or custom lexical format http www xml com pub a 2000 08 holman s1 html page 3 6 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 transformation Custom Vocabukry Semantics Interpretation XSLT Process source result document document Figure 1 7 Transformation from XML to an arbitrary format This approach separates the awareness of the lexical and syntactic requirements of the custom output format from the numerous stylesheets we write for all of our possible input XML vocabularies Our colleagues use XSLT just as they would with HTML or XSL as a result vocabulary They leverage the single investment in producing the custom format by using the CVML Interpreter to serialize the results of their transformations to produce the files designed for other applications This in turn leverages the investment in learning and using XSLT in the organization result file Taking this two steps further First the X in X
125. LT processors and the stylesheet needs to be portable across all processors only the standardized facilities can be used Standardized presence testing and fallback facilities can be used by the stylesheet writer to accommodate http www xml com pub a 2000 08 holman s1 html page 2 11 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 the ability of a processor to act on extension facilities used in the stylesheet 1 1 5 9 Abstract structure result In the same way our stylesheets are insulated from the syntax of our source files our stylesheets are insulated from the syntax of our result We do not focus on the syntax of the file to be produced by the XSLT processor rather we create a result tree of abstract nodes which is similar to the tree of abstract nodes of our input information Our examples of transformation converted to nodes from our stylesheet are added to the result hierarchy as nodes not as syntax Our objective as XSLT transformation writers is to create a result node tree that may or may not be serialized externally as markup syntax The XSLT processor is not obliged to externalize the result tree if the processor is integral to some process interpreting the result tree for other purposes For example an XSL rendering agent may embed an XSLT processor for interpreting the inputs to produce the intermediate hierarchy of XSL rendering vocabulary to be reified in a given medium In such cases serializi
126. ML processor to an application examples are attribute defaults and entity declarations The standalone document declaration which may appear as a component of the XML declaration signals whether or not there are such declarations which appear external to the document entity T Standalone Document Declaration 32 SDDecl S standalone VC Standalone me UUTV Ug Tecum Vie Wee Declaration twee ves Uae Y LL SO E In a standalone document declaration the value yes indicates that there are no markup declarations external to the document entity either in the DTD external subset or in an external parameter entity referenced from the internal subset which affect the information passed from the XML processor to the application The value no indicates that there are or may be such external markup declarations Note that the standalone document declaration only denotes the presence of external declarations the presence in a document of references to external entities when those entities are internally declared does not change its standalone status If there are no external markup declarations the standalone document declaration has no meaning If there are external markup declarations but there is no standalone document declaration the value no is assumed Any XML document for which standalone no holds can be converted algorithmically to a standalone document which may be desirable for some netw
127. Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Free Radical lan Clarke 4 Has Big Plans 4 for the Internet FIND Search Article Archive COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker XML Testbed SEYBOLD PUBLICATIONS GPS Palm PDA OpenGL Let s Go Find it on the O Reilly Network OREILLY COM Using W3C XML Schema by Eric van der Vlist Pages 1 2 3 4 5 6 7 8 9 Advanced W3C XML Schema Content Types In the first part of this series we examined the default content type behavior modeled Table of Contents after data oriented documents where complex type elements are element and attribute only and simple type elements are character data without attributes Introducing Our First amp Print This Articte The W3C XML Schema Definition Language also supports the definition of empty ire he Sch content elements and simple content elements those that contain only character data Slicing the Schema with attributes Defining Named Types Groups Compositors and Empty content elements are defined using a regular xsd complexType construct Derivation and by purposefully
128. Path uses namespace prefixes within the value of some attributes to identify the namespace of data types elements attributes etc For instance we ve used this feature all along in our examples to identify the W3C XML Schema predefined datatypes This mechanism can be extended to import definitions from any other namespace and so reuse them in our schemas Reusing definitions from other namespaces is done through a three step process This process needs to be done even for the XML 1 0 namespace in order to declare attributes such as xml lang First the namespace must be defined as usual lt xsd schema xmlns xsd http www w3 org 2000 10 XMLSchema targetNamespace http example org ns books xmlns xml http www w3 org XML 1998 namespace elementFormDefault qualified gt Then W3C XML Schema needs to be informed of the location at which it can find the schema corresponding to the namespace This is done using an xsd import element lt xsd import namespace http www w3 org XML 1998 namespace schemaLocation myxml xsd gt W3C XML Schema now knows that it should attempt to find any reference belonging to the XML namespace in a schema located at myxml xsd We can now use the external definition lt xsd element name title gt xsd complexType xsd simpleContent xsd extension base xsd string gt xsd attribute ref xml lang lt xsd extension gt lt xsd simpleContent gt lt xsd complexType gt lt xs
129. SLT represents the word extensible and result tree serialization is one of the areas where we can extend an XSLT processor s functionality This allows us to implement non standard vendor specific or application specific output serialization methods and engage these facilities in a standard manner As with all extension mechanisms in XSLT the trigger is the use of an XML namespace recognized by the XSLT processor implementing the extension xmlns prefix processor recognized URI xsl output method prefix serialization method name Example 1 17 Using namespaces to specify an extension serialization method the namespace declaration attribute on line 1 must be somewhere in the element or the ancestry of the instruction on line 2 Using the same semantics described for the outboard CVML Interpreter program depicted in Figure 1 7 this translation facility can be incorporated into the XSLT processor itself as an inboard extension The code itself may be http www xml com pub a 2000 08 holman s1 html page 3 7 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 directly portable based on the nature of how the outboard program is written Such an extended processor would directly emit the custom format without reifying the intermediate structure though this would be convenient for diagnostic purposes transformation script Custom Vocabukry Semantics XSLT Process source document Figure 1 8
130. Syntax Checker XML Testbed SEYBOLD FUBLICATIONS THIS SITE IS ON THE THA TE www thawte com http www xml com pub a axml axmlintro html 2 di 2 10 05 2001 9 23 45 XML com Building the Annotated XML Specification Sep 12 1998 Pre conference workshops 25th July O REILLY leom xml from the inside out XML COM O REILLY NETWORK OREILLY COM ONJAVA COM Conference 26th amp 27th July Holiday Inn London Victoria es gt CENTERS Building the nai Print This Article Annotated raphics er Mexaa XML Specification Mobile Programming aa September 12 1998 Protocols Schemas Thedesign of XML 1 0 stretched over 20 Style months ending in February 1998 with input from a couple of hundred of the world s best experts in the area of markup publishing and Web design The result of that work the XML 1 0 Specification is a highly condensed Web ESSENTIALS Annotated XML document that contains little or no information What is XML about how it came to read the way it does What is XSLT What is XLink Even before the release of XML 1 0 it became obvious that some parts of the spec were What is XML Schema self explanatory while others were causing What is RDF headaches for its users Products The Annotated XML Specification addresses IEVE both of these problems It supplements the basic Tools Performance specification first with historic
131. The declaration matches Mi xed and the content consists of character data and child elements whose types match names in the content model T 4 The declaration matches ANY and the types of any child elements have been declared T 3 1 Start Tags End Tags and Empty Element Tags Definition The beginning of every non empty XML element is marked by a start tag Start tag http www xml com axml testaxml htm 11 di 34 10 05 2001 9 26 16 The Annotated XML Specification The Name T in the start and end tags gives the element s type Definition H The Name AttValue pairs are referred to as the attribute specifications of the element Definition with the Name in each pair referred to as the attribute name and Definition the content of the AttValue the text between the or delimiters as the attribute value T Well Formedness Constraint Unique Att Spec No attribute name may appear more than once in the same start tag or empty element tag T Validity Constraint Attribute Value Type The attribute must have been declared the value must be of the type declared for it For attribute types see 3 3 Attribute List Declarations T Well Formedness Constraint No External Entity References Attribute values cannot contain direct or indirect entity references to external entities T Well Formedness Constraint No lt in Attribute Values The replacement text of any entity referred to directly or indirectly
132. With Us Site Help http www xml com pub a 2000 1 1 29 schemas part1 html page 3 2 di 3 10 05 2001 9 18 27 XML com Using W3C XML Schema Nov 29 2000 http www xml com pub a 2000 1 1 29 schemas part1 html page s3 3 di 3 10 05 2001 9 18 27 XML com Using W3C XML Schema Nov 29 2000 O REILLY o xml from the inside out oenar NETWORK ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDE CSS Style Find it in the JavaScript CSS DevCenter FIND gt Search Article Archive FAQs Add the latest news from XML com to XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIONS i USING Perl XML OREILLY COM ee Using W3C XML Schema by Eric van der Vlist Pages 1 2 3 4 5 6 7 8 9 Groups Compositors and Print This Artide Table of Contents Derivation erivatio Introducing Our First Groups Schema Slicing the Schema W3C XML Schema also allows the definition of Defining Named Types groups of elements and attributes Groups Composito
133. XML Deviant OPEN SOURC CONVENTION OREILLY COM What is RDF by Tim Bray January 24 2001 This article was first published as RDF and Table of Contents Metadata on XML comin The Right Way to Find June 1998 It has been Things updated by ILRT s Dan Brickley chair of the W3C s eIt s All Different Behind the Scenes RDF Interest Group to Not Just For Searching reflect the growing use of What About the Web RDF and updates to the Divine Metadata for the specification since 1996 Web The Right Way to Eu m iu i i Why Not Just Use eae ne The Devil is in the Details Vocabularies RDF stands for Resource Description Framework RDF 1s built for the Web but let s leave the Web behind for now and think about how we find things in the real world What RDF Might Mean Getting started with RDF Developer Community Scenario 1 The Library You re in a library to find books on raising donkeys as pets In most libraries these days you d use the computer lookup system basically an electronic version of the old card file This system allows you to list books by author title subject and so on The list includes the date author title and lots of other useful information including most important of all where each book is Scenario 2 The Video Store http www xml com pub a 2001 01 24 rdf html 1 di 3 10 05 2001 9 13 27 July 23 27 San Diego co
134. XML Q amp A resource for example The Home Page of Transforming XML http www textuality com RDF Why html is Perl and XML http www textuality com 4 There is a straightforward method for expressing these abstract Properties in XML for GUIDES example YML Resourses rdf Description about http www textuality com RDF Why RDF html Author Tim Bray lt Author gt Home Page rdf resource http www textuality com lt rdf Description gt Buyer s Guide Events Calendar Standards List Submissions List RDF is carefully designed to have the following characteristics Independence TOOLBOX Since a Property is a resource any independent organization or even person can invent them I can invent one called Author and you can invent one called Director which would only Syntax Checker apply to resources that are associated with movies and someone else can invent one called XML Testbed Restaurant Category This is necessary since we don t have a GOD to take care of it for us http www xml com pub a 2001 01 24 rdf html page 2 1 di 2 10 05 2001 9 13 49 XML com What is RDF Jan 24 2001 Interchange EYB LD Since RDF Statements can be converted into XML they are easy for us to interchange This would probably be necessary even if we did have a GOD Scalability THIS SITE IS ON THE z RDF statements are simple three part records Resource Property value so they are easy to handle and look things up by even in la
135. XML com What is XSLT Aug 16 2000 O REILLY o xml from the inside out XML COM O REILLY NETWORK ONJAVA COM OREILLY COM Opening the Windows e ws to your Portal Solutions E RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF JBuilder Handheld Express Product Review Find it at ONJava com FIND gt Search Article Archive FAQs Add the latest news from XML com to your web site Click here Z j COLUMNS XML Deviant W hateiseXSLT What is XSLT by G Ken Holman August 16 2000 Introduction Now that we are successfully using XML to mark up our IBM senior information according to our programmer Doug own vocabularies we are Tidwell will be taking control and speaking on Java responsibility for our Techniques for XSLT Web Sites at the information instead of abdicating such control to product vendors These vendors would rather lock our information into their proprietary schemes to keep us beholden to their solutions and technology O Reilly Conference on Enterprise Java March 26 29 in Santa Clara California But the flexibility inherent in the power given to each of us to develop our own vocabularies and for industry associations e commerce
136. a description of the document s storage layout and logical structure XML provides a mechanism to impose constraints on the storage layout and logical structure Definition A software module called an XML processor H is used to read XML documents and provide access to their content and structure Definition It is assumed that an XML processor is doing its work on behalf of another module called the application This specification describes the required behavior of an XML processor in terms of how it must read XML data and the information it must provide to the application T 1 1 Origin and Goals XML was developed by an XML Working Group originally known as the SGML Editorial Review Board formed under the auspices of the World Wide Web Consortium W3C in 1996 H It was chaired by Jon BosakiH i of Sun Microsystems with the active participation of an XML Special Interest Group previously known as the SGML Working Group H also organized by the W3C The membership of the XML Working Group is given in an appendix Dan Connolly served as the WG s contact with the W3C Hi The design goals for XML are XML shall be straightforwardly usable over the Internet H XML shall support a wide variety of applications H XML shall be compatible with SGML H It shall be easy to write programs which process XML documents H The number of optional features in XML is to be kept to the absolute minimum ideally zero H XML documents shou
137. a given element type e To establish type constraints for these attributes e To provide default values for attributes Definition Attribute list declarations specify the name data type and default value if any of each attribute associated with a given element type Attribute list Declaration 52 AttlistDecl ATTLIST S Name AttDef S 53 AttDef S Name S AttType S DefaultDecl The Name in the AttlistDecl rule is the type of an element At user option an XML processor may issue a warning if attributes are declared for an element type not itself declared but this is not an error The Name in the AttDef rule is the name of the attribute When more than one AttlistDecl is provided for a given element type the contents of all those provided are merged When more than one definition is provided for the same attribute of a given element type the first declaration is binding and later declarations are ignored For interoperability writers of DTDs may choose to provide at most one http Awww w3 org TR REC xml 17 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition attribute list declaration for a given element type at most one attribute definition for a given attribute name in an attribute list declaration and at least one attribute definition in each attribute list declaration For interoperability an XML processor may at user option issue a warning when more than one attribute li
138. a same element name to carry different definitions For this purpose W3C XML Schema is a scoped language each definition being visible only within the schema element where it is defined and all its descendants Here s a complete listing of this first example download it lt xml version 1 0 encoding utf 8 gt lt xsd schema xmlns xsd http www w3 org 2000 10 XMLSchema gt lt xsd element name book gt xsd complexType xsd sequence lt xsd element name title type xsd string gt http www xml com pub a 2000 1 1 29 schemas part1 html 2 di 3 10 05 2001 9 17 07 XML com Using W3C XML Schema Nov 29 2000 lt xsd element name author type xsd string gt lt xsd element name character minOccurs 0 maxOccurs unbounded lt xsd complexType gt lt xsd sequence gt lt xsd element name name type xsd string gt lt xsd element name friend of type xsd string minOccurs 0 maxOccurs unbounded gt lt xsd element name since type xsd date gt lt xsd element name qualification type xsd string gt lt xsd sequence gt lt xsd complexType gt lt xsd element gt xsd sequence xsd attribute name isbn type xsd string gt lt xsd complexType gt lt xsd element gt lt xsd schema gt The next section explores how to subdivide schema designs to make them more readable and maintainable Pages 1 2 3 4 5 6 7 8 9 XML S05P htt
139. a streams is xF EFF The notation is used to denote any byte value except that two consecutive s cannot be both 00 With a Byte Order Mark EF BB BF UTF 8 Without a Byte Order Mark 00 00 00 3C UCS A or other encoding with a 32 bit code unit and ASCII characters encoded as ASCII values C 00 00 00 in respectively big endian 1234 little endian 4321 and two unusual byte orders 2143 and 0 00 3c 00 3412 The encoding declaration must be read to determine which of UCS 4 or other supported 32 bit encodings applies Ce 0 3C 00 00 UTF 16BE or big endian ISO 10646 UCS 2 or other encoding with a 16 bit code unit in 00 3C 00 3F jbig endian order and ASCII characters encoded as ASCII values the encoding declaration must be read to determine which UTF 16LE or little endian ISO 10646 UCS 2 or other encoding with a 16 bit code unit in 3C 00 3F 00 little endian order and ASCII characters encoded as ASCH values the encoding declaration must be read to determine which UTF 8 ISO 646 ASCII some part of ISO 8859 Shift JIS EUC or any other 7 bit 8 bit or mixed width encoding which ensures that the characters of ASCII have their normal positions 3C 3F 78 6D width and values the actual encoding declaration must be read to detect which of these applies but since all of these encodings use the same bit patterns for the relevant ASCII characters the encoding declaration itself may be
140. a syntax created by subsetting an existing widely used international text processing standard Standard Generalized Markup Language ISO 8879 1986 E as amended and corrected for use on the World Wide Web It is a product of the W3C XML Activity details of which can be found at http www w3 org XML A list of current W3C Recommendations and other technical documents can be found at http www w3 org TR This specification uses the term URL T which is defined by Berners Lee et al a work in progress expected to update IETF RFC1738 and IETF RFC1808 The list of known errors in this specification is available at http www w3 org XML xml 199802 10 errata Please report errors in this document to xml editor w3 org U Extensible Markup Language XML 1 0 Table of Contents 1 Introduction 1 1 Origin and Goals 1 2 Terminology 2 Documents 2 1 Well Formed XML Documents 2 2 Characters 2 3 Common Syntactic Constructs 2 4 Character Data and Markup http www xml com axml testaxml htm 1 di 34 10 05 2001 9 26 15 Introduction to the Annotated XML Specification by Tim Bray The other window contains the XML specification this window the commentary on it The content and appearance of the XML spec are exactly as in the official version it has not been edited in any way to generate this presentation The commentary is contained in external XML files with XML hyperlinks into the entirely
141. acter sequence Definition In addition to a system identifier an external identifier may include a public identifier An XML processor attempting to retrieve the entity s content may use the public identifier to try to generate an alternative URI reference If the processor is unable to do so it must use the URI reference specified in the system literal Before a match is attempted all strings of white space in the public identifier must be normalized to single space characters 4x20 and leading and trailing white space must be removed Examples of external entity declarations 4 3 Parsed Entities 4 3 1 The Text Declaration External parsed entities should each begin with a text declaration Text Declaration 77 TextDecl t lt xml VersionInfo EncodingDecl S The text declaration must be provided literally not by reference to a parsed entity No text declaration may appear at any position other than the beginning of an external parsed entity The text declaration in an external parsed entity is not considered part of its replacement text 4 3 2 Well Formed Parsed Entities http Awww w3 org TR REC xml 25 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition The document entity is well formed if it matches the production labeled document An external general parsed entity is well formed if it matches the production labeled extParsedEnt All external parameter entities are well formed by
142. al background and explanation of how things came to be the way they are and second with detailed explanations of the portions of the spec that have proved difficult Commercially it has O REILLY Find it at ONJava com been a success in its first month on the Web it x o had over 100 000 page views from over 26 000 Training FIND unique Internet addresses It remains by a substantial margin the most popular item Search available at the XML com site Article Archive FAOs This article explains how I created the Annotated XML Specification If you haven t looked at it you might want to give it a glance before reading about it or even better open it in another browser window while you read http www xml com pub a 98 09 exexegesis 0 html 1 di 2 10 05 2001 9 25 21 XML com Building the Annotated XML Specification Sep 12 1998 Add the latest news about it here Pages 1 2 3 4 COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker XML Testbed SEYBOLD FUBLICATIONS THIS SITE IS ON THE THA TE www thawte com http www xml com pub a 98 09 exexegesis 0 html 2 di 2 10 05 2001 9 25 21 The Annotated XML Specification W330 REC xml 19980210 Extensible Markup Language XML 1 0 W3C Recommendation 10 February 1998
143. alone stylesheet but may in other cases be embedded inside an XML document Tools Training O REILLY xn http www xml com pub a 2000 08 holman s2_1 html page 3 1 di 8 10 05 2001 9 08 04 FIND gt Search Article Archive FAQs Add the latest news from XML com to E your web site iick here P COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIONS XML com Getting started with XSLT and XPath Aug 23 2000 XML Declaration lt xml version 1 0 gt Document XSLT Namespace Declaration Element xsl transform xmlns xsl http www w3 org XSL Transform Top level version 1 0 gt Elements Version of XSLT required by the Stylesheet Result Tree xsl output method xml indent 2 yes Template lt xsl template match gt lt b gt lt i gt lt u gt lt xsl ivalue of select greeting gt lt u gt lt i gt lt b gt lt xsl template gt pm Literal Result Elements serrer c xsl transform Figure 2 4 Components of an Explicit Stylesheet Template Rule The XML declaration is consumed by the XML processor embedded within the XSLT processor thus the XSLT processor never sees it The wrapper element must include the XSLT namespace
144. ame Notation Declared If the NDat aDecl is present this is a general unparsed entity otherwise it is a parsed entity Validity Constraint Notation Declared The Name must match the declared name of a notation T Definition The SystemLiteral is called the entity s system identifier It is a URI which may be used to retrieve the entity T Note that the hash mark 4 and fragment identifier frequently used with URIs are not formally part of the URI itself an XML processor may signal an error if a fragment identifier is given as part of a system identifier T Unless otherwise provided by information outside the scope of this specification e g a special XML element type defined by a particular DTD or a processing instruction defined by a particular application specification relative URIs are relative to the location of the resource within which the entity declaration occurs A URI might thus be relative to the document entity to the entity containing the external DTD subset or to some other external parameter entity An XML processor should handle a non ASCII character in a URI by T representing the character in UTF 8 as one or more bytes and then escaping these bytes with the URI escaping mechanism i e by converting each byte to HH where HH is the hexadecimal notation of the byte value Definition In addition to a system identifier an external identifier may include a public identifier A
145. ant and the only reason to read the doctype declaration is to identify the semantics of ul ink reading the external subset is not necessary You can communicate this information in the standalone document declaration Section 2 9 The standalone document declaration standalone yes or standalone no occurs in the XML declaration A value of yes indicates that only internal declarations need to be processed A value of no indicates that both the internal and external declarations must be processed Other Markup Issues In addition to markup there are a few other issues to consider white space handling attribute value normalization and the language in which the document is written White Space Handling White space handling Section 2 10 is a subtle issue Consider the following content fragment oldjoke lt burns gt Say quote goodnight quote Gracie lt burns gt Is the white space the new line between lt oldjoke gt and lt burns gt significant Probably not But how can you tell You can only determine if white space is significant if you know the content model of the elements in question In a nutshell white space is significant in mixed content and is insignificant in element content The rule for XML processors is that they must pass all characters that are not markup through to the application If the processor is a validating processor Section 5 1 it must also inform the application about which
146. any of our or others vocabularies we may have to deal with in the future The approach involves us creating our own custom markup language based on a critical analysis of the target custom format to distill the semantics of how information is represented in the resulting file These semantics can be expressed using an XML vocabulary whose elements and attributes engage the features and functions of the resulting format We must not be thinking of our source XML vocabularies rather our focus is entirely on the semantics of what exactly makes up our target custom format Let s refer to this custom format s XML vocabulary we divine from our analysis as the Custom Vocabulary Markup Language CVML Using our programming resources we can then write a single transformation application responsible for interpreting XML instances of CVML to produce a file following the custom format This transformation application could be written using the Document Object Model DOM as a basis for tree oriented access to the information Alternatively a SAX based application can interpret the instances to produce the outputs if the nature of CVML lends itself to that orientation The key is that regardless of how instances of CVML are created the interpretation of CVML markup to produce an output file never changes Our one CVML Instance Interpreter application can produce any custom format output file expressible in the CVML semantics Getting back to our own or others XM
147. appear XLink provides a mechanism for identifying relevant link containing documents which is discussed in 5 Extended Link Groups 5 Extended Link Groups Hyperlinked documents are often best processed in groups rather than one at a time If it is desired to highlight resources to advertise that traversal can be initiated and if at the same time out of line links are being used it may be an absolute requirement to read other documents to find these links and discover where the resources are In these cases an extended link group element a special kind of extended link may be used to store a list of links to other documents that together constitute an interlinked group Each such document is identified by means of an extended link document element a special kind of locator element Following are sample declarations for extended link group and extended link document elements showing all the possible XLink related attributes they may have using the parameter entities provided in 4 1 Information Associated with Links The xm1 link attribute value for an extended link group element must be group and the value for an extended link document element must be document lt ELEMENT group document gt SUBRITPLIST group min Look CDATA FE IXED nroup steps CDATA IMPLIED gt lt ELEMENT document EMPTY gt lt ATTLIST document srs ak CDATA FIXED document slocator att The steps attribute may be used by an author
148. aration all notation names in the declaration must be declared Validity constraint One Notation Per Element Type No element type may have more than one NOTATION attribute specified Validity constraint No Notation on Empty Element For compatibility an attribute of type NOTATION must not be declared on an element declared EMPTY Validity constraint Enumeration Values of this type must match one of the Nmtoken tokens in the declaration For interoperability the same Nmtoken should not occur more than once in the enumerated attribute types of a single element type 3 3 2 Attribute Defaults An attribute declaration provides information on whether the attribute s presence is required and if not how an XML processor should react if a declared attribute is absent in a document Attribute Defaults 60 DefaultDecl REQUIRED IMPLIED FIXED S AttValue VC Required Attribute VC Attribute Default Legal WFC No in Attribute Values VC Fixed Attribute Default In an attribute declaration REQUIRED means that the attribute must always be provided IMPLIED that no default value is provided Definition If the declaration is neither fREQUIRED nor IMPLIED then the AttValue value contains the declared default value the FIXED keyword states that the attribute must always have the default value If a default value is declared when an XML processor encounters an omitted attribute it is to beh
149. aration the value yes indicates that there are no external markup declarations which affect the information passed from the XML processor to the application The value no indicates that there are or may be such external markup declarations Note that the standalone document declaration only denotes the presence of external declarations the presence in a document of references to external entities when those entities are internally declared does not change its standalone status If there are no external markup declarations the standalone document declaration has no meaning If there are external markup declarations but there is no standalone document declaration the value no is assumed Any XML document for which st andalone no holds can be converted algorithmically to a standalone document which may be desirable for some network delivery applications Validity constraint Standalone Document Declaration The standalone document declaration must have the value no if any external markup declarations contain declarations of e attributes with default values if elements to which these attributes apply appear in the document without http Awww w3 org TR REC xml 11 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition specifications of values for these attributes or e entities other than amp 1t gt apos quot if references to those entities appear in the document or e attributes with value
150. arious programs XLink does not provide mechanisms for controlling link formatting because it is considered to fall into the domain of stylesheets Link behavior should ideally also be determined by rules based on link types resource roles user circumstances and other factors However XLink does provide a few very general behavior mechanisms because they are commonly considered to reflect major or invariant semantics of link types The mechanism that XLink provides allows link authors to signal certain intentions as to the timing and effects of traversal Such intentions can be expressed along two axes labeled show and actuate These are used to express policies rather than mechanisms any link processing application software is free to devise its own mechanisms best suited to the user environment and processing mode to implement the requested policies In many cases much finer control over the details of traversal behavior of the type that existing hypertext software typically provides will be desired Such fine control of link behavior is outside the scope of this specification However the behavior attribute is provided as a standard place for authors to provide and in which application software may look for detailed behavioral instructions 6 1 The Show Axis The show attribute is used to express a policy as to the context in which a resource that is traversed to should be displayed or processed It may take one of three values
151. ating resources Note that being able to go back after following a one directional link does not make the link multidirectional out of line link A link whose content does not serve as one of the link s participating resources Such links presuppose a notion like extended link groups which indicate to application software where to look for links Out of line links are generally required for supporting multidirectional traversal and for allowing read only resources to have outgoing links participating resource A resource that belongs to a link All resources are potential contributors to a link participating resources are the actual contributors to a particular link remote resource Any participating resource of a link that is pointed to with a locator resource In the abstract sense an addressable service or unit of information that participates in a link Examples include files images documents programs and query results Concretely anything reachable by the use of a locator in some linking element Note that this term and its definition are taken from the basic specifications governing the World Wide Web sub resource A portion of a resource pointed to as the precise destination of a link As one example a link might specify that an entire document be retrieved and displayed but that some specific part s of http www w3 org TR 1998 WD xlink 19980303 4 di 16 10 05 2001 9 30 10 XML Linking Language XLink it is the
152. ational Organization for Standardization ISO 639 1988 E Code for the representation of names of languages Geneva International Organization for Standardization 1988 0 ISO 3166 International Organization for Standardization ISO 3166 1 1997 E Codes for the representation of names of countries and their subdivisions Part 1 Country codes Geneva International Organization for Standardization 1997 1 J ISO IEC 10646 ISO International Organization for Standardization ISO IEC 10646 1993 E Information technology Universal Multiple Octet Coded Character Set UCS Part 1 Architecture and Basic Multilingual Plane Geneva International Organization for Standardization 1993 plus amendments AM 1 through AM 7 1 Unicode The Unicode Consortium The Unicode Standard Version 2 0 Reading Mass Addison Wesley Developers Press 1996 1 J A 2 Other References Aho Ullman Aho Alfred V Ravi Sethi and Jeffrey D Ullman Compilers Principles Techniques and Tools Reading Addison Wesley 1986 rpt corr 1988 1 Berners Lee et al Berners Lee T R Fielding and L Masinter Uniform Resource Identifiers URI Generic Syntax and Semantics 1997 Work in progress see updates to RFC1738 j Br ggemann Klein Br ggemann Klein Anne Regular Expressions into Finite Automata Extended abstract in I Simon Hrsg LATIN 1992 S 97 98 Springer Verlag Berlin 1992 Full Version in Theoretical Computer S
153. attribute value http www xml com axml testaxml htm 23 di 34 10 05 2001 9 26 16 The Annotated XML Specification These simple rules may have complex interactions for a detailed discussion of a difficult example see D Expansion of Entity and Character References 4 6 Predefined Entities Definition Entity and character references can both be used to escape the left angle bracket ampersand and other delimiters A set of general entities amp 1t gt apos quot is specified for this purpose Numeric character references may also be used they are expanded immediately when recognized and must be treated as character data so the numeric character references amp 60 and amp 438 may be used to escape lt and amp when they occur in character data T All XML processors must recognize these entities whether they are declared or not For interoperability valid XML documents should declare these entities like any others before using them If the entities in question are declared they must be declared as internal entities whose replacement text is the single character being escaped or a character reference to that character as shown below Note that the and amp characters in the declarations of 1t and amp are doubly escaped to meet the requirement that entity replacement be well formed 4 7 Notation Declarations Definition Notations identify by name the format of unparsed entities the format o
154. attributes and Reusable Schemas elements Namespaces This is achieved by giving a name to the W3C XML Schema and simpleType and complexType elements Instance Documents and locating them outside of the W3C XML Schema definitions of elements and attributes Datatypes Reference We will also take the opportunity to W3C XML Schema show how we can derive a datatype from another one by defining a restriction over the values of this datatype Structures Reference For instance to define a datatype named nameType which is a string with a maximum of 32 characters we write xsd simpleType name nameType gt xsd restriction base xsd string gt xsd maxLength value 32 xsd restriction lt xsd simpleType gt The simpleType element holds the name of the new datatype The restriction element expresses the fact that the datatype is derived from the string datatype of the W3C XML Schema namespace attribute base by applying a restriction i e by limiting the number of possible values The maxLength element called a facet says that this resctriction is a condition on the maximum length to be 32 characters Another powerful facet is the pattern element which defines a regular expression that must be matched For instance if we do not care about signs we can define an ISBN datatype as 10 digits thus lt xsd simpleType name isbnType gt lt xsd restriction base xsd string gt
155. ave as though http www w3 org TR REC xml 19 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition the attribute were present with the declared default value Validity constraint Required Attribute If the default declaration is the keyword REQUIRED then the attribute must be specified for all elements of the type in the attribute list declaration Validity constraint Attribute Default Legal The declared default value must meet the lexical constraints of the declared attribute type Validity constraint Fixed Attribute Default If an attribute has a default value declared with the FIXED keyword instances of that attribute must match the default value Examples of attribute list declarations 3 3 3 Attribute Value Normalization Before the value of an attribute is passed to the application or checked for validity the XML processor must normalize the attribute value by applying the algorithm below or by using some other method such that the value passed to the application is the same as that produced by the algorithm 1 All line breaks must have been normalized on input to xA as described in 2 11 End of Line Handling so the rest of this algorithm operates on text normalized in this way 2 Begin with a normalized value consisting of the empty string 3 For each character entity reference or character reference in the unnormalized attribute value beginning with the first and continuing to
156. be used XSLT processor extensions are outside the scope of the XSLT vocabulary so other URI values must be used to identify extensions The stylesheet must also declare the version of XSLT required by the instructions used therein The attribute is named version and must accompany the namespace declaration in the wrapper element instruction as version version number In an implicit stylesheet where the XSLT namespace is declared in an element that is not an XSLT instruction the namespace qualified attribute declaration must be used as prefix version version number The version number is a numeric floating point value representing the latest version of XSLT defining the http www xml com pub a 2000 08 holman s2_1 html page 3 3 di 8 10 05 2001 9 08 04 XML com Getting started with XSLT and XPath Aug 23 2000 instructions used in the stylesheet It need not declare the most capable version supported by the XSLT processor 2 2 4 Instructions and literal result elements XSLT instructions are only detected in the stylesheet tree and are not detected in the source tree Instructions are specified using the namespace prefix associated with the XSLT namespace URI The XSLT Recommendation describes the behavior of the XSLT processor for each of the instructions defined based on the instruction s element type name Top level instructions are considered and or executed by the XSLT processor before processing begins on the source info
157. be used in forwarding type applications where when one anchor is display the other s are to replace it without user intervention Since XLink provides only the most general semantics for links details of presentation such as a time delay or beep before forwarding can be specified on a per application basis using a style language 7 Attribute Remapping XLink provides many attributes that can be attached to linking elements to describe various aspects of links and each has a default name It may be desired to use existing elements in XML documents as linking elements but such elements might already have attributes whose names conflict with those described in this document To avoid collisions user chosen attribute names can be mapped to the default names using the xml attributes attribute This attribute must contain an even number of white space separated names which are treated as pairs In each pair the first name must be one of the default XLink names role href title show inline content role content title actuate behavior steps The second name when recognized in the document will be treated as though it were playing the role assigned to the first For example consider a DTD with the following declaration lt ELEMENT TEXT BOOK ANY gt lt ATTLIST TEXI BOOK title CDATA IMPLIED role PRIMARY SUPPORTING IMPLIED If it were desired to use this as a simple link it would be necessary to remap a couple of attri
158. butes This could be accomplished in the internal subset lt M Sl TEXTE BOOK sem sob ane CDATA FIXED simple xml attributes CDATA ISD ticle xl title role xl role http www w3 org TR 1998 WD xlink 19980303 14 di 16 10 05 2001 9 30 10 XML Linking Language XLink Then in the document the following would be recognized as a simple link 8 Conformance An element conforms to XLink if 1 The element has an xm1 link attribute whose value is one of the attribute values prescribed by this specification and 2 the element and all of its attributes and content adhere to the syntactic requirements imposed by the chosen xm1 link attribute value as prescribed in this specification Note that conformance is assessed at the level of individual elements rather than whole XML documents because XLink and non XLink linking mechanisms may be used side by side in any one document An application conforms to XLink if it interprets XLink conforming elements according to all required semantics prescribed by this specification and for any optional semantics it chooses to support supports them in the way prescribed Appendices A Unfinished Work A 1 Structured Titles The simple title mechanism described in this draft is insufficient to cope with internationalization or the use of multimedia in link titles A future version will provide a mechanism for the use of structured link titles B References XPTR Eve
159. by embedding the construct described in the Stylesheet Association Recommendation Recipients and applications can choose to respect or ignore this choice but the declaration indicates that we have tied some http www xml com pub a 2000 08 holman s1 html page 1 2 di 8 10 05 2001 9 02 26 XML com What is XSLT I Aug 16 2000 process typically rendering to our data which specifies how to consume or work with our information 1 1 The XML family of Recommendations Now let s look at the objectives of these selected Recommendations 1 1 1 Extensible Markup Language XML Historically the ways we have expressed created stored and transmitted our electronic information have been constrained and controlled by the vendors we choose and the applications we run Alternatively we now can express our data in a structured fashion oriented around our perspective of the nature of the information itself rather than the nature of an application s choice of how to represent our information With Extensible Markup Language XML we describe our information using embedded markup of elements attributes and other constructs in a tree like structure e http www w3 org TR REC xml 1 1 1 1 Structuring information Contrasted to a file format where information identification relies on some proprietary hidden format predetermined ordering or some kind of explicit labeling the tree like hierarchical storage structure infers relationship
160. can have more than one remote resource it separates out linking itself from the mechanisms used to locate each resource whereas a simple link combines the two The linking element itself retains those attributes relevant to the link as a whole and to its local resource if any Following is a sample declaration for an extended link using the parameter entities provided in 4 1 Information Associated with Links The xm1 1ink attribute value for an extended link must be extended lt ELEMENT extended ANY lt ATTLIST extended a S inte CDATA THe extended link semantics att local resource semantics att Attributes relevant to remote resources are expressed on the corresponding contained locator elements Each remote resource can have its own semantics in relation to the link as a whole Following is a sample declaration for a locator element showing all the possible XLink related attributes it may have using the parameter entities provided in 4 1 Information Associated with Links The xml link attribute value for a locator element must be locator lt ELEMENT locator ANY CIBTTDLISI locator xml Link CDATA E Lee locator ROG teh Eau Pos METER Sremote resource semantics att Following is an example of an out of line extended link lt commentary xml link extended inline false gt lt locator href smith2 1 role Essay gt locator href jones1 4 role Rebuttal gt locator hret robins 2 role Co
161. ce the f zriend of element to be used against characters character lt name gt Snoopy lt name gt lt friend of gt Peppermint Patty lt friend of gt lt since gt 1950 10 04 lt since gt lt qualification gt extroverted beagle http www xml com pub a 2000 1 1 29 schemas part1 html page 6 1 di 2 10 05 2001 9 19 19 XML Products Tools Training O REILLY e XML com Using W3C XML Schema Nov 29 2000 Submissions List lt qualification gt lt character gt gt TOOLBOX To indicate that friend of needs to refer to a character from the same book we Suas Checker write at the same level as we defined our key constraint the following syntax Checker XML Testbed xsd keyref name friendOfIsCharRef refer charNameIsKey xsd selector xpath character SEYBOLD xsd field xpath friend of gt lt xsd keyref gt PUBLICATIONS These capabilities are nearly independent of the other features in a schema They are ro SITE IS ON H H disconnected from the definition of the datatypes The only point anchoring them to the m schema is the place where they are defined which establishes the scope of the T uniqueness constraints o Pages 1 2 3 4 5 6 7 8 9 Next Page gt z9 A TAXI to the Future EN http www xml com pub a 2000 1 1 29 schemas part1 html page 6 2 di 2 10 05 2001 9 19 19 XML com Using W3C XML Schema Nov 29 2000 Ki l DE Find it on t
162. cement text for the entity book is La Peste Albert Camus 1947 Editions Gallimard rights The general entity reference amp rights would be expanded should the reference amp book appear in the document s content or an attribute value These simple rules may have complex interactions for a detailed discussion of a difficult example see D Expansion http www w3 org TR REC xml 29 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition of Entity and Character References 4 6 Predefined Entities Definition Entity and character references can both be used to escape the left angle bracket ampersand and other delimiters A set of general entities amp 1t gt apos quot is specified for this purpose Numeric character references may also be used they are expanded immediately when recognized and must be treated as character data so the numeric character references amp 60 and amp 38 may be used to escape lt and amp when they occur in character data All XML processors must recognize these entities whether they are declared or not For interoperability valid XML documents should declare these entities like any others before using them If the entities 1t or amp are declared they must be declared as internal entities whose replacement text is a character reference to the respective character less than sign or ampersand being escaped the double escaping is required for th
163. cience 120 197 213 1993 U Br ggemann Klein and Wood Br ggemann Klein Anne and Derick Wood Deterministic Regular Languages Universit t Freiburg Institut f r Informatik Bericht 38 Oktober 1991 U Clark James Clark Comparison of SGML and XML See http www w3 org TR NOTE sgml xml 971215 IETF RFC1738 IETF Internet Engineering Task Force RFC 1738 Uniform Resource Locators URL ed T Berners Lee L Masinter M McCahill 1994 U IETF RFC1808 IETF Internet Engineering Task Force RFC 1808 Relative Uniform Resource Locators ed R Fielding http www xml com axml testaxml htm 26 di 34 10 05 2001 9 26 16 The Annotated XML Specification 1995 IETF RFC2141 IETF Internet Engineering Task Force RFC 2141 URN Syntax ed R Moats 1997 U ISO 8879 ISO International Organization for Standardization ISO 8879 1986 E Information processing Text and Office Systems Standard Generalized Markup Language SGML First edition 1986 10 15 Geneva International Organization for Standardization 1986 ISO IEC 10744 ISO International Organization for Standardization ISO IEC 10744 1992 E Information technology Hypermedia Time based Structuring Language HyTime Geneva International Organization for Standardization 1992 Extended Facilities Annexe Geneva International Organization for Standardization 1996 Ui B Character Classes Following the characteristics define
164. clude or ignore the conditional section An example 4 Physical Structures Definition An XML document may consist of one or many storage units These are called entities they all have content and are all except for the document entity and the external DTD subset identified by entity name Each XML document has one entity called the document entity which serves as the starting point for the XML processor and may contain the whole document Entities may be either parsed or unparsed Definition A parsed entity s contents are referred to as its replacement text this text is considered an integral part of the document Definition An unparsed entity is a resource whose contents may or may not be text and if text may be other than XML Each unparsed entity has an associated notation identified by name Beyond a requirement that an XML processor make the identifiers for the entity and notation available to the application XML places no constraints on the contents of unparsed entities Parsed entities are invoked by name using entity references unparsed entities by name given in the value of ENTITY or ENTITIES attributes Definition General entities are entities for use within the document content In this specification general entities are sometimes referred to with the unqualified term entity when this leads to no ambiguity Definition Parameter entities are parsed entities for use within the DTD These two types
165. consider adding to the list please let us know http www cranesoftwrights com training 4 di 5 10 05 2001 9 01 00 Crane Softwrights Ltd Training Programmes and Training Material More Information For more information please see our home page at http www CraneSoftwrights com or email us at training CraneSoftwrights com Date 2001 04 01 00 23 51 UTC http www cranesoftwrights com training 5 di 5 10 05 2001 9 01 00 XML com What is XSLT I Aug 16 2000 XB ERES www xmleurope edil NCE t EXPOSITION 21 25 o 2001 Berlin Germany xml from a inside out XML COM O REILLY NETWORK ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML OREILLY COM W hatus9 XSLI What is XSLT I by G Ken Holman August 16 2000 The Context of XSL Transformations and the Table of Contents XML Path Language This first chapter examines the context of two W3C Recommendations Extensible Stylesheet Language Transformations XSLT and XML Path Language XPath within the growing family of Recommendations related to the Extensible Markup Language XML Later we will look at detailed exampl
166. consortia and the W3C to develop their own vocabularies presents the need to be able to transform information marked up in XML from one vocabulary to another Two W3C Recommendations XSLT the Extensible Stylesheet Language Transformations and XPath the XML Path Language meet that need They provide a powerful implementation of a tree oriented transformation language for transmuting instances of XML using one vocabulary into either simple text the legacy HTML vocabulary or XML instances using any other vocabulary imaginable We use the XSLT language which itself uses XPath to specify how an implementation of an XSLT processor is to create our desired output from our given marked up input http www xml com pub a 2000 08 holman index html 1 di 3 10 05 2001 9 00 38 XML Products Tools Training O REILLY x e 5 Sponsored By XML com What is XSLT Aug 16 2000 ae ae XSLT enables and empowers interoperability This XML com XML Q amp A introduction strives to overview essential aspects of Transforming XML understanding the context in which these languages help us Perl and XML meet our transformation requirements and to introduce substantive concepts and terminology to bolster the GUIDES information available in the W3C Recommendation AER C documents themselves Buyer s Guide Since April 1999 Crane Softwrights Ltd has published Events Calendar commercial training material titled Practical
167. content can be processed without a document type declaration However there are some instances where the declaration is required Authoring Environments Most authoring environments need to read and process document type declarations in order to understand and enforce the content models of the document Default Attribute Values If an XML document relies on default attribute values at least part of the declaration must be processed in order to obtain the correct default values White Space Handling The semantics associated with white space in element content differs from the semantics associated with white space in mixed content Without a DTD there is no way for the processor to distinguish between these cases and all elements are effectively mixed content For more detail see the section called White Space Handling later in this document In applications where a person composes or edits the data as opposed to data that may be generated directly from a database for example a DTD is probably going to be required if any structure is to be guaranteed Including a Document Type Declaration If present the document type declaration must be the first thing in the document after optional processing instructions and comments Section 2 8 The document type declaration identifies the root element of the document and may contain additional declarations All XML documents must have a single root element that contains all o
168. ction gt lt xsd simpleType gt lt xsd simpleType gt lt xsd restriction base xsd NMTOKEN gt lt xsd enumeration value TBD gt lt xsd enumeration value NA gt lt xsd restriction gt lt xsd simpleType gt lt xsd union gt lt xsd simpleType gt The union has been applied on the two embedded simple types to allow values from both datatypes In addition to ten digit strings our new datatype will now accept the values from an enumeration with two possible values TBD and NA The following example type isbnTypes uses xsd list to define a whitespace separated list of ISBN values It also derives a type isbnTypes8 using xsd restriction that accepts between one and eight ISBN numbers separated by whitespace xsd simpleType name isbnTypes gt xsd list itemType isbnType gt lt xsd simpleType gt lt xsd simpleType name isbnTypes8 gt lt xsd restriction base isbnTypes gt xsd minLength value 1 gt xsd maxLength value 8 gt lt xsd restriction gt lt xsd simpleType gt Pages 1 2 3 4 5 6 7 8 9 Next Page gt A IrDA Syncing for Palms and Visors Find it on the O Reilly Network http www xml com pub a 2000 1 1 29 schemas part1 html page 4 2 di 2 10 05 2001 9 18 43 XML com Using W3C XML Schema Nov 29 2000 O REILLY e xml from the inside out RESOURCE gt CENTERS O REILLY NETWORK ONJAVA COM Business Graphics Metadata
169. cts Reusable Schemas Until now we have omitted the target Namespace Namespaces attribute which means that we were working without W3C XML Schema and namespaces To get into namespaces let s imagine that our Instance Documents example belongs to a single namespace W3C XML Schema book isbn 0836217462 xmlns http exa4upkgpes RedteHda Oks Tools The least intrusive way to adapt our schema is to add more W3C XML Schema attributes to our xsd schema element Structures Reference Training lt xsd schema xmlns xsd http www w3 org 2000 10 XMLSchema xmlns http example org ns books targetNamespace http example org ns books elementFormDefault qualified attributeFormDefault unqualified gt The namespace declarations play an important role The first xmlns xsd http www w3 org 2000 10 XMLSchema says not only that we ve chosen to use the prefix xsd to identify the elements that will be W3C XML Schema instructions but also that we will prefix the W3C XML Schema predefined datatypes with xsd as we have done in all our examples thus far Understand that we could have chosen any prefix instead of xsd We could even make http www w3 org 2000 10 XMLSchema our default namespace In this case we would not have prefixed the W3C XML Schema elements Since we are working with the http example org ns books namespace we define it as our default namespace This means that we won t pref
170. cts or portions they connect in terms of significance to the author and user Some links may be criticisms others add support or background while still others might provide access to demographic information about http www w3 org TR 1998 WD xlink 19980303 7 di 16 10 05 2001 9 30 10 XML Linking Language XLink a data object its author s name version number etc or to navigational tools such as index glossary and summary To indicate the part that a link plays in representing information a link author can optionally provide a string identifying the link s role The role is indicated with an attribute called role Note that each resource participating in a link may also be given its own role as described in 4 1 3 Remote Resource Semantics Following are sample declarations of these attributes enclosed ina 1ink semantics att parameter entity Because simple links have an attribute called role that has a different function they cannot have a role attribute for link semantics Following is a simple link semantics att parameter entity declaration for use in simple linking elements 4 1 3 Remote Resource Semantics The following semantic information can be provided for the remote resources of a link e The role of the resource to identify to application software the part it plays in the link Note that a link as a whole may also be given its own role as described in 4 1 2 Link Semantics A link author can optionally
171. d Parsed Entity and No Recursion as well as some of the cases described as forbidden in 4 4 XML Processor Treatment of Entities and References e The information passed from the processor to the application may vary depending on whether the processor reads parameter and external entities For example a non validating processor may not normalize attribute values include the replacement text of internal entities or supply default attribute values where doing so depends on having read declarations in external or parameter entities For maximum reliability in interoperating between different XML processors applications which use non validating processors should not rely on any behaviors not required of such processors Applications which require facilities such as the use of default attributes or internal entities which are declared in external entities should use validating XML processors 6 Notation The formal grammar of XML is given in this specification using a simple Extended Backus Naur Form EBNF notation Each rule in the grammar defines one symbol in the form symbol expression Symbols are written with an initial capital letter if they are the start symbol of a regular language otherwise with an initial lower case letter Literal strings are quoted Within the expression on the right hand side of a rule the following expressions are used to match strings of one or http www w3 org TR REC xml 31 di 41 10 05 20
172. d Organizing Directorate at www GOD org it Things Schemas would think up a set of lookup fields such as Author Title Date It s All Different Behind the Style Subject and so on The Directorate being after all GOD would Scares Web simply decree that all Web pages start using this divine Metadata ind lh _ and that would be that Of course there would be some details such as OL Naet Eee MPH ESSENTIALS how the Web sites ought to package up and interchange the metadata What About the Web and we all know that the Devil is in the details but GOD can lick the Divine Metadata for the Annotated SNL Devil any day Web What is XML Introducing RDF What is XSLT In fact there is no www GOD org For this reason there is no chance Why Not Just Use XML What is XLink that everyone will agree to start using the same metadata facilities If The Desde fuv the Details What is XML Schema libraries which have existed for hundreds of years can t agree on a What is RDE E single standard there s not much chance that the Web will beer ee aT Products wee ie ae n A What ight Mean Does this mean that there is no chance for metadata That everyone Getting started with RDF Ad d Feat is going to have to build their own lookup keys and values and Delors Caan SE JSP ei software and that we re going to be stuck using dumb brute force j Tools Tag Libraries robots forever No As we observed with our three search scenarios meta
173. d a number of constructs supporting the management maintenance and exploitation of existing stylesheets Organizations can build libraries of stylesheet components for sharing among their colleagues Stylesheet writers can tweak the results of a transformation by writing shell specifications that include or import other stylesheets known to solve problems they are addressing Stylesheet fragments can be written for particular vocabulary fragments these fragments can subsequently be used in concert as part of an organization s strategy for common information description in numerous markup models 1 1 5 2 Not intended for general purpose XML transformations It is important to remember that XSLT was designed primarily for transforming XML vocabularies to the XSL formatting vocabulary This doesn t preclude us from using XSLT for other transformation requirements but it does influence the design of the language and it does constrain some of the functionality from being truly general purpose For this reason the designers do not claim XSLT is a general purpose transformation language However it is still powerful enough for most downstream processing transformation needs and XSLT stylesheets are often called XSLT transformation scripts because they can be used in many areas not at all related to stylesheet rendering Consider an electronic commerce environment where transformation is not used for presentation purposes In this case the XSLT processor
174. d complexType In order to avoid combinations that could become ambiguous or too complex to be solved by W3C XML Schema tools a set of restrictions has been added to the xsd all particle e they can appear only as a unique child at the top of a content model e and their children can be only xsd element definitions or references and cannot have a cardinality greater than one Derivation of simple types Simple datatypes are defined by derivation from other datatypes either predefined and identified by the W3C XML Schema namespace or defined elsewhere in your schema We have already seen examples of simple types derived by restriction using xsd restriction elements The different kind of restrictions that can be applied on a datatype are called facets Beyond the xsd pattern using a regular expression syntax and xsd maxLength facets shown already many facets allow constraints on the length of a value an enumeration of the possible values the minimal and maximal values precision and scale period and duration etc Two other derivation methods are available that allow the definition of whitespace separated lists and union of datatypes The following definition uses xsd union and extends the definition of our type for ISBN to accept the values TBD and NA xsd simpleType name isbnType gt lt xsd union gt lt xsd simpleType gt lt xsd restriction base xsd string gt xsd pattern value 0 9 10 gt lt xsd restri
175. d element gt You may wonder why we ve chosen to reference the xm1 Lang attribute from the XML namespace rather than creating an attribute with a type xm1 lang We ve done so because there is an important difference between referencing an attribute or an element and referencing a datatype when namespaces are concerned e Referencing an element or an attribute imports the whole thing with its name and namespace e Referencing a datatype imports only its definition leaving you with the task of giving a name to the element or attribute you re defining and places your definition in the target namespace or no namespace if your attribute or element is unqualified Including unknown elements To finish this section about namespaces we need to see how as promised in the introduction we can open our schema to unknown elements attributes and namespaces This is done using xsd any and xsd anyAttribute allowing respectively the inclusion of any element or attribute For instance if we want to extend the definition of our description type to any XHTML tag we could declare xsd complexType name descType mixed true gt lt xsd sequence gt xsd any namespace http www w3 0rg 1999 xhtml minOccurs 0 maxOccurs unbounded processContents skip xsd sequence xsd complexType The xsd anyAttribute gives the same functionality for attribute definitions The type descType is now mixed content and accepts an unb
176. d in the Unicode standard characters are classed as base characters among others these contain the alphabetic characters of the Latin alphabet without diacritics ideographic characters and combining characters among others this class contains most diacritics these classes combine to form the class of letters Digits and extenders are also distinguished Characters 84 Letter BaseChar Ideographic 85 BaseChar x0041 x005A x0061 x007A Ui x00C0 4x00D6 x00D8 x00F6 xOOF8 x00FF U x0100 x0131 X0134 x013E x0141 4x0148 x014A 4 x017E x0180 x01C3 x01CD x01F0 XO1F4 x01F5 XO1FA x0217 xXx0250 x02A8 x02BB x02C1 U x0386 x0388 x038A xO SSE x038E x03A1 X03A3 x03CE x03D0 4x03D6 x03DA x03D x03DE x03E x03E2 x03F3 U x0401 x040C x040E 4x044F x0451 x045C x045E x0481 x0490 x04C4 x04C7 x04C8 x04CB x04CC x04D0 4x04EB x04EE x04F5 x04F8 x04F9 j x0531 x0556 x0559 x0561 x0586 iU x05D0 x05EA x05F0 x05F2 x0621 x063A x0641 x064A x06771 x06B7 x06BA x06BE x06C0 x06CE x06D0 x06D3 x06D5 e 0 http www xml com axml testaxml htm 27 di 34 10 05 2001 9 26 16 The Annotated XML Specification X06E5 x06E6 Jil PROTOS x OS 9 x093D x0958 x0961 Ui x0985 4x098C x098F x0990 x0993 x09A8 x0 9AA x09BO0 Fx09B2 x09B6 x09B9 x09DC 4x
177. d tags empty element tags entity references character references comments CDATA section delimiters document type declarations and processing instructions Definition All text that is not markup constitutes the character data of the document The ampersand character amp and the left angle bracket lt may appear in their literal form only T when used as markup delimiters or within a comment a processing instruction or a CDATA section They are also legal within the literal entity value of an internal entity declaration see 4 3 2 Well Formed Parsed Entities If they are needed elsewhere they must be escaped using either numeric character references or the strings amp amp and amp 1t respectively The right angle bracket gt may be represented using the string amp gt and must T for compatibility be escaped using amp gt or a character reference when it appears in the string gt in content when that string is not marking the end of a CDATA section In the content of elements character data is any string of characters which does not contain the start delimiter of any markup In a CDATA section character data is any string of characters not including the CDATA section close delimiter gt To allow attribute values to contain both single and double quotes the apostrophe or single quote character may be represented as amp apos and the double quote character as amp
178. data operations have an awful lot in Training lj common even when the metadata is different RDF is an effort to identify these common threads and provide a way for Web architects to use them to provide useful Web metadata without divine O REILLY Find it at ONJava com imtervention x e y FIND Introducing RDF Search Resource Description Framework as its name implies is a framework for describing and Article Archive interchanging metadata It is built on the following rules FAQs 1 A Resource is anything that can have a URI this includes all the Web s pages as well as individual elements of an XML document An example of a resource is a draft of the document Add the latest news you are now reading and its URL is http www textuality com RDF Why html from XML com 2 A Property is a Resource that has a name and can be used as a property for example Author your web site c D or Title In many cases all we really care about is the name but a Property needs to be a Click here resource so that it can have its own properties prop COLUMNS 3 A Statement consists of the combination of a Resource a Property and a value These parts are known as the subject predicate and object of a Statement An example Statement is XML Deviant The Author of http www textuality com RDF Why html is Tim Bray The Style Matters value can just be a string for example Tim Bray in the previous example or it can be another
179. date brings the article back into line with the final spec a new series of recommendations are under development When finished these will bring namespaces linking schemas stylesheets and more to the table XML What s a Document So XML is Just Like HTML So XML Is Just Like SGML http www xml com pub a 98 10 guideO html 1 di 3 10 05 2001 9 27 20 O REILLY CONVENTION conferences oreilly com INNOVATE COLLABORATE DISCOVER Sponsored By XML com A Technical Introduction to XML Oct 03 1998 Add the latest mews from XML com to gt COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUELICATIONS THIS SITE IS ON THE Why XML XML Development Goals How Is XML Defined Understanding the Specs what Do XML Documents Look Like Elements Entity References Comments Processing Instructions CDATA Sections Document Type Declarations Other Markup Issues vatiaity Well formed Documents Valid Documents puning the Pieces Together Simple Links Extended Links Extended Pointers Extended Link Groups Understanding The Pieces Style and Substance Conclusion E Appendix Extended Backus Naur Form EBNF Revision History Sponsored By http www xml com p
180. decl AttlistDecl VC Proper Declaration PE Nesting EntityDecl NotationDecl PI Comment WEC PEs in Internal Subset Note that it is possible to construct a well formed document containing a doctypedecl that neither points to an external subset nor contains an internal subset The markup declarations may be made up in whole or in part of the replacement text of parameter entities The productions later in this specification for individual nonterminals elementdecl AttlistDecl and so on describe the declarations after all the parameter entities have been included Parameter entity references are recognized anywhere in the DTD internal and external subsets and external parameter entities except in literals processing instructions comments and the contents of ignored conditional sections see 3 4 Conditional Sections They are also recognized in entity value literals The use of parameter entities in the internal subset is restricted as described below Validity constraint Root Element Type The Name in the document type declaration must match the element type of the root element Validity constraint Proper Declaration PE Nesting Parameter entity replacement text must be properly nested with markup declarations That is to say if either the first character or the last character of a markup declaration markupdecl above is contained in the replacement text for a parameter entity reference both must be contained in the sam
181. describes the behavior required of an XML processor acting on an XML stream and how it must identify constituent data and provide that data to an application using the processor Since there are no formalized semantic description facilities in XML any XML that is used is not tied to any one particular concept or application There are no rendition or transformation rules or constructs defined in XML The only purpose of XML is to unambiguously identify and deliver constituent components of data There are no inherent meanings or semantics of any kind associated with element types defined in a document model There are no defined controls for implying any rendering semantics Even the xm1 space attribute allowing for the differentiation of whitespace found in a document is not an aspect of rendering but of information description The author or modeler of an instance is indicating with this reserved attribute termed special in XML 1 0 the nature of the information and how the whitespace found in the information is to be either preserved or handled by a processor in a default fashion Some new users of XML who have a background in a markup language such as HTML often assume a magical association of semantics with element types of the same names they have been exposed to in their prior work In a web page they can safely assume that the construct lt p gt will be interpreted as a paragraph or lt em gt as emphasized text However this int
182. diagram below illustrates the composition of an extended link http www xml com pub a 2000 09 xlink index html page 3 3 di 5 10 05 2001 9 11 35 XML com What is XLink Sep 18 2000 One can simply consider the extended link elements as meaningful wrappers that provide a nest for resources and arcs lt ELEMENT divas actress movie acted gt lt ATTLIST divas xmlns xlink CDATA FIXED http www w3 0rg 1999 xlink xlink type extended FIXED extended xlink title CDATA IMPLIED gt Putting together all the previous elements we finally have a complete and valid extended link Note in particular the one to many link that has been generated something previously not possible in HTML lt divas xlink title German divas 1920s gt lt actress xlink label maria gt lt first_name gt Brigitte lt first_name gt lt surname gt Helm lt surname gt lt actress gt movie xlink label silent xlink title Metropolis xlink href metropolis xml gt movie xlink label silent xlink title Alaraune xlink href alaraune xml acted xlink type arc xlink from maria xlink to silent gt divas Title elements An alternative way to provide titles to extended locator and arc type elements is by using a fitle type subelement xlink type title This was included in order to have a standard way for applications to express complex titles that include more than a string For
183. dized fashion These elements use namespace prefixes declared by our stylesheets to be instruction prefixes Extension instructions may be either control constructs or result tree value placeholders Consider the simple example in our stylesheets used earlier in this chapter where the following instruction is used 01 lt xsl value of select greeting gt Example 2 9 Simple value calculation instruction in Example 2 4 This instruction uses the select attribute to specify the XPath expression of some value to be calculated and added to the result tree When the expression is a location in the source tree as is this example the value returned is the value of the first location identified using the criteria When that location is an element the value returned is the concatenation of all of the PCDATA text contained therein This example instruction is executed in the context of the root of the source document being the focus The child of the root of the document is the document element The expression requests the value of the child named greeting of the root of the document hence the value of the document element named greeting For http www xml com pub a 2000 08 holman s2_1 html page 3 4 di 8 10 05 2001 9 08 04 XML com Getting started with XSLT and XPath Aug 23 2000 any source document where greeting is not the document element the value returned is the empty string For any source document where it is the doc
184. e e http www w3 org TR REC xml names e http www megginson com docs namespaces namespace questions html 1 1 6 1 Vocabulary distinction http www xml com pub a 2000 08 holman s1 html page 2 13 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 It would be unreasonable to mandate that all document models have mutually unique element type names We design our document models with our own business requirements and our own naming conventions so do other users A W3C working group developing vocabularies has its own conventions and requirements so do other committees An XML based application knowing that an instance is using element types from only a single vocabulary can easily distinguish all elements by the name since each element type is declared in the model by its name But what happens when we need to create an XML instance that contains element types from more than one vocabulary If all the element types are uniquely named then we could guess the vocabulary for a given element by its name But if the same name is used in more than one vocabulary we need a technique to avoid ambiguity Using cryptically compressed or unmanageably elongated element type names to guarantee uniqueness would make XML difficult to use and would only delay the problem to the point that these weakened naming conventions would still eventually result in vocabulary collisions Note 9 Enter the dreaded namespaces a Recomm
185. e as defined in IETF RFC 2396 updated by IETF RFC 2732 meant to be dereferenced to obtain input for the XML processor to construct the entity s replacement text It is an error for a fragment identifier beginning with a character to be part of a system identifier Unless otherwise provided by information outside the scope of this specification e g a special XML element type defined by a particular DTD or a processing instruction defined by a particular application specification relative URIs are relative to the location of the resource within which the entity declaration occurs A URI might thus be relative to the document entity to the entity containing the external DTD subset or to some other external parameter entity URI references require encoding and escaping of certain characters The disallowed characters include all non ASCII characters plus the excluded characters listed in Section 2 4 of IETF RFC 2396 except for the number sign 4 and percent sign characters and the square bracket characters re allowed in IETF RFC 2732 Disallowed characters must be escaped as follows 1 Each disallowed character is converted to UTF 8 IETF RFC 2279 as one or more bytes 2 Any octets corresponding to a disallowed character are escaped with the URI escaping mechanism that is converted to HH where HH is the hexadecimal notation of the byte value 3 The original character is replaced by the resulting char
186. e like any other must be http Awww w3 org TR REC xml 12 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition declared if it is used The values of the attribute are language identifiers as defined by IETF RFC 1766 Tags for the Identification of Languages or its successor on the IETF Standards Track Note IETF RFC 1766 tags are constructed from two letter language codes as defined by ISO 639 from two letter country codes as defined by ISO 3166 or from language identifiers registered with the Internet Assigned Numbers Authority ANA LANGCODES It is expected that the successor to IETF RFC 1766 will introduce three letter language codes for languages not presently covered by ISO 639 Productions 33 through 38 have been removed For example lt p xml lang en gt The quick brown fox jumps over the lazy dog lt p gt lt p xml lang en GB gt What colour is it lt p gt lt p xml lang en US Nhac color is it lt p gt lt sp who Faust desc leise xml lang de gt l Habe nun ach Philosophie lt 1 gt l Juristerei und Medizin lt 1 gt l und leider auch Theologie lt 1 gt lt l gt durchaus studiert mit hei em Bem h n l d cera The intent declared with xml lang is considered to apply to all attributes and content of the element where it is specified unless overridden with an instance of xm1 Lang on another element within that content
187. e xsd string gt xsd pattern value 0 9 10 gt lt xsd restriction gt lt xsd simpleType gt lt definition of complex types gt xsd complexType name characterType gt lt xsd sequence gt lt xsd element name name type nameType gt lt xsd element name friend of type nameType minOccurs 0 maxOccurs unbounded gt lt xsd element name Since type sinceType gt lt xsd element name qualification type descType gt lt xsd sequence gt lt xsd complexType gt lt xsd complexType name bookType gt lt xsd sequence gt lt xsd element name title type nameType gt lt xsd element name author type nameType the definition of the character element is u e sing the characterType complex type gt lement name character type characterType minOccurs 0 maxOccurs unbounded gt xsd sequence xsd attribute name isbn type isbnType use required xsd complexType xsd Reference to bookType to define the book element gt lt xsd element name book type bookType lt xsd schema gt Download this schema The next page shows how grouping compositors and derivation can be used to further promote re use and structure in schemas Pages 1 2 3 4 5 6 7 8 9 Next Page gt TREX An Alternative Find it on XML Schema Language Contact Us Our Mission Privacy Policy Advertise
188. e could on the other hand wish to control derivation performed on a datatype W3C XML Schema supports this though the final attribute in an xsd complexType or xsd element element This attribute can take the values restriction extension and all to block derivation by restriction extension or any derivation The following snippet would for instance forbid any derivation of the characterType complex type xsd complexType name characterType final all gt The final attribute can operate only on elements and complex types W3C XML Schema provides a fine grained mechanism that operates on each facet to control the derivation of simple types This attribute is called ixed and when its value is set to true the facet cannot be further modified but other facets can still be added or modified The following prevents the size of our nameType simple type from being redefined xsd simpleType name nameType gt xsd restriction base xsd string gt xsd maxLength value 32 fixed true xsd restriction xsd simpleType Pages 1 2 3 4 5 6 7 8 9 Next Page of Streaming Media http www xml com pub a 2000 1 1 29 schemas part1 html page 7 2 di 2 10 05 2001 9 19 36 XML com Using W3C XML Schema Nov 29 2000 O REILLY o xml from the inside out XML COM O REILLY NETWORK ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas
189. e first edition errata available at http www w3 org XML xml 19980210 errata as a convenience to readers The errata list for this second edition is available at http www w3 org XML xml V 10 2e errata Please report errors in this document to xml editor w3 org archives are available Note C M Sperberg McQueen s affiliation has changed since the publication of the first edition He is now at the World Wide Web Consortium and can be contacted at cmsmcq 9 w3 org Table of Contents Introduction 1 1 Origin and Goals 1 2 Terminology 2 Documents 2 1 Well Formed XML Documents 2 2 Characters 2 3 Common Syntactic Constructs 2 4 Character Data and Markup 2 5 Comments 2 6 Processing Instructions 2 7 CDATA Sections 2 8 Prolog and Document Type Declaration 2 9 Standalone Document Declaration 2 10 White Space Handling 2 11 End of Line Handling 2 12 Language Identification 3 Logical Structures 3 Start Tags End Tags and Empty Element Tags 3 2 Element Type Declarations 3 2 1 Element Content 3 2 2 Mixed Content 3 3 Attribute List Declarations 3 3 1 Attribute Types 3 3 2 Attribute Defaults 3 3 3 Attribute Value Normalization 3 4 Conditional Sections 4 Physical Structures 4 Character and Entity References 4 2 Entity Declarations 4 2 1 Internal Entities 4 2 2 External Entities 4 3 Parsed Entities 4 3 1 The Text Declaration 4 3 2 Well Formed Parsed Entities 4 3 3 Character Encoding in Entities 4 4 XML Proce
190. e following e in line 4 the reference to character 37 is expanded immediately and the parameter entity xx is stored in the symbol table with the value z z Since the replacement text is not rescanned the reference to parameter entity zz is not recognized And it would be an error if it were since zz is not yet declared e in line 5 the character reference 160 1s expanded immediately and the parameter entity zz is stored with the replacement text lt ENTITY tricky error prone gt which is a well formed entity declaration e in line 6 the reference to xx is recognized and the replacement text of xx namely z z is parsed The reference to zz is recognized in its turn and its replacement text lt ENTITY tricky error prone is parsed The general entity tricky has now been declared with the replacement text error prone e in line 8 the reference to the general entity tricky is recognized and it is expanded so the full content of the test element is the self describing and ungrammatical string This sample shows a error prone method E Deterministic Content Models Non Normative As noted in 3 2 1 Element Content it is required that content models in element type declarations be deterministic This requirement is for compatibility with SGML which calls deterministic content models unambiguous XML processors built using SGML systems may flag non deterministic content models
191. e needs of each audience Perhaps some information needs to be rearranged to make more sense for the reader Perhaps some information needs to be highlighted differently to bring focus to key content It is important when we think about styling information to remember that two distinct processes are involved not just one First we must transform the information from the organization used when it was created into the organization needed for consumption Second when rendering we must express whatever the target medium the aspects of the appearance of the reorganized information Consider the flow of information as a streaming process where information is created upstream and processed or consumed downstream Upstream in the early stages we should be expressing the information abstractly thus preventing any early binding of concrete or final form concepts Midstream or even downstream we http www xml com pub a 2000 08 holman s1 html page 2 1 di 19 10 05 2001 9 03 31 The context of XSL e Print This Article O REILLY CONVENTION Table of Contents Transformations and the XML Path Language 1 The XML family of Recommendations 1 1 1 Extensible Markup 1 1 2 XML Path Language 1 1 3 Styling structured 1 1 4 Extensible Stylesheet 1 1 5 Extensible Stylesheet 1 1 6 Namespaces 1 1 7 Stylesheet association 2 Transformation data Language XML XPath information
192. e replacement text Well formedness constraint PEs in Internal Subset In the internal DTD subset parameter entity references can occur only where markup declarations can occur not within markup declarations This does not apply to references that occur in external parameter entities or to the external subset Well formedness constraint External Subset The external subset if any must match the production for extSubset Well formedness constraint PE Between Declarations The replacement text of a parameter entity reference in a DeclSep must match the production extSubsetDecl Like the internal subset the external subset and any external parameter entities referenced in a DeclSep must consist of a series of complete markup declarations of the types allowed by the non terminal symbol markupdecl interspersed with white space or parameter entity references However portions of the contents of the external subset or of these external parameter entities may conditionally be ignored by using the conditional section construct this is not allowed in the internal subset External Subset http www w3 org TR REC xml 10 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition 30 extSubset m TextDecl extSubsetDecl 31 extSubsetDecl 2 markupdecl conditionalSect DeclSep The external subset and external parameter entities also differ from the internal subset in that in them
193. e section on entity declarations In order to use an entity you simply reference it by name Entity references begin with the ampersand and end with a semicolon For example the 1t entity inserts a literal into a document So the string element can be represented in an XML document as amp 1t element A special form of entity reference called a character reference Section 4 1 can be used to insert arbitrary Unicode characters into your document This is a mechanism for inserting characters that cannot be typed directly on your keyboard Character references take one of two forms decimal references amp 4 8478 and hexadecimal references amp x211E Both of these refer to character number U 211E from Unicode which is the standard Rx prescription symbol in case you were wondering Comments Comments begin with lt and end with gt Comments can contain any data except the literal string You can place comments between markup anywhere in your document Comments are not part of the textual content of an XML document An XML processor is not required to pass them along to an application Processing Instructions Processing instructions PIs are an escape hatch to provide information to an http www xml com pub a 98 10 guide2 html 2 di 10 10 05 2001 9 28 30 XML com What Do XML Documents Look Like Oct 03 1998 application Like comments they are not textually part of the XML docum
194. e specify on line 10 wraps our source information in the HTML elements without the boilerplate used in the previous example Line 13 ends the formal specification of the stylesheet content Using an MS DOS command line invocation to execute the XT processor we see the following result X samp gt xt hello xml hello xsl hello htm X samp gt type hello htm lt b gt lt i gt lt u gt Hello world lt u gt lt i gt lt b gt X samp gt Example 2 5 Explicit invocation of Example 2 4 Using a non XML aware browser to view the resulting HTML in Example 2 5 we see the following on the canvas the child window is opened using the View Source menu item http www xml com pub a 2000 08 holman s2_1 html 4 di 6 10 05 2001 9 06 12 XML com Getting started with XSLT and XPath Aug 23 2000 yix Netscape file x27C samp hello htm File Edit View Go Bookmarks Options Directory Window Help Location ffile 7C samp hello htm Hello world vx Netscape Source of file x 7C samp hello htm Pie E3 lt b gt lt i gt lt u gt Hello world lt u gt lt i gt lt b gt Using an XML aware browser recognizing the W3C stylesheet association processing instruction in Example 2 1 the canvas is painted with the HTML resulting from application of the stylesheet the child window is opened using the View Source menu item E X samp hello xml Microsoft Internet Explorer Helio worid CRIT E hello xml Notepad 00
195. e to serialize a non XML representation of the result tree transformation transformation XSLT Process source source document document document document Figure 1 5 Transformation from XML to Aware Non XML The XSLT Recommendation documents two non XML tree serialization methods that can be requested by the stylesheet writer When the processor offers serialization it is only obliged to reify the result using XML lexical and syntax rules and may support producing output following either HTML lexical and syntax rules or simple text http www xml com pub a 2000 08 holman s1 html page s3 4 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 1 2 3 1 HTML lexical and syntactic conventions Internet web browsers are specific examples of the generic HTML user agent User agents are typically designed for instances of HTML following the precursor to XML the Standard Generalized Markup Language SGML lexical conventions Certain aspects of the HTML document model also dictate syntactic shortcuts available when working with SGML While some more recently developed user agents will accept XML lexical conventions thus accepting Extensible Hypertext Markup Language XHTML output from an XSLT processor older user agents will not Some of these user agents will not accept XML lexical conventions for empty elements while some require SGML syntax minimization techniques to compress certain attribute specifications
196. e value of an ENTITY or ENTITIES attribute If the same entity is declared more than once the first declaration encountered is binding at user option an XML processor may issue a warning if entities are declared multiple times 4 2 1 Internal Entities Definition If the entity definition is an EntityValue the defined entity is called an internal entity There is no separate physical storage object and the content of the entity is given in the declaration Note that some processing of entity and character references in the literal entity value may be required to produce the correct replacement text see 4 5 Construction of Internal Entity Replacement Text An internal entity is a parsed entity Example of an internal entity declaration 4 2 2 External Entities Definition If the entity is not internal it is an external entity declared as follows External Entity Declaration 75 ExternalID SYSTEM S SystemLiteral PUBLIC S PubidLiteral S SystemLiteral 76 NDataDecl zu S NDATA S Name VC Notation Declared If the NDataDecl is present this is a general unparsed entity otherwise it is a parsed entity http Awww w3 org TR REC xml 24 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition Validity constraint Notation Declared The Name must match the declared name of a notation Definition The SystemLiteral is called the entity s system identifier It is a URI referenc
197. ecified to further refine the nature of the components of our information being addressed 01 select question 3 answer 1 Example 1 5 A multiple step XPath expression in a select attribute The above example selects only the first answer child of the third question child of the focus element 01 select id start question answer y Example 1 6 A more complex XPath expression in a select attribute The above example uses an XPath address identifying some descendants of the element in the instance that has the unique identifier with the value start Those identified are the question elements whose answer attribute is equal to the string equal to the lower case letter y The value returned is the set of nodes representing the elements meeting the conditions expressed by the address The address is used in a select attribute thus the XSLT processor is selecting all of the addressed elements for some kind of processing 1 1 2 3 XPath is not a query language It is important to remember that addressing information is only one aspect of querying information Other aspects include query operators that massage intermediate results into a final result While a few operators and functions are available in XSLT to use values identified in documents these are oriented to string processing not to complex operations required by some applications Note 3 When query Recommendations are developed I would hope that the
198. eclaration is provided but this is not an error T Definition An element type declaration takes the form where the Name gives the element type being declared H Validity Constraint Unique Element Type Declaration No element type may be declared more than once D Examples of element type declarations 3 2 1 Element Content Definition An element type has element content when elements of that type must contain only child elements no character data optionally separated by white space characters matching the nonterminal S In this case the constraint includes a content model a simple grammar Ji governing the allowed types of the child elements and the order in which they are allowed to appear The grammar is built on content particles cps which consist of names choice lists of content particles or sequence lists of content particles where each Name is the type of an element which may appear as a child Any content particle in a choice list may appear in the element content at the location where the choice list appears in the grammar content particles occurring in a sequence list must each appear in the element content in the order given in the list The optional http Awww xml com axml testaxml htm 13 di 34 10 05 2001 9 26 16 The Annotated XML Specification character following a name or list governs whether the element or the content particles in the list may occur one or more zero or more
199. ed XML Specification D Expansion of Entity and Character References Non Normative This appendix contains some examples illustrating the sequence of entity and character reference recognition and expansion J as specified in 4 4 XML Processor Treatment of Entities and References If the DTD contains the declaration then the XML processor will recognize the character references when it parses the entity declaration and resolve them before storing the following string as the value of the entity example A reference in the document to amp example will cause the text to be reparsed at which time the start and end tags of the p element will be recognized and the three references will be recognized and expanded resulting in a p element with the following content all data no delimiters or markup A more complex example will illustrate the rules and their effects fully In the following example the line numbers are solely for reference This produces the following e in line 4 the reference to character 37 is expanded immediately and the parameter entity xx is stored in the symbol table with the value zz Since the replacement text is not rescanned the reference to parameter entity zz is not recognized And it would be an error if it were since zz is not yet declared e in line 5 the character reference amp 60 is expanded immediately and the parameter entity zz is stored with the r
200. ed for XSLT instructions though http www xml com pub a 2000 08 holman s2 1 html page 1 2 di 6 10 05 2001 9 06 36 a XML com Getting started with XSLT and XPath Aug 23 2000 THIS SITE IS ON convention often sees xs1 as the prefix value Line 7 contains the only XSLT instruction in the instance The xs1 value of instruction uses an XPath expression in the select attribute to calculate a string value from our source information XPath views the source hierarchy using parent child relationships The XSLT processor s initial focus is the root of the document which is considered the parent of the document element Our XPath expression value greeting selects the child named greeting from the current focus thus returning the value of the document element named greeting from the instance Using an MS DOS command line invocation to execute the standalone processor we see the following result X Nsamp xt hello xml hellohtm xsl hellohtm htm X samp gt type hellohtm htm html head lt title gt Greeting lt title gt lt head gt lt body gt lt p gt Words of greeting lt br gt lt b gt lt i gt lt u gt Hello world lt u gt lt i gt lt b gt lt p gt lt body gt lt html gt X samp gt Example 2 3 Explicit invocation of Example 2 2 Note how the end result contains a mixture of the stylesheet markup and the source instance content without any use of the XSLT vocabulary The pr
201. ed if its replacement text matches the production labeled content J All internal parameter entities are well formed by definition A consequence of well formedness in entities is that the logical and physical structures in an XML document are properly nested no start tag end tag empty element tag element comment processing instruction character reference or entity reference can begin in one entity and end in another 4 3 3 Character Encoding in Entities Each external parsed entity in an XML document may use a different encoding for its characters All XML processors must be able to read entities in either UTF 8 or UTF 16 qm Entities encoded in UTF 16 must begin with the Byte Order Mark described by ISO IEC 10646 Annex E and Unicode Appendix B the ZERO WIDTH NO BREAK SPACE character xFEFF This is an encoding signature not part of either the markup or the character data of the XML document XML processors must be able to use this character to differentiate between UTF 8 and UTF 16 encoded documents T Although an XML processor is required to read only entities in the UTF 8 and UTF 16 encodings it is recognized that other encodings are used around the world and it may be desired for XML processors to read entities that use them Parsed entities which are stored in an encoding other than UTF 8 or UTF 16 must begin with a text declaration containing an encoding declaration T Encoding Declaration 80 EncodingDecl S
202. ed or expected relationships between components of a hypertext document There is an implicit document model for an instance of well formed http www xml com pub a 2000 08 holman s1 html 3 di 8 10 05 2001 9 01 41 XML com What is XSLT I Aug 16 2000 XML defined by the mere presence of nested elements found in the information There is no need to declare this model because the syntax rules governing well formedness guarantee the information to be seen properly as a hierarchy As with all hierarchies there are family tree like relationships of parent child and sibling constructs relative to each construct found Consider the following well formed XML instance purc xml swa wersiom 1 0 2x lt purchase id p001 gt lt customer db cust123 gt lt product db prod345 gt lt amount gt 23 45 lt amount gt lt product gt lt purchase gt Example 1 1 A well formed XML purchase order instance Observe the content nesting whitespace has been added only for illustrative purposes The instance follows the lexical rules for XML markup and the hierarchical model is implicit by the nesting of elements Pay particular attention to the markup on line 3 for the empty element named customer with the attribute named db It will be used later in examples throughout this chapter The customer element is a child of the document element which is named purchase Although the presence of an explicit formal doc
203. eferenced perhaps a few pointer documents to specifications or user help information and any other piece of helpful information deemed suitable for the public consumption This convention should help clear up many misperceptions about the URI being used to obtain some kind of machine readable resource or schema though it will not dispel the misperception that there needs to be some resource of some kind at the URL represented by a namespace URI So now a processor can unambiguously distinguish an element s type as being from a particular vocabulary by knowing the URI associated with the vocabulary Our choice of prefix is arbitrary and of no relevance The URI we have associated with the prefix used in a namespace qualified XML name often called a QName informs the processor of the identity of the name Our choice of prefix is used and then discarded by the processor while the URI persists and is the basis of namespace aware processing We have achieved uniqueness and identity in our element type names and other XML names in a succinct legible fashion without violating the lexical naming rules of XML 1 1 6 3 Namespaces in XSL and XSLT Namespaces identify different constructs for the processors interpreting XSL formatting specifications and XSLT stylesheets An XSL rendering agent responsible for interpreting an XSL formatting specification will recognize those constructs identified with the http www w3 org 1999 XSL Format namespace Note tha
204. efined by the user Just as with HTML a stylesheet writer utilizing XSL for rendering must transform each and every user construct into a rendering construct to direct the rendering agent to produce the desired result By learning and understanding the semantics behind the constructs of XSL formatting the stylesheet writer can create an instance of the formatting vocabulary expressing the desired layout of the final result e g area geometry spacing font metrics etc with each piece of information in the result coming from either the source data or the stylesheet itself Consider once more the customer information in Example 1 1 An XSL rendering agent doesn t know how to render a marked up construct named lt customer gt The XSL vocabulary used to render the customer information could be as follows http www xml com pub a 2000 08 holman s1 html page 2 4 di 19 10 05 2001 9 03 31 XML com What is XSLT I Aug 16 2000 iteoxgloloxels ssuece loei ores o9 ie 20 iE ttem sl 7e 2 Ooi lr rom fo inline sequence font style italic Customer Reference lt fo inline sequence font weight bold cust123 fo inline sequence fto inluine segquence lt fo block gt Example 1 8 XSL rendering semantics markup for example The rendering result when using the Portable Document Format PDF would then be as follows with an intermediate PDF generation step interpreting the XSL markup for italics and boldface
205. ement text of internal entities and supply default attribute values Ji They must not process entity declarations or attribute list declarations encountered after a reference to a parameter entity that is not read since the entity may have contained overriding declarations E 5 2 Using XML Processors The behavior of a validating XML processor is highly predictable it must read every piece of a document and report all well formedness and validity violations Less is required of a non validating processor it need not read any part of the document other than the document entity ji This has two effects that may be important to users of XML processors E e Certain well formedness errors specifically those that require reading external entities may not be detected by a non validating processor Examples include the constraints entitled Entity Declared Parsed Entity and No Recursion as well as some of the cases described as forbidden in 4 4 XML Processor Treatment of Entities and References e The information passed from the processor to the application may vary depending on whether the processor reads parameter and external entities For example a non validating processor may not normalize attribute values include the replacement text of internal entities or supply default attribute values where doing so depends on having read declarations in external or parameter entities For maximum reliability in interoperat
206. empty element tags entity references character references comments CDATA section delimiters document type declarations processing instructions XML declarations text declarations and any white space that is at the top level of the document entity that is outside the document element and not inside any other markup Definition All text that is not markup constitutes the character data of the document The ampersand character amp and the left angle bracket lt may appear in their literal form only when used as markup delimiters or within a comment a processing instruction ora CDATA section If they are needed elsewhere they must be escaped using either numeric character references or the strings amp amp and amp 1t respectively The right angle bracket gt may be represented using the string amp gt and must for compatibility be escaped using amp gt or a character reference when it appears in the string gt in content when that string is not marking the end of a CDATA section In the content of elements character data is any string of characters which does not contain the start delimiter of any markup In a CDATA section character data is any string of characters not including the CDATA section close delimiter gt To allow attribute values to contain both single and double quotes the apostrophe or single quote character may be represented as amp apos and t
207. empty elements are simply markers where something occurs a horizontal rule for HTML s lt hr gt tag for example or a cross reference for DocBook s lt xref gt tag The trailing gt in the modified syntax indicates to a program processing the XML document that the element is empty and no matching end tag should be sought Since XML documents do not require a document type declaration without this clue it could be impossible for an XML parser to determine which tags were intentionally empty and which had been left empty by mistake XML has softened the distinction between elements which are declared as EMPTY and elements which merely have no content In XML it is legal to use the empty element tag syntax in either case It s also legal to use a start tag end tag pair for empty elements lt applause gt lt applause gt If interoperability is of any concern it s best to reserve empty element tag syntax for elements which are http www xml com pub a 98 10 guide2 html 1 di 10 10 05 2001 9 28 30 X ML Products Tools Training O REIL xX XML com What Do XML Documents Look Like Oct 03 1998 XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIONS THIS SITE IS ON THE O REILLY S declared as EMPTY and to only use the empty element tag form for those elements XML documents are composed of markup and c
208. ence delimiter A character reference is included when the indicated character is processed in place of the reference itself 4 4 3 Included If Validating When an XML processor recognizes a reference to a parsed entity in order to validate the document the processor must include its replacement text If the entity is external and the processor is not attempting to validate the XML document the processor may but need not include the entity s replacement text If a non validating processor does not include the replacement text it must inform the application that it recognized but did not read the entity This rule is based on the recognition that the automatic inclusion provided by the SGML and XML entity mechanism primarily designed to support modularity in authoring is not necessarily appropriate for other applications in particular document browsing Browsers for example when encountering an external parsed entity reference might choose to provide a visual indication of the entity s presence and retrieve it for display only on demand 4 4 4 Forbidden The following are forbidden and constitute fatal errors e the appearance of a reference to an unparsed entity e the appearance of any character or general entity reference in the DTD except within an Entity Value or Att Value e areference to an external entity in an attribute value 4 4 5 Included in Literal When an entity reference appears in an attribute value or a para
209. ence for some description of the arc role Note that XLinks permit both inbound and outbound links Outbound links are akin to normal HTML links where a link is made from the current document to an external resource An inbound link is constituted by an arc from an external resource located with a locator type element into an internal resource The following DTD will illustrate the above attributes lt ELEMENT acted EMPTY gt lt ATTLIST acted xlink type arc FIXED arc xlink title CDATA IMPLIED xlink show new replace embed other none IMPLIED xlink from NMTOKEN IMPLIED xlink to NMTOKEN IMPLIED gt Putting together our resource and locator examples with this arc we have the following snippet of an XML instance lt A local resource gt actress xlink label maria gt first name Brigitte first name lt surname gt Helm lt surname gt lt actress gt s A remote resourc gt movie xlink label 2 metropolis xlink href metropolis xml gt An arc that binds them acted xlink type arc xlink from maria xlink to metropolis gt In order to encapsulate relationships like the above we need containers that is extended type XLink elements Extended links extended type elements Extended links are marked by the type extended and may contain locators pointing to remote resources local resources arcs and a title The
210. encoding Eq UY EncName EncName nov we 81 EncName A Za z 5 IBmexoxo bag GAS eri 9o name NEL E contains only Latin characters ff In the document entity the encoding declaration is part of the XML declaration The EncName is the name of the encoding used In an encoding declaration the values UTF 8 UTF 16 ISO 10646 UCS 2 and T50 10646 UCS 4 should be used for the various encodings and transformations of Unicode ISO IEC 10646 the values IS0 8859 1 ISO 8859 2 T850 8859 9 should be used for the parts of ISO 8859 and the values ISO 2022 JP Shift JIS and EUC JP should be used for the various encoded forms of JIS X 0208 1997 XML processors may recognize other encodings it is recommended that character encodings registered as charsets with the Internet Assigned Numbers Authority IANA other than those just listed should be referred to using their registered names Note that these registered names are defined to be case insensitive so processors wishing to match against them should do so in a case insensitive way T In the absence of information provided by an external transport protocol e g HTTP or MIME it is an error T for an entity including an encoding declaration to be presented to the XML processor in an encoding other than that named in the declaration for an encoding declaration to occur other than at the beginning of an external entity or for a
211. endation undeserving of its sullied reputation This is a powerful yet very simple technique for disambiguating element type names in vocabularies Perhaps the reputation spread from those unfamiliar with the requirements being satisfied Perhaps concerns were spread by those who made assumptions about the values used in namespace declarations As unjustified as it is evoking namespaces unnecessarily and unfortunately strikes fear in many people It is my goal to help the reader understand that not only are namespaces easy to define and easy to use but that they are easy to understand and are not nearly as complex as others have believed The Namespaces in XML Recommendation describes a technique for exploiting the established uniqueness of Uniform Resource Identifier URI values under the purview of the Internet Engineering Task Force IETF We users of the Internet accept the authority of the registrar of Internet domain names to allot unique values to organizations and it is in our best interest to not arrogate or usurp values allotted to others as our own We can therefore assume a published URI value belongs to the owner of the domain used as the basis of the value The value is not a Uniform Resource Locator URL which is a URI that identifies an actual addressed location on the Internet rather the URI is being used merely as a unique string value To set the stage for how these URI values are used consider an example of two vocabularie
212. ent but the XML processor is required to pass them to an application Processing instructions have the form lt name pidata gt The name called the PI target identifies the PI to the application Applications should process only the targets they recognize and ignore all other PIs Any data that follows the PI target is optional it is for the application that recognizes the target The names used in PIs may be declared as notations in order to formally identify them PI names beginning with xm1 are reserved for XML standardization CDATA Sections In a document a CDATA section instructs the parser to ignore most markup characters Consider a source code listing in an XML document It might contain characters that the XML parser would ordinarily recognize as markup lt and amp for example In order to prevent this a CDATA section can be used lt CDATA p amp q b i lt 3 gt Between the start of the section lt CDATA and the end of the section gt all character data is passed directly to the application without interpretation Elements entity references comments and processing instructions are all unrecognized and the characters that comprise them are passed literally to the application The only string that cannot occur in a CDATA section is gt Document Type Declarations A large percentage of the XML specification deals with various sorts of declarations that are allowed in XML
213. entity declarations are shown in Example 3 Example 3 Typical Entity Declarations lt ENTITY ATI ArborText Inc gt lt ENTITY boilerplate SYSTEM standard legalnotice xml gt lt ENTITY ATIlogo SYSTEM standard logo gif NDATA GIF87A gt There are three kinds of entities Internal Entities Internal entities Section 4 2 1 associate a name with a string of literal http www xml com pub a 98 10 guide2 html 6 di 10 10 05 2001 9 28 30 XML com What Do XML Documents Look Like Oct 03 1998 text The first entity in Example 3 is an internal entity Using amp ATI anywhere in the document will insert ArborText Inc at that location Internal entities allow you to define shortcuts for frequently typed text or text that is expected to change such as the revision status of a document Internal entities can include references to other internal entities but it is an error for them to be recursive The XML specification predefines five internal entities amp 1t produces the left angle bracket lt amp gt produces the right angle bracket gt amp amp produces the ampersand amp O O O 0 amp apos produces a single quote character an apostrophe O amp quot produces a double quote character External Entities External entities Section 4 2 2 associate a name with the content of another file External entities allow an XML document to refer to the contents o
214. eplacement text ENTITY tricky error prone gt which is a well formed entity declaration e in line 6 the reference to xx is recognized and the replacement text of xx namely zz is parsed The reference to zz is recognized in its turn and its replacement text ENTITY tricky error prone gt is parsed The general entity tricky has now been declared with the replacement text error prone e in line 8 the reference to the general entity t ricky is recognized and it is expanded so the full content of the test element is the self describing and ungrammatical string This sample shows a error prone method E Deterministic Content Models Non Normative For compatibility it is required that content models in element type declarations be deterministic J SGML requires deterministic content models it calls them unambiguous XML processors built using SGML systems may flag non deterministic content models as errors For example the content model b c b d is non deterministic because given an initial b the parser cannot know which b in the model is being matched without looking ahead to see which element follows the b In this case the two references to b can be collapsed into a single reference making the model read b c d An initial b now clearly matches only a single name in the content model The parser doesn t need to look ahead to see what follows either c or d would be acc
215. epted More formally a finite state automaton may be constructed from the content model using the standard algorithms e g algorithm 3 5 in section 3 9 of Aho Sethi and Ullman Aho Ullman In many such algorithms a follow set is constructed for each position in the regular expression i e each leaf node in the syntax tree for the regular http www xml com axml testaxml htm 32 di 34 10 05 2001 9 26 16 The Annotated XML Specification expression if any position has a follow set in which more than one following position is labeled with the same element type name then the content model is in error and may be reported as an error Algorithms exist which allow many but not all non deterministic content models to be reduced automatically to equivalent deterministic models see Briiggemann Klein 1991 Briiggemann Klein F Autodetection of Character Encodings Non Normative The XML encoding declaration functions as an internal label on each entity indicating which character encoding is in use j Before an XML processor can read the internal label however it apparently has to know what character encoding is in use which is what the internal label is trying to indicate In the general case this is a hopeless situation It is not entirely hopeless in XML however because XML limits the general case in two ways each implementation is assumed to support only a finite set of character encodings and the XML encoding declaration
216. equired to behave as described otherwise they are in error error Definition A violation of the rules of this specification results are undefined Conforming software may detect and report an error and may recover from it fatal error Definition An error which a conforming XML processor must detect and report to the application After encountering a fatal error the processor may continue processing the data to search for further errors and may report such errors to the application In order to support correction of errors the processor may make unprocessed data from the document with intermingled character data and markup available to the application Once a fatal error is detected however the processor must not continue normal processing 1 e it must not continue to pass character data and information about the document s logical structure to the application in the normal way at user option http www w3 org TR REC xml 4 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition Definition Conforming software may or must depending on the modal verb in the sentence behave as described if it does it must provide users a means to enable or disable the behavior described validity constraint Definition A rule which applies to all valid XML documents Violations of validity constraints are errors they must at user option be reported by validating XML processors well formedness constra
217. er entities the document entity has no name and might well appear on a processor input stream without any identification at all E 5 Conformance 5 1 Validating and Non Validating Processors Conforming XML processors fall into two classes validating and non validating i J Validating and non validating processors alike must report violations of this specification s well formedness constraints in the content of the document entity and any other parsed entities that they read Definition Validating processors must report violations of the constraints expressed by the declarations in the DTD and failures to fulfill the validity constraints given in this specification To accomplish this validating XML processors must read and process the entire DTD and all external parsed entities referenced in the document Non validating processors are required to check only the document entity including the entire internal DTD subset for well formedness Definition T While they are not required to check the document for validity they are required to process all the declarations they read in the internal DTD subset and in any parameter entity that they read up to the first reference to a parameter entity that they do nof read that is to say they must use the information http www xml com axml testaxml htm 24 di 34 10 05 2001 9 26 16 The Annotated XML Specification in those declarations to normalize attribute values include the replac
218. ernal parsed entity e other characters are processed by appending them to the normalized value If the declared value is not CDATA then the XML processor must further process the normalized attribute value by discarding any leading and trailing space 22x20 characters and by replacing sequences of space x20 characters by a single space x20 character All attributes for which no declaration has been read should be treated by a non validating parser as if declared CDATA 3 4 Conditional Sections Definition Conditional sections are portions of the document type declaration external subset which are included in or excluded from the logical structure of the DTD based on the keyword which governs them J Conditional Section 61 conditionalSect includeSect ignoreSect 62 ine silu cle Sect qu aet Sco TNC TUDES Sue wq extSubsetDecl gt 63 dignmenesecte s M Sa T GNOBRN Se VU ignoreSectContents gt Y 64 ignoreSectContents Ignore ignoresSect Contents VTS enere 65 Ignore Char Char CUE qu Pee Char Like the internal and external DTD subsets a conditional section may contain one or more complete declarations comments processing instructions or nested conditional sections intermingled with white space If the keyword of the conditional section is INCLUDE then the contents of the conditional section are part of the DTD If the keyword
219. erpretation is solely the purview of the designers of HTML and user agents attempting to conform to the World Wide Web Consortium W3C published semantics Nothing is imposed by any process when creating a new XML vocabulary that happens to use the same names Applications using XML processors to access XML information must be instructed how to interpret and implement the desired semantics 1 1 2 XML Path Language XPath Assuming that we have structured our information using XML how are we going to talk about address what is inside our documents Locating http www xml com pub a 2000 08 holman s1 html page 1 5 di 8 10 05 2001 9 02 26 XML com What is XSLT I Aug 16 2000 information in an XML document is critical to both transforming it and to associating or relating it to other information When we write stylesheets and use linking languages we can address components of our information for a processor by our use of the XML Path Language also called XPath e http www w3 org TR xpath 1 1 2 1 Addressing structured information The W3C working group responsible for stylesheets collaborated with the W3C working group responsible for the next generation of hyperlinking to produce XPath as a common base for addressing requirements shared by their respective Recommendations Both groups extend the core XPath facilities to meet the needs they have in each of their domains the stylesheet group uses XPath as the core of exp
220. ersion 1 0 gt 05 06 lt xsl template match gt LI roor swule 07 lt html gt lt head gt lt title gt Record of Sales lt title gt lt head gt 08 lt body gt lt h2 gt Record of Sales lt h2 gt 09 xsl apply templates select sales record gt 10 body html xsl template Lil http www xml com pub a 2000 08 holman s2_1 html page 2 5 di 7 10 05 2001 9 07 18 XML com Getting started with XSLT and XPath Aug 23 2000 12 lt xsl template match record gt processing for each record 13 lt ul gt lt xsl apply templates gt lt ul gt lt xsl template gt 14 15 lt xsl template match prodsale gt processing for each sale gt 16 li xsl value of select num gt use parent s attr iL7 xsl text lt xsl text gt 18 lt xsl value of select id idref gt lt Il GO ameltseegu 19 lt xsl text gt lt xsl text gt 20 lt xsl value of select gt lt 1i gt lt xsl template gt 2 22 lt xsl stylesheet gt Example 2 8 List oriented presentation of the sample product sales source information The document element on line 3 includes the requisite declarations of the language namespace and the version being used in the stylesheet The children of the document element are the template rules describing the source tree event handlers for the transformation Each event handler associates a template with an event t
221. ery useful It is expected that these will come in packages for example a set of basic bibliographic Properties like Author Title Date and so on Then a more elaborate set from OCLC and a competing one from the Library of Congress These packages are called Vocabularies it s easy to imagine Property vocabularies describing books videos pizza joints fine wines mutual funds and many other species of Web wildlife What RDF Might Mean The Web is too big for anyone person to stay on top of In fact it contains information about a huge number of subjects and for most of those subjects such as fine wines home improvement and cancer therapy the Web has too much information for any one person to stay on top of and much of anything else This means that opinions pointers indexes and anything that helps people discover things are going to be commodities of very high value Nobody thinks that everyone will use the same vocabulary nor should they but with RDF we can have a marketplace in vocabularies Anyone can invent them advertise them and sell them The good or best marketed ones will survive and prosper Probably most niches of information will come to be dominated by a small number of vocabularies the way that library catalogs are today And even among people who are sharing the use of metadata vocabularies there s no need to share the same software RDF makes it possible to use multiple pieces of software to pr
222. es but first let s focus on XSLT and XPath in the context of a few of the Recommendations in the XML family and examine how these two Recommendations work together to address separate and distinct functionality required when working with structured information technologies This chapter does not attempt to address all of the numerous XML related Recommendations currently released or in development Specifically we will be looking at only the following as they relate to XSLT and XPath Extensible Markup Language XML For years applications and The context of XSL Transformations and the XML Path This Article Language 1 1 The XML family of Recommendations 1 1 1 Extensible Markup Language XML 1 1 2 XML Path Language XPath 1 1 3 Styling structured information 1 1 4 Extensible Stylesheet Language XSL 1 1 5 Extensible Stylesheet Language Transformations XSLT 1 1 6 Namespaces 1 1 7 Stylesheet association 1 2 Transformation data flows 1 2 1 Transformation from XML to XML 1 2 2 Transformation from XML to XSL formatting semantics 1 2 3 Transformation from XML to non XML http www xml com pub a 2000 08 holman s1 html 1 di 8 10 05 2001 9 01 41 XML Products Tools Training Sponsored By XML com What is XSLT I Aug 16 2000 GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List Subm
223. es Reference attributes This is achieved through W3C XML Schema using references to element and Strietures Reference What s On attribute definitions that need to be Freenet within the scope of the referencer leading to a flat design lt xml version 1 0 encoding utf 8 gt lt xsd schema xmlns xsd http www w3 org 2000 10 XMLSchema gt DILUTED T 1 definition of simple type elements HR COLLABORATE Find it om the O Reilly Network DISCOVER lt xsd element name title type xsd string gt FIND lt xsd element name author type xsd string gt Am lt xsd element name name type xsd string gt b mS R lt xsd element name friend of type xsd string gt Article Archive lt xsd element name since type xsd date gt FAQs lt xsd element name qualification type xsd string gt Add the latest news 1 definition of attributes gt from XML com to your web site Py lt xsd attribute name isbn type xsd string gt p COLUMNS definition of complex type elements gt XML Deviant xsd element name character Style Matters lt xsd complexType gt lt xsd sequence gt OST the simple type elements are referenced using Transforming XML the ref attribute Ez Perl and XML xsd element ref name the definition of the cardinality is done mend when the elements are referenced gt KML Resources lt xsd element ref friend of Havers Guide m
224. es of our information The functions allow us to cast these values into other data type representations and to return massaged information according to our needs 1 1 2 2 Addressing identifies a hierarchical position or positions XPath defines common semantics and syntax for addressing XML expressed information and bases these primarily on the hierarchical position of components in the tree This ordering is referred to as document order in XPath while in other contexts this 1s often termed either parse order or depth first order Alternatively we can access an arbitrary location in the tree based on points in the tree having unique identifiers We convey XPath addresses in a simple and compact non XML syntax This allows us to use an XPath expression as the value of an attribute in an XML vocabulary as in the following examples http www xml com pub a 2000 08 holman s1 html page 1 6 di 8 10 05 2001 9 02 26 XML com What is XSLT I Aug 16 2000 01 select answer Example 1 3 A simple XPath expression in a select attribute The above attribute value expresses all children named answer of the current focus element 01 match question answer Example 1 4 An XPath expression in a mat ch attribute The above attribute value expresses a test of an element being in the union of the element types named question and answer The XPath syntax looks a lot like addressing subdirectories in a file system or as pa
225. ese entities so that references to them produce a well formed result If the entities gt apos or quot are declared they must be declared as internal entities whose replacement text is the single character being escaped or a character reference to that character the double escaping here is unnecessary but harmless For example 4 7 Notation Declarations Definition Notations identify by name the format of unparsed entities the format of elements which bear a notation attribute or the application to which a processing instruction is addressed Definition Notation declarations provide a name for the notation for use in entity and attribute list declarations and in attribute specifications and an external identifier for the notation which may allow an XML processor or its client application to locate a helper application capable of processing data in the given notation Notation Declarations 82 NotationDecl NOTATION S Name S ExternalID VC Unique Notation pubplocID 57 Name 83 PublicID PUBLIC S PubidLiteral Validity constraint Unique Notation Name Only one notation declaration can declare a given Name XML processors must provide applications with the name and external identifier s of any notation declared and referred to in an attribute value attribute definition or entity declaration They may additionally resolve the external identifier into the system identifier file name or
226. esentation of objects e Text Encoding Initiative Guidelines TEI P3 Provide structures for creating links aggregate objects and link collections Many other linking systems have also informed this design especially Dexter FRESS MicroCosm and InterMedia http www w3 org TR 1998 WD xlink 19980303 3 di 16 10 05 2001 9 30 10 XML Linking Language XLink 1 3 Terminology The following basic terms apply in this document element tree A representation of the relevant structure specified by the tags and attributes in an XML document based on groves as defined in the ISO DSSSL standard inline link Abstractly a link which serves as one of its own resources Concretely a link where the content of the linking element serves as a participating resource HTML A HyTime clink and TEI XREF are all examples of inline links link An explicit relationship between two or more data objects or portions of data objects linking element An element that asserts the existence and describes the characteristics of a link local resource The content of an inline linking element Note that the content of the linking element could be explicitly pointed to by means of a regular locator in the same linking element in which case the resource is considered remote not local locator Data provided as part of a link which identifies a resource multidirectional link A link whose traversal can be initiated from more than one of its particip
227. estriction unqualified http www xml com pub a 2000 1 1 29 schemas structuresref html 6 di 7 10 05 2001 9 21 46 XML com W3C XML Schema Structures Reference Nov 29 2000 group notation simpleType annotation schema Can be included in e selector ref Definition of the the path selecting an element for a uniqueness constraint selector id ID xpath An XPath expression any attributes with non schema namespace gt Content annotation lt selector gt Can be included in key keyref unique e sequence ref Particle to define an ordered group of elements sequence id ID maxOccurs nonNegativeInteger unbounded fL minOccurs nonNegativeInteger 1 any attributes with non schema namespace gt Content annotation element group choice sequence any sequence Can be included in choice complexType group sequence e simpleContent ref Simple content declaration for an element lt simpleContent id ID any attributes with non schema namespace gt Content annotation restriction extension simpleContent Can be included in complexType e simpleType ref Simple type declaration lt simpleType id ID name NCName any attributes with non schema namespace gt Content annotation list restriction union lt simpleType gt Can be included in attribute element list
228. et provided it is protected from outside access The site wide staff license is granted to all staff members whose office is at a single physical mailing address The world wide staff license is granted to all staff members world wide of the company making the purchase In each case this is a one time fee with perpetual free access to updates Pricing information is available at the top of this page 3 On line Web based Computer Based Training CBT Due to a lack of sufficient interest and to supplier problems we are no longer actively pursuing web based training providers we had hoped for the resources to host our courses in a web based forum for interactive training with self assessment To express your interest or to be informed of any possible future availability of these courses please send your request to online cbt CraneSoftwrights com 4 Printed books by others Electronic publications are not for everyone Even with a ZIP file of samples free updates and the ability to search the PDF for information in the book some people are just not oriented to reading electronic books While some people do take our electronic materials and bind their own printed copies others are only comfortable with a physical book in their hands We have begun a list of related books written by others as a service to our visitors The list is not meant to prejudice other books that have not made it on the list if you know of a title we should
229. etation result tree in Each Domain http www xml com pub a 2000 08 holman s1 html page s3 3 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 Figure 1 4 Transformation from XML to XSL Formatting Semantics Without employing extension techniques or supplemental documentation the stylesheets used in this scenario contain only the transformation vocabulary and the resulting formatting vocabulary There are no other element types from other vocabularies in the result including from the source vocabulary For example rendering processors would not inherently know what to do with an element of type custnbr representing a customer number it is the stylesheet writer s responsibility to transform the information into information recognized by the rendering agent There is no obligation for the rendering processor to serialize the result tree created during transformation The feature of serializing the result tree to XML syntax is however quite useful as a diagnostic tool revealing to us what we really asked to be rendered instead of what we thought we were asking to be rendered when we saw incorrect results There may also be performance considerations of taking the reified result tree in XML syntax and rendering it in other media without incurring the overhead of performing the transformation repeatedly 1 2 3 Transformation from XML to non XML An XSLT processor may choose to recognize the stylesheet writer s desir
230. external parsed entities referenced in the document Non validating processors are required to check only the document entity including the entire internal DTD subset for well formedness Definition While they are not required to check the document for validity they are required to process all the declarations they read in the internal DTD subset and in any parameter entity that they read up to the first reference to a parameter entity that they do not read that is to say they must use the information in those declarations to normalize attribute values include the replacement text of internal entities and supply default attribute values Except when st andalone yes they must not process entity declarations or attribute list declarations encountered after a reference to a parameter entity that is not read since the entity may have contained overriding declarations 5 2 Using XML Processors The behavior of a validating XML processor is highly predictable it must read every piece of a document and report all well formedness and validity violations Less is required of a non validating processor it need not read any part of the document other than the document entity This has two effects that may be important to users of XML processors e Certain well formedness errors specifically those that require reading external entities may not be detected by a non validating processor Examples include the constraints entitled Entity Declare
231. f another file External entities contain either text or binary data If they contain text the content of the external file is inserted at the point of reference and parsed as part of the referring document Binary data is not parsed and may only be referenced in an attribute Binary data is used to reference figures and other non XML content in the document The second and third entities in Example 3 are external entities Using amp boilerplate will have insert the contents of the file standard legalnotice xml at the location of the entity reference The XML processor will parse the content of that file as if it occurred literally at that location The entity ATIlogo is also an external entity but its content is binary The ATI logo entity can only be used as the value of an ENTITY or ENTITIES attribute on a graphic element perhaps The XML processor will pass this information along to an application but it does not attempt to process the content of standard logo gif Parameter Entities Parameter entities can only occur in the document type declaration A parameter entity declaration is identified by placing percent space in front of its name in the declaration The percent sign is also used in references to parameter entities instead of the ampersand Parameter entity references are immediately expanded in the document type declaration and their replacement text is part of the declaration whereas normal entity reference
232. f elements which bear a notation attribute or the application to which a processing instruction is addressed Definition Notation declarations provide a name for the notation for use in entity and attribute list declarations and in attribute specifications and an external identifier for the notation which may allow an XML processor or its client application to locate a helper application capable of processing data in the given notation T Notation Declarations 82 NotationDecl NOTATION jji S Name S Externaliip I EULI TCID 9 VM 83 Public PUBIC S extet babe teseeul XML processors must provide applications with the name and external identifier s of any notation declared and referred to in an attribute value attribute definition or entity declaration They may additionally resolve the external identifier into the system identifier file name or other information needed to allow the application to call a processor for data in the notation described J It is not an error however for XML documents to declare and refer to notations for which notation specific applications are not available on the system where the XML processor or application is running 4 8 Document Entity Definition The document entity serves as the root of the entity tree and a starting point for an XML processor T This specification does not specify how the document entity is to be located by an XML processor unlike oth
233. f having processed the XML instance to find the underlying content the actual markup represents By focusing on this parsed result for downstream applications there is little or no regard in an XSLT stylesheet for the actual XML syntax constructs found within the source input documents or for the actual XML syntax constructs utilized in the resulting output document This prevents a stylesheet from being aware of such constructs or controlling how such constructs are used Any transformation requirement that includes original markup syntax preservation would not be suited for XSLT transformations Note 5 Is not being able to support original markup syntax preservation really a problem That depends how you regard the original markup syntax used in an XML instance XML allows you to use various markup techniques to meet identical information representation requirements If you treat this as merely syntactic sugar for human involvement in the markup process then it will not be important how information is specifically marked up once it is out of the hands of the human involved If however you are working with transformations where such issues are more than just a sugar coating and it is necessary to utilize particular constructs based on particular requirements of how the result looks in syntactic form then XSLT will not provide the kind of control you will need 1 1 5 3 Document model and vocabulary independent While checking
234. f the content of the document Additional declarations may come from an external DTD called the external subset or be included directly in the document the internal subset or both lt XML version 1 0 standalone no gt lt DOCTYPE chapter SYSTEM dbook dtd lt ENTITY ulink module IGNORE gt lt ELEMENT ulink PCDATA gt lt ATTLIST ulink xml link CDATA FIXED SIMPLE xml attributes CDATA FIXED HREF URL URL CDATA REQUIRED gt http www xml com pub a 98 10 guide2 html 8 di 10 10 05 2001 9 28 30 XML com What Do XML Documents Look Like Oct 03 1998 gt lt chapter gt lt chapter gt This example references an external DTD dbook dtd and includes element and attribute declarations for the ul ink element in the internal subset In this case ul ink is being given the semantics of a simple link from the XLink specification Note that declarations in the internal subset override declarations in the external subset The XML processor reads the internal subset before the external subset and the first declaration takes precedence In order to determine if a document is valid the XML processor must read the entire document type declaration both internal and external subsets But for some applications validity may not be required and it may be sufficient for the processor to read only the internal subset In the example above if validity is unimport
235. ference within a parameter or internal entity s literal entity value in the entity s declaration corresponds to the nonterminal Ent ityValue Reference in DTD as a reference within either the internal or external subsets of the DTD but outside of an Ent ityValue or AttValue E Entity Type Internal External Parsed Eun Parameter General General Unparsed sca Not recognized Included Included if validating Forbidden Included in Content F Reformos Not recognized Included in literal Forbidden Forbidden Included in Attribute Value Occurs as l morc NTE Not recognized Forbidden Forbidden Notify Not recognized Reference T qus usu elu Included in literal Bypassed Bypassed Forbidden Included SE Included as PE Forbidden Forbidden Forbidden Forbidden 4 4 1 Not Recognized Outside the DTD the character has no special significance thus what would be parameter entity references in the DTD are not recognized as markup in content Similarly the names of unparsed entities are not recognized except when they appear in the value of an appropriately declared attribute 4 4 2 Included Definition An entity is included when its replacement text is retrieved and processed in place of the reference itself as though it were part of the document at the location the reference was recognized The replacement text may contain both character data and except for parameter entities markup which must be rec
236. for W3C XML Schema extensions in instance documents Identified below as xsi Document instance attributes Tools xsi noNamespaceSchemaLocation E Location of a W3C XML Schema without target namespace Training xsi null Declaration of a null value xi e b xsi schemaLocation Location of a W3C XML Schema with a target namespace xsi type Indocument declaration of a W3C XML Schema datatype Elements e all ref Particle describing an unordered group of elements all id ID gt Content annotation element all Can be included in complexType group annotation ref Informative data for human or electronic agents annotation any attributes with non schema namespace gt Content appinfo documentation lt xsd annotation gt Can be included in all any anyAttribute attribute attributeGroup choice complexContent complexType duration element encoding enumeration extension field group import include key keyref length list maxExclusive maxInclusive maxLength minExclusive minInclusive minLength notation pattern period precision redefine restriction scale schema selector sequence simpleContent simpleType union unique any ref Wildcard to replace any element lt any id ID maxOccurs nonNegativeInteger unbounded ae minOccurs nonNegativeInteger 1 namespace any other List of uriReference targetNamespace
237. from XML com to your web site Click h E COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker XML Testbed SEYBOLD PUBLICATIONS An Alternative XML Schema Language Find it on XML com OREILLY COM NENNEN arch Using W3C XML Schema W3C XML Schema and Instance Documents We ve now covered most of the features of W3C XML Schema but we still need to have a glance at some extensions that you can use within your instance Table of Contents amp Print This Article documents In order to differentiate these other features a separate namespace http www w3 org 2000 10 XMLSchema instance is used usually associated with the prefix xsi The xsi schemaLocation and xsi noNamespaceSchemaLocation attributes allow you to tie a document to its W3C XML Schema This link is not mandatory and other indications can be given using application dependent mechanisms such as a parameter on a command line but it does help W3C XML Schema aware tools to locate a schema Dependent on using namespaces the link will be either book isbn 0836217462 xmlns xsi http www w3 0rg 2000 10 XMLSchema xsi noNamespaceSchemaLocation file library xg Or as below noting the syntax with a URI for the namespace and the URI of the schema separated by a whitespace in the same a
238. g method all other heuristics and sources of information are solely for error recovery e If an XML entity is delivered with a MIME type of application xml then the Byte Order Mark and http www xml com axml testaxml htm 33 di 34 10 05 2001 9 26 16 The Annotated XML Specification encoding declaration PI are used if present to determine the character encoding All other heuristics and sources of information are solely for error recovery These rules apply only in the absence of protocol level documentation in particular when the MIME types text xml and application xml are defined the recommendations of the relevant RFC will supersede these rules G W3C XML Working Group Non Normative This specification was prepared and approved for publication by the W3C XML Working Group WG WG approval of this specification does not necessarily imply that all WG members voted for its approval The current and former members of the XML WG are Jon Bosak Hi Sun Chair James Clark H Technical Lead Tim Bray Hi Textuality and Netscape XML Co editor Jean Paoli H Microsoft XML Co editor C M Sperberg McQueen F U of Ill XML Co editor Dan Connolly H W3C W3C Liaison Paula Angerstein H Texcel Steve DeRose H INSO Dave Hollander H HP Eliot Kimber H ISOGEN Eve Maler Hi ArborText Tom Magliery H i NCSA Murray Maloney i H Muzmo and Grif Makoto Murata H Fuji Xerox Information System
239. ge for XML As time goes on additional requirements will http www xml com pub a 98 10 guide1 html 5 di 6 10 05 2001 9 27 57 XML com What is XML Oct 03 1998 be addressed by other specifications Currently Sep 1998 namespaces dealing with tags from multiple tag sets a query language finding out what s in a document or a collection of documents and a schema language describing the relationships between tags DTDs in XML are all being actively pursued Understanding the Specs For the most part reading and understanding the XML specifications does not require extensive knowledge of SGML or any of the related technologies One topic that may be new is the use of EBNF to describe the syntax of XML Please consult the discussion of EBNF in the appendix of this article for a detailed description of how this grammar works Next What Do XML Documents Look Like b g Lj Find it on the O Reilly Network Fe http www xml com pub a 98 10 guide1 html 6 di 6 10 05 2001 9 27 57 XML com What Do XML Documents Look Like Oct 03 1998 O REILLY xn xml from the inside out O REILLY NETWORK ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF SSH Tunneling Secures 802 11 FIND gt Sea
240. ghly speaking a restricted form of SGML Sponsored By For technical purists it s important to note that there may also be subtle differences between documents as understood by XML systems and those same documents as understood by SGML systems In particular treatment of white space immediately adjacent to tags may be different http www xml com pub a 98 10 guide1 html 2 di 6 10 05 2001 9 27 57 XML com What is XML Oct 03 1998 Why XML In order to appreciate XML it is important to understand why it was created XML was created so that richly structured documents could be used over the web The only viable alternatives HTML and SGML are not practical for this purpose HTML as we ve already discussed comes bound with a set of semantics and does not provide arbitrary structure SGML provides arbitrary structure but is too difficult to implement just for a web browser Full SGML systems solve large complex problems that justify their expense Viewing structured documents sent over the web rarely carries such justification This is not to say that XML can be expected to completely replace SGML While XML is being designed to deliver structured content over the web some of the very features it lacks to make this practical make SGML a more satisfactory solution for the creation and long time storage of complex documents In many organizations filtering SGML to XML will be the standard procedure for web delive
241. gn goals for XML are 1 XML shall be straightforwardly usable over the Internet XML shall support a wide variety of applications XML shall be compatible with SGML It shall be easy to write programs which process XML documents The number of optional features in XML is to be kept to the absolute minimum ideally zero XML documents should be human legible and reasonably clear The XML design should be prepared quickly The design of XML shall be formal and concise e ON DH FW D XML documents shall be easy to create 10 Terseness in XML markup is of minimal importance This specification together with associated standards Unicode and ISO IEC 10646 for characters Internet RFC 1766 for language identification tags ISO 639 for language name codes and ISO 3166 for country name codes provides all the information necessary to understand XML Version 1 0 and construct computer programs to process it This version of the XML specification may be distributed freely as long as all text and legal notices remain intact 1 2 Terminology The terminology used to describe XML documents is defined in the body of this specification The terms defined in the following list are used in building those definitions and in describing the actions of an XML processor may Definition Conforming documents and XML processors are permitted to but need not behave as described must Definition Conforming documents and XML processors are r
242. he O Reilly Network DS Interview With Illiad xml from da inside out ONJAVA COM RESOURCE gt CENTERS XML COM O REILLY NETWORK Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF JBuilder 4 Handheld Express Product Review Find it at ONJava com FIND Search Article Archive FAQs Add the latest news from XML com to your web site Click here gt COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIO OREILLY COM E e Using W3C XML Schema by Eric van der Vlist Pages 1 2 3 4 5 6 7 8 9 Print This Article Building Usable and Reusable Schemas Perhaps the first step in writing reusable schemas is to document them W3C XML Table of Contents Schema provides an alternative to XML comments and processing instructions that might be easier to handle for supporting tools Introducing Our First Human readable documentation can be defined by xsd documentation Schema elements while information targeted at applications should be included in Slicing the Schema xsd appinfo elements Both
243. he WG at the time of publication of this edition were e Paula Angerstein Vignette Daniel Austin Ask Jeeves Tim Boland Allen Brown Microsoft Dan Connolly W3C Staff Contact John Cowan Reuters Limited John Evdemon XMLSolutions Corporation Paul Grosso Arbortext Co Chair Arnaud Le Hors IBM Co Chair Eve Maler Sun Microsystems Second Edition Editor Jonathan Marsh Microsoft MURATA Makoto FAMILY Given IBM Mark Needleman Data Research Associates David Orchard Jamcracker Lew Shannon NCR Richard Tobin University of Edinburgh Daniel Veillard W3C Dan Vint Lexica Norman Walsh Sun Microsystems Fran ois Yergeau Alis Technologies Errata List Editor Kongyi Zhou Oracle Production Notes Non Normative This Second Edition was encoded in the XMLspec DTD which has documentation available The HTML versions were produced with a combination of the xmlspec xsl diffspec xsl and REC xml 2e xsl XSLT stylesheets The PDF version was produced with the html2ps facility and a distiller program http www w3 org TR REC xml 41 di 41 10 05 2001 9 29 13 DocBook What Is DocBook SGML XML XML Schema RELAX Schema TREX Schema Documentation Samples Tools Mailing Lists Meetings The OASIS T C OASIS Hello and Welcome This is the official DocBook Homepage DocBook is a DTD both SGML and XML versions are Mrd monu by the DocBook Technical Committee of It is particularly well
244. he double quote character as amp quot Character Data 14 CharData amp amp amp http www w3 org TR REC xml 7 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition 2 5 Comments Definition Comments may appear anywhere in a document outside other markup in addition they may appear within the document type declaration at places allowed by the grammar They are not part of the document s character data an XML processor may but need not make it possible for an application to retrieve the text of comments For compatibility the string double hyphen must not occur within comments Parameter entity references are not recognized within comments Comments 15 Comment Char Char An example of a comment Note that the grammar does not allow a comment ending in gt The following example is not well formed ERIS IA EMT 2 6 Processing Instructions Definition Processing instructions PIs allow documents to contain instructions for applications Processing Instructions 16 PI 1 lt PITarget 8 Char Ohar 5 OCh ar 12 gt 17 PiTarget s Name X x CM um L 1 9 PIs are not part of the document s character data but must be passed through to the application The PI begins with a target PITarget used to identify the application to which the
245. he next one we will examine in detail the constructs and rules of this linking mechanism Pages 1 2 3 Next Page gt www thawte com http www xml com pub a 2000 09 xlink index html page 2 2 di 2 10 05 2001 9 11 08 XML com What is XLink Sep 18 2000 O REILLY o xml from the inside out O REILLY NETWORK ONJAVA COM coming soon sg The Who What How and Why of P2P The O Reilly P2P Research Report OREILLY COM E Eo RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Ximian Gnome Welcome to Your Desktop Find it on the O Reilly Network FIND gt Search Article Archive FAQs Add the latest news from XML com to a i i your web site J Click Pj COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed What is XLink by Fabio Arciniegas A Pages 1 2 3 Print This Article O REILLY CONVENTION XLink Reference Now that we have a basic idea of how XLink looks it s time to dive into the details This section presents all the constructs and rules contained in Table
246. herever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two character sequence xD xA or a standalone literal xD an XML processor must pass to the application the single character xA This behavior can conveniently be produced by normalizing all line breaks to xA on input before parsing 2 12 Language Identification In document processing it is often useful to identify the natural or formal language in which the content is written A special attribute named xm1 lang may be inserted in documents to specify Js the language used in the Hi contents and attribute values of any element in an XML document T In valid documents this attribute like any other must be declared if it is used The values of the attribute are language identifiers as defined by IETF RFC 1766 Tags for the Identification of Languages Language Identification j 33 LanguageID Langcode Subcode 34 Langcode 1S0639Code IanaCode UserCode 35 rs0639Code a lsz lez an 26 ranaCode JU Ve Lees oe ar 37 Useccodekk au X ME S HIE D t 38 Subcode a 51 yar The Langcode may be any of the following e atwo letter language code as defined by ISO 639 Codes for the representation of names of languages e a language identifier registered with the Internet Assigned Numbers Authority IANA these begin with
247. hive 2 lt DOCTYPE sales FAQs lt ELEMENT sales products record gt sales information lt ELEMENT products product gt lt lt o a Gul Clemige Oia dm a lt ELEMENT product PCDATA gt Kl SxrOCGe information gt Add the latest news lt ATTLIST product id ID REQUIRED gt sor web dte EB lt ELEMENT record cust gt lt sales record lt ELEMENT cust prodsale gt customer sales record lt ATTLIST cust num CDATA REQUIRED gt customer number COLUMNS i lt ELEMENT prodsale PCDATA gt product sale record gt 11 lt ATTLIST prodsale idref IDREF REQUIRED gt XML Deviant i2 J gt Style Matters 1 lt sales gt XML Q amp A il lt products gt lt product id pl Packing Boxes lt product gt Transforming XML 1 lt product id p2 gt Packing Tape lt product gt lt products gt Perl and XML 1 lt record gt lt cust num C1001 gt ee 1 lt prodsale idref p1 gt 100 lt prodsale gt GUIDES 1 lt prodsale idref p2 gt 200 lt prodsale gt lt cust gt 1 cust num C1002 gt XML Resources lt prodsale tdrer S2 gt 50 lt prodsale gt lt cust gt Buyer s Guide Cus muimMi VCLOOSYS Events Calendar lt proceale were s Eu 1S lt eieoe Silla Standarde tisi lt prodsale idref p2 gt 15 lt prodsale gt lt cust gt lt record gt lt sales gt Example 2 6 Sample product sales source information Submissions List
248. hnically possible to send semantically rich information in XML protecting your intellectual property by hiding the richness behind the security of a semantic firewall must be considered Perhaps there are revenue opportunities by only delivering a richly marked up rendition of your information to your customers Perhaps you could even scale the richness to http www xml com pub a 2000 08 holman s1 html page 3 9 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 differing levels of utility for customers who value your information with different granularity or specificity while preserving the most detailed normative version of the data away of view Lastly there are no restrictions to using two XSLT processes one on the server to translate our organization s rich markup into an arbitrary delivery oriented markup This delivery markup in turn is translated using XSLT on the user agent for consumption by the operator This approach can reduce bandwidth utilization and increase distributed processing without sacrificing privacy Note 14 There is no consensus in our XML community that semantic firewalls are a good thing Peers of mine preach that the World Wide Web must always be a semantic web with rich markup processed in a distributed fashion among user agents being de rigueur Personally I do not subscribe to this point of view We have the flexibility to weigh the technical and business perspectives of our customers
249. ile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF SSH Tunneling Secures 802 11 O REILLY NETWORK XML com Getting started with XSLT and XPath Aug 23 2000 Pre conference workshops 25th July Conference 26th amp 27th July Holiday Inn London Victoria OREILLY COM ONJAVA COM BR search amp Print This Article W hataseXSLT Getting started with XSLT and XPath by G Ken Holman August 23 2000 Getting started with XSLT and XPath Examining working stylesheets can help us understand how we use Table of Contents XSLT and XPath to perform transformations This article first dissects some example stylesheets before introducing basic terminology and 2 Getting started with XSLT and design principles XPath e2 1 Stylesheet examples 2 1 1 Some simple examples 2 1 2 Some more complex examples 2 2 Syntax basics stylesheets templates instructions 2 2 1 Explicitly declared stylesheets 2 2 2 Implicitly declared stylesheets XML Products 2 1 Stylesheet examples Let s first look at some example stylesheets using two implementations of XSLT 1 0 and XPath 1 0 the XT processor from James Clark and the third web release of Internet Explorer 5 s MSXML Technology Preview Tools Training These two processors were chosen merely as examples
250. imple examples 2 1 2 Some more complex examples 2 2 Syntax basics stylesheets templates instructions 2 2 Explicitly declared http www xml com pub a 2000 08 holman index html 2 di 3 10 05 2001 9 00 38 XML com What is XSLT Aug 16 2000 stylesheets 2 2 2 Implicitly declared stylesheets 2 2 3 Stylesheet requirements 2 2 4 Instructions and literal result elements 2 2 5 Templates and template rules 2 2 6 Approaches to stylesheet design Find it on the O Reilly Network http www xml com pub a 2000 08 holman index html 3 di 3 10 05 2001 9 00 38 Crane Softwrights Training Information Crane Softwrights Training Information To follow this link please proceed to http www CraneSoftwrights com training If your browser supports automatic redirection this link will be automatically traversed Otherwise please click on the link above to proceed http www cranesoftwrights com links xmlcom ptux htm 10 05 2001 9 00 56 Crane Softwrights Ltd Training Programmes and Training Material Crane Softwrights Ltd Free download previews w Practical Transformation Using XSLT and XPath free 137 page download preview in 2 up pages in PDF 1 up and 2 up are available for purchase published review CRANE e US letter size paper 594 809 bytes zipped free download SOFTWRIGHTS e A4 size paper 596 446 bytes zipped free download LTD BOX 266 Purchasing inf
251. in an attribute value other than amp 1t must not contain a lt T An example of a start tag ee OQ O Definition The end of every element that begins with a start tag must be marked by an end tag containing a name that echoes the element s type as given in the start tag An example of an end tag LI NR Definition The text T between the start tag and end tag is called the element s content Definition If an element is empty it must be represented either by a start tag immediately followed by an end tag or by an empty element tag T Definition An empty element tag takes a special form H Empty element tags may be used for any element which has no content whether or not it is declared using the keyword EMPTY For interoperability the empty element tag must be used and can only be used for elements which are declared EMPTY http www xml com axml testaxml htm 12 di 34 10 05 2001 9 26 16 The Annotated XML Specification Examples of empty elements 3 2 Element Type Declarations The element structure of an XML document may for validation purposes be constrained using element type and attribute list declarations An element type declaration constrains the element s content T Element type declarations often constrain which element types can appear as children of the element At user option an XML processor may issue a warning when a declaration mentions an element type for which no d
252. in the start tag Validity constraint Element Valid An element is valid if there is a declaration matching elementdecl where the Name matches the element type and one of the following holds 1 The declaration matches EMPTY and the element has no content 2 The declaration matches children and the sequence of child elements belongs to the language generated by the regular expression in the content model with optional white space characters matching the nonterminal S between the start tag and the first child element between child elements or between the last child element and the end tag Note that a CDATA section containing only white space does not match the nonterminal S and hence cannot appear in these positions 3 The declaration matches Mixed and the content consists of character data and child elements whose types match names in the content model 4 The declaration matches ANY and the types of any child elements have been declared 3 1 Start Tags End Tags and Empty Element Tags Definition The beginning of every non empty XML element is marked by a start tag Start tag 40 STag m Name S Attribute S WFC Unique Att Spec 41 Attribute Name Eq AttValue VC Attribute Value Type WFC No External Entity References WFC No in Attribute Values The Name in the start and end tags gives the element s type Definition The Name AttValue pairs are referred to as the att
253. ing Programmes and Training Material 1 Course Presentation Materials Course materials are structured as tutorial references with detailed examples and quick references to use as supplemental material to published standards and recommendations Summary of Overviews Available for Free Download e Practical Transformation Using XSLT and XPath XSL Transformations and the XML Path Language Ninth Edition ISBN 1 894049 06 3 2001 01 19 Why be interested in purchasing a complete set of materials A printed book is often out of date soon after hitting the streets Crane s training materials used during face to face training sessions are kept up to date as the information being taught changes Our policy of offering free updates to purchasers of our training materials ensures you have the latest version of our tutorial information In effect our publications are edited by our customers in that suggestions for clarifications improvements or enhanced examples are considered for inclusion in future editions The publications are only made available electronically in Adobe PDF click here to obtain the Adobe Acrobat PDF Reader for free users who are obliged to use GhostScript must note the files utilize features of PostScript 3 that are not supported in GhostScript 5 5 but are anticipated to be available in GhostScript 6 0 when released The information can be obtained in full size or compact presentation forms With the purchase of a regi
254. ing between different XML processors applications which use non validating processors should not rely on any behaviors not required of such processors Applications which require facilities such as the use of default attributes or internal entities which are declared in external entities should use validating XML processors 6 Notation The formal grammar of XML is given in this specification using a simple Extended Backus Naur Form EBNF notation Each rule in the grammar defines one symbol in the form CSET a 0 Symbols are written with an initial capital letter if they are defined by a regular expression or with an initial lower case letter otherwise Literal strings are quoted Within the expression on the right hand side of a rule the following expressions are used to match strings of one or more characters xN where N is a hexadecimal integer the expression matches the character in ISO IEC 10646 whose canonical UCS 4 code value when interpreted as an unsigned binary number has the value indicated The number of leading zeros in the xN form is insignificant the number of leading zeros in the corresponding code value is governed by the character encoding in use and is not significant for XML a zA Z xN xN matches any character with a value in the range s indicated inclusive a z xN xN matches any character with a value outside the range indicated abc xN xN xN matches any character with a value n
255. instruction is directed The target names XML xm1 and so on are reserved for standardization in this or future versions of this specification The XML Notation mechanism may be used for formal declaration of PI targets Parameter entity references are not recognized within processing instructions 2 7 CDATA Sections Definition CDATA sections may occur anywhere character data may occur they are used to escape blocks of text containing characters which would otherwise be recognized as markup CDATA sections begin with the string lt CDATA and end with the string gt CDATA Sections 18 CDSect CDStart CData CDEnd 19 CDStart CDATA 20 CData m Char Char Char 21 CDEnd S Within a CDATA section only the CDEnd string is recognized as markup so that left angle brackets and ampersands may occur in their literal form they need not and cannot be escaped using amp 1t and amp amp CDATA sections cannot nest An example of a CDATA section in which lt greeting gt and lt greeting gt are recognized as character data not markup http Awww w3 org TR REC xml 8 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition 2 8 Prolog and Document Type Declaration Definition XML documents should begin with an XML declaration which specifies the version of XML being used For example the following is a complete XML document well formed but not
256. int Definition A rule which applies to all well formed XML documents Violations of well formedness constraints are fatal errors match Definition Of strings or names Two strings or names being compared must be identical Characters with multiple possible representations in ISO IEC 10646 e g characters with both precomposed and base diacritic forms match only if they have the same representation in both strings No case folding is performed Of strings and rules in the grammar A string matches a grammatical production if it belongs to the language generated by that production Of content and content models An element matches its declaration when it conforms in the fashion described in the constraint VC Element Valid for compatibility Definition Marks a sentence describing a feature of XML included solely to ensure that XML remains compatible with SGML for interoperability Definition Marks a sentence describing a non binding recommendation included to increase the chances that XML documents can be processed by the existing installed base of SGML processors which predate the WebSGML Adaptations Annex to ISO 8879 2 Documents Definition A data object is an XML document if it is well formed as defined in this specification A well formed XML document may in addition be valid if it meets certain further constraints Each XML document has both a logical and a physical structure Physically the document i
257. invecune T maxOccurs unbounded gt 2uyers sauce lt xsd element ref since gt Events Calendar lt xsd element ref qualification gt Standards List lt xsd sequence gt Submissions List lt xsd complexType gt http www xml com pub a 2000 1 1 29 schemas part1 html page 2 1 di 2 10 05 2001 9 18 08 XML com Using W3C XML Schema Nov 29 2000 lt xsd element gt TOOLBOX gt lt xsd element name book gt Syntax Checker lt xsd complexType gt XML Testbed lt xsd sequence gt lt xsd element ref title gt lt xsd element ref author gt lt xsd element ref character PUBLICATIONS minOccurs 0 maxOccurs unbounded gt lt xsd sequence gt THIS SITE IS ON THE xsd attribute ref isbn gt lt xsd complexType gt lt xsd element gt lt xsd schema gt Download this schema Using a reference to an element or an attribute is somewhat comparable to cloning an object The element or attribute is defined first and it can be duplicated at another place in the document structure by the reference mechanism in the same way an object can be cloned The two elements or attributes are then two instances of the same class The next section shows how we can define such classes called types that enable us to re use element definitions Pages 1 2 3 4 5 6 7 8 9 Next Page gt TAXI to the Future ae http www xml com pub a 2000 1 1 29 schemas part1 html page 2 2 di 2
258. ion uriReference any attributes with non schema namespace gt Content annotation attributeGroup complexType group simpleType redefine Can be included in schema e restriction ref Derivation of a simple datatype by restriction restriction id ID base QName any attributes with non schema namespace Content annotation simpleType minExclusive minInclusive maxExclusive maxInclusive precision scale length minLength maxLength encoding period duration enumeration pattern lt restriction gt Can be included in complexContent simpleContent simpleType e scale ref Facet to define the scale of a numeric datatype scale id ID value nonNegativeInteger fixed boolean false any attributes with non schema namespace Content annotation scale Can be included in restriction e schema ref Document element of a W3C XML Schema schema attributeFormDefault blockDefault fall List of substitution elementFormDefault finalDefault all id ID targetNamespace uriReference version string any attributes with non schema namespace Content include import List of extension redefine annotation attribute attributeGroup complexType element qualified unqualified qualified unqualified restriction unqualified extension r
259. ired to read only entities in the UTF 8 and UTF 16 encodings it is recognized that other encodings are used around the world and it may be desired for XML processors to read entities that use them In the absence of external character encoding information such as MIME headers parsed entities which are stored in an encoding other than UTF 8 or UTF 16 must begin with a text declaration see 4 3 1 The Text Declaration containing an encoding declaration Encoding Declaration 80 EncodingDecl S encoding Eq EncName wee EncName wee 81 EncName A Za z A Z2a z0 9 Encoding name contains only Latin characters In the document entity the encoding declaration is part of the XML declaration The EncName is the name of the encoding used In an encoding declaration the values UTF 8 UTF 16 190 10646 UCS 2 and 130 10646 UCS 4 should be used for the various encodings and transformations of Unicode ISO IEC 10646 the values ISO 8859 1 TSO 8859 2 180 8859 n where n is the part number should be used for the parts of ISO 8859 and the values 180 2022 JP Shift JIS and EUC JP should be used for the various encoded forms of JIS X 0208 1997 It is recommended that character encodings registered as charsets with the Internet Assigned Numbers Authority ANA CHARSETS other than those just listed be referred to using their registered names other encodings should use names starting with
260. is often almost always necessary to supplement the source with boilerplate or other hardwired information The stylesheet can add any arbitrary information to the result tree as it builds the result tree from information found in the source trees A stylesheet can be the synthesis of the primary file and any number of supplemental files that are included or imported by the main file This provides powerful mechanisms for sharing and exploiting fragments of stylesheets in different scenarios 1 1 5 8 Extensible language design supplements processing The X in XSLT stands for Extensible for a reason the designers have built in conforming techniques for accessing non conforming facilities requested by a stylesheet writer that may or may not be available in the XSLT processor interpreting the stylesheet A conforming processor may or may not support such extensions and is only obliged to accommodate error and fallback processing in such a way that a stylesheet writer can reconcile the behavior if needed An XSLT processor can implement extension instructions functions serialization conventions and sorting schemes that provide functionality beyond what is defined in XSLT 1 0 all accessed through standardized facilities A stylesheet writer must not rely on any extension facilities if the XSLT processor being used for the stylesheet is not known or is outside of the stylesheet writer s control If an end user base utilizes different brands of XS
261. is restricted in position and content in order to make it feasible to autodetect the character encoding in use in each entity in normal cases Also in many cases other sources of information are available in addition to the XML data stream itself Two cases may be distinguished depending on whether the XML entity is presented to the processor without or with any accompanying external information We consider the first case first Because each XML entity not in UTF 8 or UTF 16 format must begin with an XML encoding declaration in which the first characters must be xm1 any conforming processor can detect after two to four octets of input which of the following cases apply In reading this list it may help to know that in UCS 4 lt is x0000003C and is 4 x0000003F and the Byte Order Mark required of UTF 16 data streams is xFEFF e 00 00 00 3C UCS 4 big endian machine 1234 order 3C 00 00 00 UCS 4 little endian machine 4321 order 00 00 3C 00 UCS 4 unusual octet order 2143 00 3C 00 00 UCS 4 unusual octet order 3412 FE FF UTF 16 big endian FF FE UTF 16 little endian 00 3C 00 3F UTF 16 big endian no Byte Order Mark and thus strictly speaking in error 3C 00 3F 00 UTF 16 little endian no Byte Order Mark and thus strictly speaking in error 3C 3F 78 6D UTF 8 ISO 646 ASCII some part of ISO 8859 Shift JIS EUC or any other 7 bit 8 bit or mixed width encoding which ensures that the cha
262. is comprehensive guide to XSL Transformations XSLT and the XML Path Language XPath according to the XSLT XPath 19991116 1 0 Recommendations is over 300 pages of explanatory material diagrams tables and code samples Every markup construct used for XSLT and XPath is identified and described The focus is primarily on the W3C work and not on archaic definitions or implementations Important note There are copies of a prose re write of a two chapter excerpt of the eighth edition posted publicly on the web though the purchasable product is not in prose rather it is in a detailed bulleted format all that is missing is the sentence structure not any content Please review the free download excerpt to see the exact nature of the materials as they are currently available for purchase as the purchase is non refundable AII future editions will be freely available to all registered customers of the current work The nature of future work is now focused on keeping the material up to date not on the re writing of the content into prose The W3C XSL Working Group has announced their new charter at http www w3 org Style 2000 xsl charter html indicating upcoming revisions to the Recommendations We plan to keep this material up to date with revisions to the Recomendations and to continue to re issue new editions of your purchase as the Recommendations change or as we receive sufficient feedback to warrant releasing new material Free Download at top of
263. is element the value preserve indicates the intent that applications preserve all the white space This declared intent is considered to apply to all elements within the content of the element where it is specified unless overriden with another instance of the xml space attribute The root element of any document is considered to have signaled no intentions as regards application space handling unless it provides a value for this attribute or the attribute is declared with a default value 2 11 End of Line Handling XML parsed entities are often stored in computer files which for editing convenience are organized into lines These lines are typically separated by some combination of the characters carriage return xD and line feed xA To simplify the tasks of applications the characters passed to an application by the XML processor must be as if the XML processor normalized all line breaks in external parsed entities including the document entity on input before parsing by translating both the two character sequence xD xA and any xD that is not followed by xA to a single xA character 2 12 Language Identification In document processing it is often useful to identify the natural or formal language in which the content is written A special attribute named xm1 Lang may be inserted in documents to specify the language used in the contents and attribute values of any element in an XML document In valid documents this attribut
264. ise terminology that Wb hasn t yet been introduced and I overview the stylesheet contents and processor behaviors in only broad terms Subsequent subsections of this chapter review some of the basic terminology and design ESSENTIALS approaches Annotated XML I hope not to frighten the reader with the complexity of these examples but it is important to realize that there are more complex operations than can be illustrated using our earlier three line source file example What is XML EE Eum What is XSLT The complexity of your transformations will dictate the complexity of the stylesheet facilities being SOR LEE engaged Simple transformations can be performed quite simply using XSLT but not all of us have to What is XLink gag Pp p q ply g m meet only simple requirements What is XML Schema What is RDF The following XML source information in prod xml is used to produce two very dissimilar renderings Creating Audio CDs With a conferences oreilly com Linux INNOVATE COLLABORATE DISCOVER Lut he Find it om the O Reilly Network http www xml com pub a 2000 08 holman s2_1 html page 2 1 di 7 10 05 2001 9 07 18 XML com Getting started with XSLT and XPath Aug 23 2000 oe Search lt Pxmll versions i s 2 l prot zm Article Arc
265. isite XSLT namespace and version declarations Line 7 declares the output to follow XML lexical conventions and that the XML declaration is to be omitted from the serialized result Lines 9 through 11 declare the content of the result that is added when the source information position matches the XPath expression in the mat ch attribute on line 9 The value of matches the root of the document hence this refers to the XSLT processor s initial focus The result we specify on line 10 wraps our source information in the HTML elements without the boilerplate used in the previous example Line 13 ends the formal specification of the stylesheet content Using an MS DOS command line invocation to execute the XT processor we see the following result X samp gt xt hello xml hello xsl hello htm X samp gt type hello htm lt b gt lt i gt lt u gt Hello world lt u gt lt i gt lt b gt X samp gt Example 2 5 Explicit invocation of Example 2 4 Using a non XML aware browser to view the resulting HTML in Example 2 5 we see the following on the canvas the child window is opened using the View Source menu item http www xml com pub a 2000 08 holman s2 1 html page 1 4 di 6 10 05 2001 9 06 36 XML com Getting started with XSLT and XPath Aug 23 2000 yix Netscape file x27C samp hello htm File Edit View Go Bookmarks Options Directory Window Help Location ffile 7C samp hello htm Hello world vx Netscape
266. issions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIONS THIS SITE IS ON THE vendors have imposed their constraints on the way we can represent our information Our data has been created maintained stored and archived according to the rules enforced by others The advent of the Extensible Markup Language XML moves the control of our information out of the hands of others and into our own by providing two basic facilities 1 2 4 Three tiered architectures XML describes rules for structuring our information using embedded markup of our own choice We can take control of our information representation by creating and using a vocabulary we design of elements and attributes that makes sense for the way we do our business and use our data In addition XML describes a language for formally declaring the vocabularies we use This allows our tools to constrain the creation of an instance of our information and allows our users to validate a properly created instance of information against our set of constraints Note 1 An XML document is just an instance of well formed XML The two terms document and instance could be used interchangeably but this reference material uses the term instance to help readers remember that XML isn t just for documents or documentation With XML we describe a related set of information in a tree like hierarchical fashion and gain the benefits of having done so whether
267. ix the references to objects datatypes elements attributes etc belonging to this namespace Again we could have chosen any prefix to identify this namespace The targetNamespace attribute lets you define independently of the namespace declarations which namespace is described in this schema If you need to reference objects belonging to this namespace which is usually the case except when using a pure Russian Doll design you need to provide a namespace declaration in addition to the targetNamespace The final two attributes in the example elementFormDefault and attributeFormDefault are a facility provided by W3C XML Schema to control within a single schema whether attributes and elements are considered by default to be qualified in a namespace This differentiation between qualified and unqualified can be indicated by specifying the default values as above but also when defining the element or attribute by adding a form attribute of value qualified or unqualified It is important to note that only local elements and attributes can be specified as unqualified All globally defined elements and attributes must always be qualified http www xml com pub a 2000 1 1 29 schemas part1 html page 8 1 di 3 10 05 2001 9 19 51 XML com Using W3C XML Schema Nov 29 2000 XML Testbed SEYBOLD PUBLICATIONS THIS SITE IS ON THE z Importing definitions from external namespaces W3C XML Schema not unlike XSLT and X
268. just as we have done on the names used to indicate element types 1 1 6 2 URI value association But having the prefix is not enough because we haven t yet guaranteed global identity or singularity by a short string of name characters to do so we must associate the prefix with a globally unique URI before we use that prefix Note that we are unable to use a URI directly as a prefix because the lexical constraints on a URI are looser than those of an XML name the invalid XML name characters in a URI would cause an XML processor to balk We assert the association between a namespace prefix and a namespace URI by using a namespace declaration attribute as in the following examples e xnlns svg http www w3 org 2000 svg 20000629 e xnlns math http www w3 o0rg 1998 Math MathML As noted earlier the prefix we choose is arbitrary and can be any lexically valid XML name The prefix is discarded by the namespace aware processor and is immaterial to the application using the names it is only a syntactic shortcut to get at the associated URI The associated URI supplants the prefix in the internal representation of the name value and the application can distinguish the names by the new composite name that would have been illegal in XML syntax There is no convention for documenting a namespace qualified name using its associated URI but one way to perceive the uniqueness is to consider our example as it might be internally represented by an app
269. l com pub a 2000 08 holman s1 html 4 di 8 10 05 2001 9 01 41 XML com What is XSLT I Aug 16 2000 also the syntax rules dictated by the supplied document model validity Looking at the same customer element as before now on line 12 the document model indicates on line 6 that the db attribute is indeed required if the attribute is absent the XML processor can report syntactic model constraint violation even if the element is otherwise lexically well formed The document model can also provide additional information not evident without a document model such as the information on line 4 that the id attribute for purchase is of XML type ID 1 1 1 2 No built in meanings or concepts The area of semantics associated with XML instances is very gray A document model is but one component used to help describe the semantics of the information found in an instance While well formed instances do not have a formal document model often the names of the constructs used within the instances give hints to the associated semantics Without a formalism yet available in our community to express semantics in a rigorous fashion we users of XML do or should capture the semantics of a given vocabulary in prose whether or not the document model is formalized The XML 1 0 Recommendation only describes the behavior required of an XML processor acting on an XML stream and how it must identify constituent data and provide that data
270. lated attributes it may have using the parameter entities provided in 4 1 Information Associated with Links The xml link attribute value for a simple link must be simple http www w3 org TR 1998 WD xlink 19980303 9 di 16 10 05 2001 9 30 10 XML Linking Language XLink lt ELEMENT simple ANY gt lt ATTLIST simple SL ak CDATA F IXED s Locator att Sremote resource semantics att S local resource semantics att simple link semantics att There are no constraints on the contents of a simple linking element In the sample declaration above it is given a content model of ANY to indicate that any content model or declared content is acceptable In a valid document every element that is significant to XLink must still conform to the constraints expressed in its governing DTD Following is an example of a simple link mylink xml link 2 simple title Citation href http www xyz com xml foo xml show new content role Reference as discussed in Smith 1997 mylink This example mylink element might have the following element and attribute list declarations lt ELEMENT mylink PCDATA gt AMATIL TOI my Link sms nde CDATA FIXED simple href CDATA REQUIRED concent role DATA IMPLIED Note that it is meaningful to have an out of line simple link although such links are uncommon They are called one ended and are typically used to associate discrete semantic properties with locations The prope
271. ld be human legible and reasonably clear The XML design should be prepared quickly H The design of XML shall be formal and concise 19 9o S Qv Ue uo 9 quo p XML documents shall be easy to create H o Terseness in XML markup is of minimal importance H C l This specification together with associated standards Unicode and ISO IEC 10646 for characters Internet RFC 1766 for language identification tags ISO 639 for language name codes and ISO 3166 for country name codes provides all the information necessary to understand XML Version 1 0 and construct computer programs to process itp This version of the XML specification may be distributed freely J as long as all text and legal notices remain intact 1 2 Terminology The terminology used to describe XML documents is defined in the body of this specification The terms defined in the following list are used in building those definitions and in describing the actions of an XML processor may Definition Conforming documents and XML processors are permitted to but need not T behave as described must Conforming documents and XML processors are required to behave as described otherwise they are in error T error Definition A violation of the rules of this specification results are undefined Conforming software may detect and report an error and may recover from it fatal error Definition An error which a conforming XML processor must detect and repor
272. ld declare the entities amp 1t gt apos quot in the form specified in 4 6 Predefined Entities The declaration of a parameter entity must precede any reference to it Similarly the declaration of a general entity must precede any attribute list declaration containing a default value with a direct or indirect reference to that general entity Well formedness constraint Parsed Entity An entity reference must not contain the name of an unparsed entity Unparsed entities may be referred to only in attribute values declared to be of type ENTITY or ENTITIES Well formedness constraint No Recursion A parsed entity must not contain a recursive reference to itself either directly or indirectly Well formedness constraint In DTD Parameter entity references may only appear in the DTD Examples of character and entity references http www w3 org TR REC xml 23 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition Example of a parameter entity reference 4 2 Entity Declarations Definition Entities are declared thus Entity Declaration 70 EntityDecl GEDecl PEDecl 71 GEDecl m lt ENTITY S Name S EntityDef S 7 2 PEDecl m lt ENTITY S S Name S PEDef S 73 EntityDef EntityValue ExternalID NDataDecl 7 4 PEDef m EntityValue ExternalID The Name identifies the entity in an entity reference or in the case of an unparsed entity in th
273. least one non blank character and neither the first nor last non blank character of the replacement text should be a connector or Examples of element content models http Awww w3 org TR REC xml 16 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition 3 2 2 Mixed Content Definition An element type has mixed content when elements of that type may contain character data optionally interspersed with child elements In this case the types of the child elements may be constrained but not their order or their number of occurrences Mixed content Declaration 51 Mixed S PCDATA S S Name S S PCDATA S VC Proper Group PE Nesting VC No Duplicate Types where the Names give the types of elements that may appear as children The keyword PCDATA derives historically from the term parsed character data Validity constraint No Duplicate Types The same name must not appear more than once in a single mixed content declaration Examples of mixed content declarations 3 3 Attribute List Declarations Attributes are used to associate name value pairs with elements Attribute specifications may appear only within start tags and empty element tags thus the productions used to recognize them appear in 3 1 Start Tags End Tags and Empty Element Tags Attribute list declarations may be used e To define the set of attributes pertaining to
274. lement called the head using a substitutionGroup attribute The head element doesn t hold any specific declaration but must be global All the elements within a substitution group need to have a type that is either the same type as the head element or can be derived from it Then they can all be used in place of the head http www xml com pub a 2000 1 1 29 schemas part1 html page 7 1 di 2 10 05 2001 9 19 36 X ML Products Tools Training O REIL x XML com Using W3C XML Schema Nov 29 2000 THIS SITE IS ON THE element In the following example the element surname can be used anywhere an element name has been defined lt xsd element name name type xsd string gt lt xsd element name surname type xsd string substitutionGroup name gt Now we can also define a generic name elt element head of a substitution group that couldn t be used directly but should be used in one of its derived forms This is done through declaring the element as abstract analagously to abstract classes in object oriented languages The following example defines name e1t as an abstract element that should be replaced by either name or surname everywhere it is referenced lt xsd element name name elt type xsd string abstract true gt lt xsd element name name type xsd string substitutionGroup name elt gt lt xsd element name surname type xsd string substitutionGroup name elt gt Final types W
275. lication e http www w3 org 2000 svg 20000629 set e http www w3 org 1998 Math MathMLjset The specification of a URI instead of a URL means that the namespace aware processor will never look at the URI as a URL to accomplish its work There never need be any resource available at the URI used in a namespace declaration The URI is just a string and its value is used only as a string and the fact that there may or may not be any resource at the URL identified by the URI is immaterial to namespace processing The URI does not identify the location of a schema or a DTD or any file whatsoever when used by a namespace aware processor http www xml com pub a 2000 08 holman s1 html page 2 15 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 Note 10 Perhaps some of the confusion regarding namespaces is rooted in the overloading of the namespace URI by some Recommendations These Recommendations require that the URI represent a URL where a particular resource is located fetched and utilized to some purpose This behavior is outside the scope of namespaces and is mandated solely by the Recommendations that require it Practice has however indicated an end user friendly convention regarding the URI used in namespace declarations The W3C has placed a documentation file at every URL represented by a namespace URI Requesting the resource at the URL returns an HTML document discussing the namespace being r
276. lly interspersed with child elements In this case the types of the child elements may be constrained but not their order or their number of occurrences T Mixed content Declaration Sill mizecl e Be 9 7 Sg SPCDATA LJ S UY Se iene SL oU SS PVE 2 ropes E PCDATAY SP Group PE yd Nesting L Wes Ney Duplicate Types where the Names give the types of elements that may appear as children Validity Constraint No Duplicate Types The same name must not appear more than once in a single mixed content declaration Examples of mixed content declarations 3 3 Attribute List Declarations Attributes are used to associate name value pairs with elements Attribute specifications may appear only within start tags and empty element tags thus the productions used to recognize them appear in 3 1 Start Tags End Tags and Empty Element Tags Attribute list declarations may be used e To define the set of attributes pertaining to a given element type e To establish type constraints for these attributes e To provide default values for attributes Definition Attribute list declarations specify the name data type and default value if any of each attribute associated with a given element type To Attribute list Declaration http www xml com axml testaxml htm 14 di 34 10 05 2001 9 26 16 The Annotated XML Specification 52 AttlistDecl lt ATTLIST U S Name AttDef
277. lthough there will eventually be sophisticated editors to create and edit XML content they won t appear immediately In the interim it must be possible to create XML documents in other ways directly in a text editor with simple shell and Perl scripts etc 10 Terseness in XML markup is of minimal importance Several SGML language features were designed to minimize the amount of typing required to manually key in SGML documents These features are not supported in XML From an abstract point of view these documents are indistinguishable from their more fully specified forms but supporting these features adds a considerable burden to the SGML parser or the person writing it anyway In addition most modern editors offer better facilities to define shortcuts when entering text How Is XML Defined XML is defined by a number of related specifications Extensible Markup Language XML 1 0 Defines the syntax of XML The XML specification is the primary focus of this article XML Pointer Language XPointer and XML Linking Language XLink Defines a standard way to represent links between resources In addition to simple links like HTML s lt A gt tag XML has mechanisms for links between multiple resources and links between read only resources XPointer describes how to address a resource XLink describes how to associate two or more resources Extensible Style Language XSL Defines the standard stylesheet langua
278. lue T If a default value is declared when an XML processor encounters an omitted attribute it is to behave as though the attribute were present with the declared default value U Validity Constraint Required Attribute If the default declaration is the keyword REQUIRED then the attribute must be specified for all elements of the type in the attribute list declaration http www xml com axml testaxml htm 16 di 34 10 05 2001 9 26 16 The Annotated XML Specification Validity Constraint Attribute Default Legal The declared default value must meet the lexical constraints of the declared attribute type T Validity Constraint Fixed Attribute Default If an attribute has a default value declared with the F IXED keyword instances of that attribute must match the default value Examples of attribute list declarations 3 3 3 Attribute Value Normalization Before the value of an attribute is passed to the application or checked for validity the XML processor must normalize it as follows T e acharacter reference is processed by appending the referenced character to the attribute value e anentity reference is processed by recursively processing the replacement text of the entity e a whitespace character 2x20 xD xA x9 is processed by appending x20 to the normalized value except that only a single x20 is appended for a xD xA sequence that is part of an external parsed entity or the literal entity value of an int
279. m OREILLY COM search RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF EJB Find it at ONJava com FIND Search Article Archive FAQs Add the latest news from XML com to your web site web site e c COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed Print This Article O REILLY CONVENTION Schemas mie W3C XML Schema Datatypes Reference by Rick Jelliffe November 29 2000 This quick reference helps you easily locate the definition of datatypes in the XML Schema specification A What You Need To Know section gives a brief introduction to the way datatypes work Specification Map lt OS SE NS CA III Boolean ENTITY ID REF ON inary esl oul fronNegativelnteger conferences oreilly com INNOVATE COLLABORATE DISCOVER language Name NCName junsignedShort byte What You Need To Know e W3C XML Schema specification defines many different built in datatypes These datatypes can be used to constrain the values of attributes or elements which contain only simple content
280. magic element how can I make it point to more than one resource TOOLBOX e What if I want links to have different meanings relevant to my data E g the motherhood and Syntax Checker friendship relationships between two person XML Testbed elements In answer to these and many other linking questions this SEYBO LD article describes the structure and use of XLink The article is JqUY YWEX XXE Y composed of three parts a brief example that illustrates the basics of the language a complete review of the structure of THIS SITE IS ON THE XLink and a list of XLink related resources The resources z include some XSLT transformations that enable your HTML output to simulate required XLink behavior on today s browsers Pages 1 2 3 Next Page gt lt The Who What How and Why of P2P K The O Reilly P2P Research Report http www xml com pub a 2000 09 xlink index html page 1 2 di 2 10 05 2001 9 11 56 XML com What is RDF Jan 24 2001 O REILLY X xml from the inside out ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema O REILLY O REILLY NETWORK What is RDF Find it om the O Reilly Network FIND Search Article Archive FAQs Add the latest news from XML com to your web site gt COLUMNS
281. man s2_1 html page 2 4 di 7 10 05 2001 9 07 18 XML com Getting started with XSLT and XPath Aug 23 2000 moves on line 11 to each product source element in turn and the markup associated with the traversal builds each lt td gt result element The content of each column is specified as which for an element evaluates to the string value of that element Having completed the table header the table body rows are then built one at a time traversing each cust child of a record child of the sales child of the root of the document according to the XPath expression sales record cust The current focus moves to the cust element for the processing on lines 15 through 21 A local scope variable is bound on line 15 with the tree location of the current focus note how this instruction uses the same XPath expression as on line 11 but with a different result A table row is started on line 16 with the leftmost column calculated from the num attribute of the cust element being processed The stylesheet then builds in lines 17 through 20 a column for each of the same columns created for the table header on line 10 The focus moves to each product in turn for the processing of lines 18 through 20 Each column s value is then calculated with the expression Scustomer prodsale idref current id which could be expressed as follows from the customer location bound to the variable customer from all of the prodsale
282. markup through to the application T A validating XML processor must also inform the application which of these characters constitute white space appearing in element content T A special attribute named xm1 space may be attached to an element to signal an intention that in that element white space should be preserved by applications T In valid documents this attribute like any other must be declared if it is used When declared it must be given as an enumerated type whose only possible values are default and preserve For example w o eee The value default signals that applications default white space processing modes are acceptable for this element the value preserve indicates the intent that applications preserve all the white space This declared intent is considered to apply to all elements within the content of the element where it is specified unless overriden with another instance of the xm1 space attribute The root element of any document is considered to have signaled no intentions as regards application space handling unless it provides a value for this attribute or the attribute is declared with a default value 2 11 End of Line Handling XML parsed entities are often stored in computer files which for editing convenience are organized into lines These lines are typically separated by some combination of the characters carriage return xD and line feed xA To simplify the tasks of applications w
283. mespaces distinguish internal XSLT objects we include in our stylesheets Each of these will be detailed later where such constructs are described 1 1 7 Stylesheet association When we wish to associate with our information one or more preferred or suitable stylesheet resources geared to process that information the W3C stylesheet association Recommendation describes the syntax and semantics for a construct we can add to our XML documents e http www w3 org TR xml stylesheet 1 1 7 1 Relating documents to their stylesheets XML information in its authored form is often not organized in an appropriate ordering for consumption A stylesheet association processing instruction is used at the start of an XML document to indicate to the recipient which stylesheet resources are to be used when reading the contents of that document The recipient is not obliged to use the resources referenced and can choose to examine the XML using any stylesheet or transformation process they desire by ignoring the preferences stated within Some XML applications ignore the stylesheet association instruction entirely while others choose to steadfastly respect the instruction without giving any control to the recipient A flexible application will let the recipient choose how they wish to view the content of the document The designers of this specification adopted the same semantics of the LINK construct defined in the HTML 4 0 recommendation e LINK REL
284. meter entity reference appears in a literal entity value its replacement text is processed in place of the reference itself as though it were part of the document at the location the reference was recognized except that a single or double quote character in the replacement text is always treated as a normal data character and will not terminate the literal For example this is well formed http www w3 org TR REC xml 28 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition lt gt CIENDETY oh yes TC E lt ENTITY WhatHeSaid He said YN gt while this is not SURINDER IESG ENJACEE Zag ee lt element attribute a amp EndAttr 4 4 6 Notify When the name of an unparsed entity appears as a token in the value of an attribute of declared type ENTITY or ENTITIES a validating processor must inform the application of the system and public if any identifiers for both the entity and its associated notation 4 4 7 Bypassed When a general entity reference appears in the EntityValue in an entity declaration it is bypassed and left as is 4 4 8 Included as PE Just as with external parsed entities parameter entities need only be included if validating When a parameter entity reference is recognized in the DTD and included its replacement text is enlarged by the attachment of one leading and one following space x20 character the intent is to constrain the replacement text
285. ml 4 di 7 10 05 2001 9 21 46 XML com W3C XML Schema Structures Reference Nov 29 2000 e maxExclusive ref Facet to define a maximum exclusive value maxExclusive id ID value string fixed boolean false any attributes with non schema namespace gt Content annotation maxExclusive Can be included in restriction e maxInclusive ref Facet to define a maximum inclusive value maxInclusive id ID value string fixed boolean false any attributes with non schema namespace gt Content annotation maxInclusive Can be included in restriction e maxLength ref Facet to define a maximum length maxLength id ID value string fixed boolean false any attributes with non schema namespace gt Content annotation lt maxLength gt Can be included in restriction e minExclusive ref Facet to define a minimum exclusive value minExclusive id ID value string fixed boolean false any attributes with non schema namespace gt Content annotation minExclusive Can be included in restriction e minInclusive ref Facet to define a minimum inclusive value minInclusive id ID value string fixed boolean false any attributes with non schema namespace gt Content annotation minInclusive Can be included in restriction e minLength ref Facet to define a minimum length minLength id
286. mparison gt lt commentary gt For convenience defaults for the semantic attributes on locator elements can be specified on the linking element that contains them If any such attribute is omitted from a locator element the value provided on the containing linking element is to be used Following is a sample declaration for an extended link using the parameter entities provided in 4 1 Information Associated with Links showing all the possible XLink related attributes it may have including the remote resource semantic attributes http www w3 org TR 1998 WD xlink 19980303 11 di 16 10 05 2001 9 30 10 XML Linking Language XLink lt ELEMENT extended ANY gt lt ATTLIST extended zmls xmi CDATA FIXED extended Slink semantics att S local resource semantics att Sremote resource semantics att The content of a linking element typically consists only of locator elements however the declaration as ANY indicates that any other content may be added In a valid document every element that is significant to XLink must still conform to the constraints expressed in its governing DTD Only locator elements that are direct children of the linking element define resources linked by that linking element A key issue with out of line extended links is how linking application software can manage and find them particularly when they are stored in completely separate documents from those in which their participating resources
287. n an entity declaration or a notation declaration These declarations may be contained in whole or in part within parameter entities as described in the well formedness and validity constraints below For fuller information see 4 Physical Structures The markup declarations may be made up in whole or in part of the replacement text of parameter entities The productions later in this specification for individual nonterminals e1ementdec1 AttlistDec1 and so on describe the declarations after all the parameter entities have been included Validity Constraint Root Element Type The Name in the document type declaration must match the element type of the root element Validity Constraint Proper Declaration PE Nesting Parameter entity replacement text must be properly nested with markup declarations That is to say if either the first character or the last character of a markup declaration narkupdec1 above is contained in the replacement text for a parameter entity reference both must be contained in the same replacement text Well Formedness Constraint PEs in Internal Subset In the internal DTD subset parameter entity references can occur only where markup declarations can occur not within markup declarations This does not apply to references that occur in external parameter entities or to the external subset T Like the internal subset the external subset and any external parameter entities referred to
288. n and values of type IDREFS must match Names each Name must match the value of an ID attribute on some element in the XML document i e IDREF values must match the value of some ID attribute Validity constraint Entity Name Values of type ENTITY must match the Name production values of type ENTITIES must match Names each Name must match the name of an unparsed entity declared in the DTD Validity constraint Name Token Values of type NMTOKEN must match the Nmtoken production values of type NMTOKENS must match http www w3 org TR REC xml 18 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition Nmtokens Definition Enumerated attributes can take one of a list of values provided in the declaration There are two kinds of enumerated types Enumerated Attribute Types 57 EnumeratedType NotationType Enumeration 58 NotationType NOTATION S S Name S VC Notation Attributes S Name S VC One Notation Per Element Type VC No Notation on Empty Element 59 Enumeration m C S Nmtoken S S VC Enumeration Nmtoken S A NOTATION attribute identifies a notation declared in the DTD with associated system and or public identifiers to be used in interpreting the element to which the attribute 1s attached Validity constraint Notation Attributes Values of this type must match one of the notation names included in the decl
289. n XML processor attempting to retrieve the entity s content may use the public identifier to try to generate an alternative URI If the processor is unable to do so it must use the URI specified in the system literal T Before a match is attempted all strings of white space in the public identifier must be normalized to single space characters 21x20 and leading and trailing white space must be removed Examples of external entity declarations 4 3 Parsed Entities 4 3 1 The Text Declaration External parsed entities may each begin with a text declaration Text Declaration 77 TextDecl lt xml VersionInfo Encodimgbecl 9 2p The text declaration must be provided literally not by reference to a parsed entity No text declaration may appear at http www xml com axml testaxml htm 20 di 34 10 05 2001 9 26 16 The Annotated XML Specification any position other than the beginning of an external parsed entity T 4 3 2 Well Formed Parsed Entities The document entity is well formed if it matches the production labeled document An external general parsed entity is well formed if it matches the production labeled ext ParsedEnt J An external parameter entity is well formed if it matches the production labeled ext PE Well Formed External Parsed Entity 78 extParsedEnt TextDecl content 79 extPE TextDecl extSubsetDecl An internal general parsed entity is well form
290. n act appropriately whether by invoking a separate input routine for each case or by calling the proper conversion function on each character of input Like any self labeling system the XML encoding declaration will not work if any software changes the entity s character set or encoding without updating the encoding declaration Implementors of character encoding routines should be careful to ensure the accuracy of the internal and external information used to label the entity The second possible case occurs when the XML entity is accompanied by encoding information as in some file systems and some network protocols When multiple sources of information are available their relative priority and the preferred method of handling conflict should be specified as part of the higher level protocol used to deliver XML Jj Rules for the relative priority of the internal label and the MIME type label in an external header for example should be part of the RFC document defining the text xml and application xml MIME types In the interests of interoperability however the following rules are recommended e If an XML entity is in a file the Byte Order Mark and encoding declaration PI are used if present to determine the character encoding All other heuristics and sources of information are solely for error recovery e If an XML entity is delivered with a MIME type of text xml then the charset parameter on the MIME type determines the character encodin
291. n entity which begins with neither a Byte Order Mark nor an encoding declaration to use an encoding other than UTF 8 Note that since ASCII is a subset of UTF 8 ordinary ASCII entities do not strictly need an encoding declaration T It is a fatal error when an XML processor encounters an entity with an encoding that it is unable to process Examples of encoding declarations http www xml com axml testaxml htm 21 di 34 10 05 2001 9 26 16 The Annotated XML Specification 4 4 XML Processor Treatment of Entities and References The table below ji summarizes the contexts in which character references entity references and invocations of unparsed entities might appear and the required behavior of an XML processor in each case The labels in the leftmost column describe the recognition context Reference in Content as a reference anywhere after the start tag and before the end tag of an element corresponds to the nonterminal content E Reference in Attribute Value as a reference within either the value of an attribute in a start tag or a default value in an attribute declaration corresponds to the nonterminal Att Value E Occurs as Attribute Value as a Name not a reference appearing either as the value of an attribute which has been declared as type ENTITY or as one of the space separated tokens in the value of an attribute which has been declared as type ENTITIES E Reference in Entity Value as a re
292. n goal XML is unequalled as an exchange format on the Web But by itself it doesn t provide what you need in a metadata framework Pages 1 2 3 Next Page gt PHP Admin Darrell Brogdon Basics Find it on the O Reilly Network MUST ENT OTT a wei http www xml com pub a 2001 01 24 rdf html page 2 2 di 2 10 05 2001 9 13 49 XML com What is RDF Jan 24 2001 O REILLY Xh xml from the inside out XML COM O REILLY NETWORK ONJAVA COM PHP Admin a D Basics arrell Brogdon Find it on the O Reilly Network B HE CENSO a moc OREILLY COM es RESOURCE P CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Find it on O Reilly Network FIND gt Search Article Archive FAQs What is RDF by Tim Bray Pages 1 2 3 Print This Article The Devil is in the Details Table of Contents The Right Way to Find Things eIt s All Different Behind the Scenes Not Just For Searching What About the Web The four general rules given above define the central 1deas of RDF It turns out that it takes quite a lot of abstract terminology _ Divine Metadata for the and XML Web syntax to define them precisely enough that people can write computer programs to process them In particular turni
293. n preference so let us first use a standalone XSLT processor with the following stylesheet he1lohtm xsl lt xml version 1 0 hellohtm xsl lt XSLT 1 0 http www CraneSoftwrights com training gt lt html xmlns xsl http www w3 org 1999 XSL Transform xsl version 1 0 lt head gt lt title gt Greeting lt title gt lt head gt lt body gt lt p gt Words of greeting lt br gt lt b gt lt i gt lt u gt lt xsl value of select greeting gt lt u gt lt i gt lt b gt lt p gt lt body gt amv Example 2 2 An implicitly declared simple stylesheet This file looks like a simple XHTML file an XML file using the HTML vocabulary Indeed it is just that but we are allowed to inject into the instance XSLT instructions using the prefix for the XSLT vocabulary declared on line 3 We can use any XML file as an XSLT stylesheet provided it declares the XSLT vocabulary within and indicates the version of XSLT being used Any prefix can be used for XSLT instructions though http www xml com pub a 2000 08 holman s2_1 html 2 di 6 10 05 2001 9 06 12 a XML com Getting started with XSLT and XPath Aug 23 2000 THIS SITE IS ON convention often sees xs1 as the prefix value Line 7 contains the only XSLT instruction in the instance The xs1 value of instruction uses an XPath expression in the select attribute to calculate a string value from our source information XPath views the
294. nd letters up to the terminating provide a hexadecimal representation of the character s code point in ISO IEC 10646 T If it begins just with amp the digits up to the terminating provide a decimal representation of the character s code point Definition An entity reference refers to the content of a named entity Definition References to parsed general entities use ampersand amp and semicolon as delimiters J Definition Parameter entity references use percent sign and semicolon as delimiters http Awww xml com axml testaxml htm 18 di 34 10 05 2001 9 26 16 The Annotated XML Specification WFC No Recursion WEG il ras aa Well Formedness Constraint Entity Declared In a document J without any DTD a document with only an internal DTD subset which contains no parameter entity references or a document with st andalone yes the Name given in the entity reference must match that in an entity declaration except that well formed documents need not declare any of the following entities amp lt gt apos quot The declaration of a parameter entity must precede any reference to it Similarly the declaration of a general entity must precede any reference to it which appears in a default value in an attribute list declaration Note that if entities are declared in the external subset or in external parameter entities a non validating processor is not obligated to read and process thei
295. nferences o es XML Products Tools Training O REILLY Xx XML com What is RDF Jan 24 2001 Style Matters XML Q amp A Transforming XML Perl and XML gt GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIONS THIS SITE IS ON THE You re in a video store and you want a movie by John Huston A large modern video store offers a lookup facility that s similar to the library s Of course the search properties are different director actors and so on but the results are more or less the same Scenario 3 The Phone Book You re working late at a customer s office in South Denver and it seems that a pizza is essential if work is to continue Fortunately every office comes equipped with a set of Yellow Pages that when properly used can lead to quick pizza delivery The Common Thread What do all these situations have in common and what differences lie behind the scenes First of all each of these systems is based on metadata that is information about information In each case you need a piece of information the book s location the video s name the pizza joint s phone number you don t have In each case you use metadata information about information to get it We re all used to this stuff metadata ordinarily comes in named chunks subject director business categor
296. ng 4 4 4 Forbidden 4 4 5 Included in Literal 4 4 6 Notify 4 4 7 Bypassed 4 4 8 Included as PE 4 5 Construction of Internal Entity Replacement Text 4 6 Predefined Entities 4 7 Notation Declarations 4 8 Document Entity 5 Conformance 5 1 Validating and Non Validating Processors 5 2 Using XML Processors 6 Notation Appendices A References A 1 Normative References A 2 Other References B Character Classes C XML and SGML Non Normative D Expansion of Entity and Character References Non Normative E Deterministic Content Models Non Normative F Autodetection of Character Encodings Non Normative G W3C XML Working Group Non Normative 1 Introduction Extensible Markup Language abbreviated XML describes a class of data objectsfyf called XML documentsi j and partially describes the behavior of computer programs which process them i Ji XML is an application profile or restricted form of SGML the Standard Generalized Markup Language ISO 8879 By construction XML documents are conforming SGML documents 1 XML documents are made up of storage units called entities which contain either parsed or unparsed data http Awww xml com axml testaxml htm 2 di 34 10 05 2001 9 26 15 The Annotated XML Specification Parsed data is made up of characters some of which form character data and some of which form markup Markup encodes
297. ng Statements into Resources is quite tricky It also turns out that in a very few cases you do need to order your properties and this requires quite a bit of syntax eIntroducing RDF Why Not Just Use XML he Devil is in the Details Vocabularies What RDF Might Mean Getting started with RDF Developer Community This article doesn t explain all these details there are a variety of excellent resources to be found at http www w3 org RDF that are designed to do just that Vocabularies RDF as we ve seen provides a model for metadata and a syntax so that independent parties can exchange it and use it What it http www xml com pub a 2001 01 24 rdf html page 3 1 di 4 10 05 2001 9 14 09 XML Products Tools Training XML com What is RDF Jan 24 2001 Add the latest mews from XML com to your web site Click here COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker XML Testbed SEYBOLD FUBLICATIONS THIS SITE IS ON THE doesn t provide though is any Properties of its own RDF doesn t define Author or Title or Director or Business Category That would be a job for GOD if there were one Since there isn t it s a job for everyone It seems unlikely that one Property standing by itself is apt to be v
298. ng the intermediate tree in syntax is not material to the process of rendering though having the option to serialize the hierarchy is a useful diagnostic tool The stylesheet writer has little or no control over the constructs chosen by the XSLT processor for serializing the result tree There are some behaviors the stylesheet can request of the processor though the processor is not obliged to respect the requests The stylesheet can request a particular output method be used for the serialization and if supported the processor guarantees the final result complies with the lexical requirements of that method Note 7 It is possible to coerce the XSLT processor to violate the lexical rules through certain stylesheet controls that I personally avoid using at all costs For every XML and HTML instance construct not including the document model syntax constructs there are proper XSLT methodologies to follow though not always as compact as coercing the processor The abstract nature of the node trees representing the input source and stylesheet instances and the hands off nature of serializing the abstract result node tree are the primary reasons that source tree original markup syntax preservation cannot be supported The design of the language does however support the serialization of the result tree in such a way as not to require the XSLT processor to maintain the result tree in the abstract form For example the processor can instantl
299. nnotated XML What is XML What is XSLT What is XLink What is XML Schema O REILLY What is RDF Digital Slide Shows on Your Palm t 5 J z b g gt e o v Search Article Archive FAQs Add the latest news from XML com ee your web site gt COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List OPEN SOURCE 7 San Diego CONVENTION conferences o OREILLY COM a Print This Article Using W3C XML Schema by Eric van der Vlist Pages 1 2 3 4 5 6 7 8 9 Constraints W3C XML Schema provides several flexible XPath based features for describing uniqueness constraints and corresponding references constraints The first of these a simple uniqueness declaration is declared with the xsd unique element The following declaration within the context of our book document indicates that the character name must be unique Table of Contents Introducing Our First Schema Slicing the Schema Defining Named Types Groups Compositors and Derivation eContent Types Constraints Building Usable and Reusable Schemas Namespaces W3C XML Schema and Instance Documents W3C XML Schema Datatypes Reference W3C XML Schema Structures Reference xsd unique name charNameMustBeUniqu xsd selector xpath character gt
300. nnotation attribute attributeGroup anyAttribute attributeGroup Can be included in attributeGroup complexType extension redefine schema e choice ref Particle for a group of mutually exclusive elements choice id ID maxOccurs nonNegativeInteger unbounded EL minOccurs nonNegativeInteger 1 any attributes with non schema namespace gt Content annotation element group choice sequence any lt choice gt Can be included in choice complexType group sequence e complexContent ref Derivation of a simple type to complex content lt complexContent id ID mixed boolean any attributes with non schema namespace gt Content annotation restriction extension lt complexContent gt Can be included in complexType e complexType ref Definition of or reference to a complex type complexType abstract boolean false block fall List of extension restriction final fall List of extension restriction id ID mixed boolean false name NCName any attributes with non schema namespace gt Content annotation simpleContent complexContent group all choice sequence attribute attributeGroup anyAttribute complexType Can be included in element redefine schema http www xml com pub a 2000 1 1 29 schemas structuresref html 2 di 7 10 05 2001 9 21
301. notated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Tunneling Secures 802 11 FIND gt Search Article Archive FAQs Add the latest news from XML com to your web site gt COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed Pre conference Acland s 25th July Conference 26th amp 27th July Holiday Inn London Victoria Register Now OREILLY COM E What is XLink by Fabio Arciniegas A Pages 1 2 3 amp Print This Article Before we start to dissect the structure of XLink let s examine a concrete example Table of Contents Introduction eAn Example XLink XLink Reference The XLink Type Attribute XLink Types Use and Composition Simple Links Tools and References Conclusion The Artist Influence problem Suppose you want to express in XML the relationship between artists and their environment This includes making links from an artist to his her influences as well as links to descriptions of historical events of their time The data for each artist might be written in a file like the following lt xml version 1 0 gt lt artistinfo gt lt surname gt Modigliani lt surname gt lt name gt Amadeo lt name gt lt
302. ntainer elements The collection of literal result elements and other instructions being contained therein comprises the XSLT template for that instruction A template can contain only literal result elements only instruction elements or a mixture of both The behavior of the stylesheet can ask that a template be added to the result tree at which point the nodes for literal result elements are added and the nodes for instructions are executed Consider again the simple example in our stylesheets used earlier in this chapter where the following template is used 01 lt b gt lt i gt lt u gt lt xsl value of select greeting gt lt u gt lt i gt lt b gt Example 2 10 Simple template in Example 2 4 This template contains a mixture of literal result elements and an instruction element When the XSLT processor adds this template to the result tree the nodes for the lt b gt lt i gt and lt u gt elements are simply added to the tree while the node for the xs1 value of instruction triggers the processor to add the outcome of instruction execution to the tree A template rule is a declaration to the XSLT processor of a template to be added to the result tree when certain conditions are met by source locations visited by the processor Template rules are either top level elements explicitly written in the stylesheet or built in templates assumed by the processor and implicitly available in all stylesheets http www xml com pub a
303. o a xml from the inside out O REILLY NETWORK OREILLY COM Pre conference worksho Conference 26th amp 27th Ju Holiday Inn London Victoria 25th July y O Register Now ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Whatis RDF Protocols Schemas by Tim Bray Style January 24 2001 Web This article was first published as RDF and ESSENTIALS Metadata on XML comin The Right Way to Find AM XML June 1998 It has been Things What is XML updated by ILRT s Dan It s All Different Behind the X M LT Qu Brickley chair of the W3C s Scenes What is XSLT i What is XLink RDF Interest Group to Not Just For Searching reflect the growing use of What About the Web What is XML Schema RDF and updates to the What is RDF specification since 1998 Divine Metadata for the Web Products The Right Wav to eIntroducing RDF Security Find TEL y Why Not Just Use XML Tools Alerts g The Devil is in the Details Vocabularies RDF stands for Resource Noel Description Framework RDF Davis 1s built for the Web but let s leave the Web behind for now In the Linux DevCenter and think about how we find things in the real world Training What RDF Might Mean Getting started with RDF Developer Community O REILLY Xx gt FIND Search Scenario 1 The Library El ROS You re in a lib
304. o string processing not to complex operations required by some applications Note 3 When query Recommendations are developed I would hope that the addressing portion is based on XPath as a core just as with XSLT Pages 1 2 3 Next Page gt et n http www xml com pub a 2000 08 holman s1 html page 1 7 di 8 10 05 2001 9 02 26 XML com What is XSLT I Aug 16 2000 XM Tsugre CONFERENCE amp EXPOSITION 21 25 May 2001 Berlin m www xmleurope com http www xml com pub a 2000 08 holman s1 html page 1 8 di 8 10 05 2001 9 02 26 XML com What is XSLT I Aug 16 2000 O REILLY Xx o a xml from the inside out XML COM O REILLY NETWORK OREILLY COM ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF What is XSLT D by G Ken Holman Pages 1 2 3 The Context of XSL Transformations and the XML Path Language cont d 1 1 3 Styling structured information 1 1 3 1 Styling is transforming and formatting information Styling is the rendering of information into a form suitable for consumption by a target audience Because the audience can change for a given set of information we often need to apply different styling for that information in order to obtain dissimilar renderings in order to meet th
305. ocation through any template rules that are then found in the stylesheet The children of the cust elements are lt prodsale gt elements The stylesheet does provide a template rule in lines 15 through 20 to handle a prodsale element when it is pushed so the XSLT processor adds the markup triggered by that rule to the result The focus changes when the template rule handles it thus lines 16 18 and 20 each pull information relative to the lt prodsale gt element respectively the parent s num attribute the cust element s attribute the string value of the target element being pointed to by the lt prodsale gt element s idref attribute indirectly obtaining the product element s value and the value of the lt prodsale gt element itself http www xml com pub a 2000 08 holman s2_1 html page 2 6 di 7 10 05 2001 9 07 18 XML com Getting started with XSLT and XPath Aug 23 2000 Pages 1 2 3 Next Page gt THA TE www thawte com http www xml com pub a 2000 08 holman s2_1 html page 2 7 di 7 10 05 2001 9 07 18 O REILLY Xx a xml from the inside out XML COM O REILLY NETWORK XML com Getting started with XSLT and XPath Aug 23 2000 Pre conference worksho Conference 26th amp 27th July 25th July Holiday Inn London Victoria Register Now OREILLY COM ONJAVA COM ec oIwoLUIL RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Prot
306. ocess the same metadata and to use a single piece of software to process at least in part many different metadata vocabularies With any luck this should make the Web more like a library or a video store or a phone book than it is today http www xml com pub a 2001 01 24 rdf html page 3 2 di 4 10 05 2001 9 14 09 XML com What is RDF Jan 24 2001 Getting started with RDF Since RDF became a W3C Recommendation in February 1999 a number of tools have been created by developers working with RDF For an in depth treatment of these consult the W3C RDF home page A number of other listings are available including XML com XMLhack and Dave Beckett s RDF Resource Guide Developer Community The main email list for RDF developer discussion is W3C s RDF Interest Group A number of other RDF related discussion lists exist including the Mozilla RDF forum the Mozilla and Netscape 6 browsers make heavy use of RDF More recently the RDF Logic list has been announced providing a forum for the discussion of formal logic based approaches to knowledge representation for the Web DARPA s DAML DARPA Agent Markup Language initiative uses the RDF Logic list for discussions and announcements The RDF developer community is rather diverse which is reflected in the nature of online discussions on the RDF lists While one strand of RDF development is concerned with highly formal topics RDF Logic DAML and so on others
307. ocessed on the Web in the way that is now possible with HTML XML has been designed for ease of implementation and for interoperability with both SGML and HTML Status of this Document This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation It is a stable document and may be used as reference material or cited as a normative reference from another document W3C s role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment This enhances the functionality and interoperability of the Web This document specifies a syntax created by subsetting an existing widely used international text processing standard Standard Generalized Markup Language ISO 8879 1986 E as amended and corrected for use on the World Wide Web It is a product of the W3C XML Activity details of which can be found at http www w3 org XML The English version of this specification is the only normative version However for translations of this document see http www w3 org XML fttrans A list of current W3C Recommendations and other technical documents can be found at http www w3 org TR http www w3 org TR REC xml 1 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition This second edition is not a new version of XML first published 10 February 1998 it merely incorporates the changes dictated by th
308. ocessor has recognized the use of HTML by the name of the document element and has engaged SGML lexical conventions The SGML lexical conventions are evidenced on line 8 where the lt br gt empty element has been serialized without the XML lexical convention for the closing delimiter This corresponds to line 6 of our stylesheet in Example 2 2 where this element is marked up as lt br gt according to XML rules Our inputs are always XML but the XSLT processor may recognize the output as being HTML and serialize the result following SGML rules Consider next the following explicitly declared XSLT file he llo xs1 to produce XML output using the HTML vocabulary thus the output is serialized as XHTML http www xml com pub a 2000 08 holman s2 1 html page 1 3 di 6 10 05 2001 9 06 36 XML com Getting started with XSLT and XPath Aug 23 2000 lt P syescssome l 02 l Imellesjsel I xSI 1 0 nerto win CicemeSoircmelcineS Con crain ne gt lt xsl transform xmlns xsl http www w3 org 1999 XSL Transform version 1 0 gt xsl output method xml omit xml declarations yes p y lt xsl template match gt lt b gt lt i gt lt u gt lt xsl value of select greeting gt lt u gt lt i gt lt b gt lt xsl template gt lt f sis dl trans E Cue Example 2 4 An explicitly declared simple stylesheet This file explicitly declares the document element of an XSLT stylesheet with the requ
309. ocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Find it at ONJava com Getting started with XSLT and XPath by G Ken Holman Pages 1 2 3 Getting started with XSLT and XPath Ill 2 2 Syntax basics Stylesheets Templates Instructions Print This Article Next we ll look at some basic terminology both helpful in understanding the principles of writing an XSLT stylesheet and recognizing the constructs used therein This section is not meant as tutelage for writing stylesheets but only as background information nomenclature and practice guidelines Note I use two pairs of diametric terms not used as such in the XSLT Recommendation itself explicit implicit stylesheets and push pull design approaches Students of my instructor led courses have found these distinctions helpful even though they are not official terms Though these terms are documented here with apparent official status such status is not meant to be conferred 2 2 1 Explicitly declared stylesheets XML Products An explicitly declared XSLT stylesheet is comprised of a distinct wrapper element containing the stylesheet specification This wrapper element must be an XSLT instruction named either stylesheet or transform thus it must be qualified by the prefix associated with the XSLT namespace URI This wrapper element is the document element in a stand
310. of Contents the XLink specification Introduction g An Example XLink Basics XLink Reference The XLink Type Attribute XLink Types Use and Composition Simple Links o aferences Conclusion UU XLink works by proving you with global attributes you can use to mark your elements as linking elements In order to use linking elements the declaration of the XLink namespace is required my element xmlns xlink http www w3 org Using the global attributes provided by XLink one may specify whether a particular element is a linking element and many properties about it e g when to load the linked resources how to see them once they are loaded etc The global attributes provided by XLink are the following Type definition attribute type Locator attribute href Semantic attributes role arcrole title Behavior attributes show actuate Traversal attributes conferences oreill y com INNOVATE COLLABORATE DISCOVER label from to The next sections explain each of these attributes their possible values and the rules that govern their use The XLink type attribute The type attribute may have one of the following values simple a simple link extended an extended possibly multi resource link locator a pointer to an external resource resource an internal resource arc a traversal rule between resources title a descriptive title for another linking element By conventi
311. of parameter entities to contain an integral number of grammatical tokens in the DTD This behavior does not apply to parameter entity references within entity values these are described in 4 4 5 Included in Literal 4 5 Construction of Internal Entity Replacement Text In discussing the treatment of internal entities it is useful to distinguish two forms of the entity s value Definition The literal entity value is the quoted string actually present in the entity declaration corresponding to the non terminal Entity Value Definition The replacement text is the content of the entity after replacement of character references and parameter entity references The literal entity value as given in an internal entity declaration Entity Value may contain character parameter entity and general entity references Such references must be contained entirely within the literal entity value The actual replacement text that is included as described above must contain the replacement text of any parameter entities referred to and must contain the character referred to in place of any character references in the literal entity value however general entity references must be left as is unexpanded For example given the following declarations lt JBNELTY lt PUD amp fxc9 ditions Gallimard gt lt ENTITY rights All rights reserved gt LEE NODIS book La Peste Albert Camus CEAO 1947 pub amp rights gt then the repla
312. ognized in the usual way _ except that the replacement text of entities used to escape markup delimiters the entities amp 1t gt apos 1 quot is always treated as data The string AT amp amp T expands to AT amp T and the remaining ampersand is not recognized as an entity reference delimiter A character reference is included when the indicated character is processed in place of the reference itself 4 4 3 Included If Validating When an XML processor recognizes a reference to a parsed entity in order to validate the document the processor must include its replacement text If the entity is external and the processor is not attempting to validate the XML document the processor may but need not include the entity s replacement text If a non validating parser does not include the replacement text it must inform the application that it recognized but did not read the entity This rule is based on the recognition that the automatic inclusion provided by the SGML and XML entity mechanism primarily designed to support modularity in authoring is not necessarily appropriate for other http www xml com axml testaxml htm 22 di 34 10 05 2001 9 26 16 The Annotated XML Specification applications in particular document browsing H Browsers for example when encountering an external parsed entity reference might choose to provide a visual indication of the entity s presence and retrieve it for display only on demand
313. olman s1 html page 2 19 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 O REILLY Xx o xml from the inside out of Streaming Media XML COM O REILLY NETWORK OREILLY COM ONJAVA COM urn ec n LC RESOURCE What is XSLT I gt CENTERS by G Ken Holman Pages 1 2 3 amp Print This Article Business O REILLY Graphics The Context of XSL Transformations and the XML Path Language cont d OPEN Metadata Mobile 1 2 Transformation data flows SOURCE Programming MN CONVENTION os Here we look at the interactions between some of the Recommendations we focus on by examining how our information flows through processes engaging or supporting the technologies Schemas Style 1 2 1 Transformation from XML to XML Web As we will see when looking at the data model the normative behavior of XSLT is to transform an XML source into ESSENTIALS an abstract hierarchical result We can request that result to be serialized into an XML file thus we achieve XML results from XML sources Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Black Holes With conferences oreilly com INNOVATE With OpenGL COLLABORATE DISCOVER FIND gt http www xml com pub a 2000 08 holman s1 html page 3 1 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 Search Sponsored By Article Archive SOU
314. on stylesheets to the Web However these changes are always rigidly confined by what the browser vendors have implemented and by the fact that backward compatibility is paramount And for people who want to disseminate information widely features supported by only the latest releases of Netscape and Internet Explorer are not useful XML specifies neither semantics nor a tag set In fact XML is really a meta language for describing markup languages In other words XML provides a facility to define tags and the structural relationships between them Since there s no predefined tag set there can t be any preconceived semantics All of the semantics of an XML document will either be defined by the applications that process them or by stylesheets So XML Is Just Like SGML No Well yes sort of XML is defined as an application profile of SGML SGML is the Standard Generalized Markup Language defined by ISO 8879 SGML has been the standard vendor independent way to maintain repositories of structured documentation for more than a decade but it is not well suited to serving documents over the web for a number of technical reasons beyond the scope of this article Defining XML as an application profile of SGML means that any fully conformant SGML system will be able to read XML documents However using and understanding XML documents does not require a system that is capable of understanding the full generality of SGML XML is rou
315. on when an attribute includes the type attribute with a value V we will refer to it as a V type element no matter what its actual name is bookref is a locator typ lement gt lt bookref xlink type locator Two restrictions stem from the fact that an element belongs to a certain XLink type 1 Given an element of a particular type only elements of certain types are relevant as XLink subelements since A is a simple type element all the information it needs is on the href attribute It would make no sense to have a locator type subelement gt a xlink type simple href monet html no other xlink element would make sense here a 2 Given an element of a particular type only some XLink attributes apply 1 Since bookref is a locator type element it needs an href attribute to point to th xternal resource but it http www xml com pub a 2000 09 xlink index html page 3 1 di 5 10 05 2001 9 11 35 XML com What is XLink Sep 18 2000 SEYBOLD PUBLICATIONS THIS SITE IS ON THE z would make no sense for it to have a from attribute which is reserved for arcs lt bookref xlink type locator href ficciones xml gt The following two tables summarize the attribute and subelement restrictions of each type they are included here as a reference but each element will be properly explained later on In Table 1 R indicates required and O indicates optional
316. ons or full stops together known as name characters Names beginning with the string xm1 or any string which would match X x M m L 1l arereserved for standardization in this or future versions of this specification Note The colon character within XML names is reserved for experimentation with name spaces Its meaning is expected to be standardized at some future point at which point those documents using the colon for experimental purposes may need to be updated There is no guarantee that any name space mechanism adopted for XML will in fact use the colon as a name space delimiter In practice this means that authors should not use the colon in XML names except as part of name space experiments but that XML processors should accept the colon as a name character T An Nmtoken name token is any mixture of name characters Literal data is any quoted string not containing the quotation mark used as a delimiter for that string Literals are used for specifying the content of internal entities Ent ityValue the values of attributes Att Value and external identifiers SystemLiteral Note that a SystemLiteral can be parsed without scanning for markup http Awww xml com axml testaxml htm 5 di 34 10 05 2001 9 26 15 The Annotated XML Specification 2 4 Character Data and Markup Text consists of intermingled character data and markup Definition Markup takes the form T of start tags en
317. onsored By XML com What is XSLT I Aug 16 2000 vendors have imposed their GUIDES constraints on the way we can represent our information Our 1 2 4 Three tiered architectures XML Resources data has been created maintained stored and archived according to the Buyers Guide rules enforced by others The advent of the Extensible Markup Events Calendar Language XML moves the control of our information out of the hands Standards List of others and into our own by providing two basic facilities Submissions List XML describes rules for structuring our information using embedded markup of our own choice We can take control of our information representation by creating and using a vocabulary we design of elements and attributes that makes sense for the way we do our business and use our data TOOLBOX gt Syntax Checker XML Testbed In addition XML describes a language for formally declaring the vocabularies we use This allows our tools to constrain the creation of SEY BO LD an instance of our information and allows our users to validate a PUBLICATIONS properly created instance of information against our set of constraints THIS SITE IS ON THE Note 1 An XML document is just an instance of well formed XML The two terms document and instance could be used interchangeably but this reference material uses the term instance to help readers remember that XML isn t just for documents or documentation With XML we desc
318. ontent There are six kinds of markup that can occur in an XML document elements entity references comments processing instructions marked sections and document type declarations The following sections introduce each of these markup concepts Elements Elements are the most common form of markup Delimited by angle brackets most elements identify the nature of the content they surround Some elements may be empty as seen above in which case they have no content If an element is not empty it begins with a start tag element and ends with an end tag lt element gt Attributes Attributes are name value pairs that occur inside start tags after the element name For example div class preface gt is a div element with the attribute class having the value preface In XML all attribute values must be quoted Entity References In order to introduce markup into a document some characters have been reserved to identify the start of markup The left angle bracket for instance identifies the beginning of an element start or end tag In order to insert these characters into your document as content there must be an alternative way to represent them In XML entities are used to represent these special characters Entities are also used to refer to often repeated or varying text and to include the content of external files Every entity must have a unique name Defining your own entity names is discussed in th
319. oquial way of expressing this goal while the spec was being developed was that it ought to take about two weeks for a competent computer science graduate student to build a program that can process XML documents The number of optional features in XML is to be kept to an absolute minimum ideally zero Optional features inevitably raise compatibility problems when users want to share documents and sometimes lead to confusion and frustration XML documents should be human legible and reasonably clear If you don t have an XML browser and you ve received a hunk of XML from somewhere you ought to be able to look at it in your favorite text editor and actually figure out what the content means The XML design should be prepared quickly Standards efforts are notoriously slow XML was needed immediately and was developed as quickly as possible The design of XML shall be formal and concise In many ways a corollary to rule 4 it essentially means that XML must be expressed in EBNF and must be amenable to modern compiler tools and techniques There are a number of technical reasons why the SGML grammar cannot be expressed in EBNF Writing a proper http www xml com pub a 98 10 guide1 html 4 di 6 10 05 2001 9 27 57 XML com What is XML Oct 03 1998 SGML parser requires handling a variety of rarely used and difficult to parse language features XML does not 9 XML documents shall be easy to create A
320. oriented For example emphasized text is often confused with a particular format in which it is rendered Where we could model information using a b element type for eventual rendering in a bold face we would be better off modeling the information using an emph element type In this way we capture the reason for marking up information that it is emphasized from surrounding information and we do not lock the downstream targets into only using a bold face for rendering 1 2 4 Three tiered architectures Many times the midstream or downstream processes need only rearrange re label or synthesize the information for a target purpose and never apply any semantics of style for rendering purposes Transformation tasks stand alone in such cases meeting the processing needs without introducing rendering issues One caveat regarding modeling content oriented information is that there are applications where the content orientation is indeed presentation oriented Consider book publishing where the abstract content is based on presentational semantics This is meaningful because there is no abstraction beyond the appearance or presentation of the content Consider the customer information in Example 1 1 A web user agent doesn t know how to render an element named customer The HTML vocabulary used to render the customer information could be as follows Ol pe Erom lt i gt Customer Reference b custi23 b e r Do lt gt
321. ork delivery applications Validity Constraint Standalone Document Declaration The standalone document declaration must have the value no if T any external markup declarations contain declarations of e attributes with default values if elements to which these attributes apply appear in the document without specifications of values for these attributes or e entities other than amp 1t gt apos quot if references to those entities appear in the document or e attributes with values subject to normalization where the attribute appears in the document with a value which will change as a result of normalization or e element types with element content if white space occurs directly within any instance of those types An example XML declaration with a standalone document declaration http www xml com axml testaxml htm 9 di 34 10 05 2001 9 26 16 The Annotated XML Specification 2 10 White Space Handling In editing XML documents it is often convenient to use white space spaces tabs and blank lines denoted by the nonterminal S in this specification to set apart the markup for greater readability Such white space is typically not intended for inclusion in the delivered version of the document T On the other hand significant white space that should be preserved in the delivered version is common for example in poetry and source code An XML processor must always pass all characters in a document that are not
322. ormation links KARS ONTARIO CANADA KOA 2E0 s T 1 613 489 0999 Voice e Click here for on line pricing and purchasing information 4 613 489 0995 E including individual site wide staff all staff members in a given location licenses or world wide staff all staff members world wide licenses all with perpetual free updates 2 Staff Licenses 1 Purchasable Materials e Note that we will also directly accept faxed in purchase orders 3 On line CBT on company letterhead and mailed in cheques for the amounts Ay Cited Losses Dr salus described in the above link S Details follow below We would appreciate any feedback you have or suggestions for changes and improvements please forward your comments to training 9 CraneSoftwrights com Training Programmes and Training Materials When face to face training is not an option for you see http www CraneSoftwrights com schedule htm for details we hope you will find these training programmes and materials of use This page also describes the general information regarding our free downloads of overview and helpful reference material the policy of free access to revisions of printed materials for registered purchasers and a description of the staff licenses available in addition to individual purchases http www cranesoftwrights com training 1 di 5 10 05 2001 9 01 00 Crane Softwrights Ltd Train
323. ot among the characters given string matches a literal string matching that given inside the double quotes string matches a literal string matching that given inside the single quotes These symbols may be combined to match more complex patterns as follows where A and B represent simple expressions expression expression is treated as a unit and may be combined as described in this list A matches A or nothing optional A AB matches A followed by B A B matches A or B but not both A B matches any string that matches A but does not match B At matches one or more occurrences of A http www xml com axml testaxml htm 25 di 34 10 05 2001 9 26 16 The Annotated XML Specification A matches zero or more occurrences of A Other notations used in the productions are was comment wfc well formedness constraint this identifies by name a constraint on well formed documents associated with a production ve validity constraint this identifies by name a constraint on valid documents associated with a production Appendices A References A 1 Normative References IANA Internet Assigned Numbers Authority Official Names for Character Sets ed Keld Simonsen et al See ftp ftp isi edu in notes iana assignments character sets IETF RFC 1766 IETF Internet Engineering Task Force RFC 1766 Tags for the Identification of Languages ed H Alvestrand 1995 ISO 639 Intern
324. other information needed to allow the application to call a processor for data in the notation described It is not an error however for XML documents to declare and refer to notations for which notation specific applications are not available on the system where the XML processor or application is running 4 8 Document Entity Definition The document entity serves as the root of the entity tree and a starting point for an XML processor This specification does not specify how the document entity is to be located by an XML processor unlike other entities the document entity has no name and might well appear on a processor input stream without any identification at all http www w3 org TR REC xml 30 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition 5 Conformance 5 1 Validating and Non Validating Processors Conforming XML processors fall into two classes validating and non validating Validating and non validating processors alike must report violations of this specification s well formedness constraints in the content of the document entity and any other parsed entities that they read Definition Validating processors must at user option report violations of the constraints expressed by the declarations in the DTD and failures to fulfill the validity constraints given in this specification To accomplish this validating XML processors must read and process the entire DTD and all
325. ounded number of any elements from the http www w3 org 1999 xhtml namespace The processContents attribute is set to skip telling a W3C XML Schema processor that no validation of these elements should be attempted The other permissible values for this attribute are strict asking to validate these elements or ax asking the processor to validate them when possible The namespace attribute accepts a whitespace separated list of URIs as well as the special values any any namespace local non qualified elements targetNamespace the target namespace or other any namespace other than the http www xml com pub a 2000 1 1 29 schemas part1 html page 8 2 di 3 10 05 2001 9 19 51 XML com Using W3C XML Schema Nov 29 2000 target Pages 1 2 3 4 5 6 7 8 9 Next Page gt RDF Applications with Prolog http www xml com pub a 2000 1 1 29 schemas part1 html page 8 3 di 3 10 05 2001 9 19 51 XML com Using W3C XML Schema Nov 29 2000 TREX O REILLY o xml from the inside out ONJAVA COM RESOURCE gt CENTERS Business XML COM O REILLY NETWORK Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF CSS Style Find it in the JavaScript CSS DevCenter FIND gt Search Article Archive FAQs Add the latest news
326. owing us to look things up based on the words in the text It s not surprising that people complain about search results or that the robots are always way behind the growth and change of the Web In fact there is one metadata based general purpose lookup facility Yahoo Yahoo doesn t use a robot When you search through Yahoo you re searching through human generated subject categories and site labels Compared to the amount of metadata that a library maintains for its books Yahoo is pitiful but its popularity is clear evidence of the power of even limited metadata Pages 1 2 3 Two powerful platforms One easy choice FHE BOOK OF BUSINESS Click to explore the AIX advantage http www xml com pub a 2001 01 24 rdf html 3 di 3 10 05 2001 9 13 27 XML com What is RDF Jan 24 2001 O REILLY July 23 27 xX O REILLY OPEN SOURC San Diego o CONVENTION conferences o xml from the inside out O REILLY NETWORK OREILLY COM ONJAVA COM E U RESOURCE What is RDF P CENTERS byTim Bray Pages 1 2 3 E Print mia Artide Business Graphics Divine Metadata for the Web Metadata Mobile People who have thought about these problems including many Table ot Contents Prasat librarians and webmasters generally agree that the Web urgently B P i needs metadata What would it look like If the Web had an The Right Way to Find ae all powerful Gran
327. own are going to serve as links by means of the XLink attribute type An example snippet will make this clearer environment xlink type extended gt This is an extended link The resources involved must be included referenced her gt lt environment gt Now that we have our extended link we must specify the resources involved Since the artist and movement information are stored outside our own document so we have no control over them we use XLink s locator elements to reference them Again the strategy is not to impose a tag name but to let you mark your elements as locators using XLink attributes environment xmlns xlink http www w3 org 1999 xlink xlink type extended gt http www xml com pub a 2000 09 xlink index html page 2 1 di 2 10 05 2001 9 11 08 XML Products Tools Training O REILLY XxX e 5 XML com What is XLink Sep 18 2000 lt A The resources involved in our link are the artist gt SEYBOLD himself his influences and the historical references PUBLICATIONS lt artist xlink type locator xlink label artist xlink href modigliani xml gt THIS SITE IS ON THE lt influence xlink type locator xlink label inspiration xlink href cezanne xml gt lt influence xlink type locator xlink label inspiration xlink href lautrec xml influence xlink type locator xlink label inspiration xlink href rouault xml
328. p www xml com pub a 2000 1 1 29 schemas part1 html 3 di 3 10 05 2001 9 17 07 XML com Using W3C XML Schema Nov 29 2000 XB Opening the Windows e ws to your Portal Solutions xml from da inside out O REILLY NETWORK OREILLY COM ONJAVA COM E se21ch RESOURCE Using W3C XML Schema CENTERS by Eric van der Vlist Pages 1 2 3 4 5 6 7 8 9 EE Print This Artide usiness US Metadata While the previous design method is Introducing Our First Mobile very simple it can lead to significant Schema SOURCE Programming depth in the embedded definitions Slicing the Schema CONVENTION Protocols making it hardly readable and difficult Defining Named Types to maintain when documents are Schemas Groups Compositors and Sive complex It also has the drawback of Denada ayie being very different from a DTD Web structure an obstacle for human or MOGBIEBL Types machine agents wishing to transform Constraints ESSENTIALS DTDs into XML Schemas or even Building Usable and Annotated XML just use the same design guides for Reusable Schemas What is XML both technologies Namespaces What is XSLT The second design is based on a flat W3C XML Schema and What is XLink catalog of all the elements available in Instance Documents What is XML Schema the sample document and for each of W3C XML Schema What is RDF them lists of child elements and Datatyp
329. ple 1 7 would be lt xsl template match customer gt lt p lt xel2texlerrom lt xsl text gt i xsl text Customer Reference lt xsl text gt lt b gt lt xsl value of select db gt lt b gt lt i gt lt p gt lt xsl template gt An example of XSL vocabulary supplied to the XSLT processor to produce the markup in Example 1 8 would be 01 lt xsl template match customer gt 02 lt ko plo eCki space be fore e piam not Ef one s Ae Torte 03 lt xelstexrsFrom e xslstext 04 fo inline sequence font style italic 05 lt xsl text gt Customer Reference lt xslstext gt 06 fo inline sequence font weight bold 07 lt xsl value of select db gt 08 lt FO inline sequence gt lt ro inline sequence lt fos block gt 09 lt xsl template gt http www xml com pub a 2000 08 holman s1 html page 2 6 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 Example 1 10 Example XSLT template rule for the XSL vocabulary Where XSLT is similar to other transmutation approaches is that we deal with our information as trees of abstract nodes We don t deal with the raw syntax of our source data Unlike these other approaches however the primary memory management and information manipulation node traversal and node creation is handled by the XSLT processor not by the stylesheet writer This is a significant difference between XSLT and a transformation prog
330. positors can have minOccurs and maxOccurs attributes to define their cardinality The xsd choice compositor describes a choice between several possible elements or groups of elements The following group compositors can appear within groups complex types or other compositors will accept either a single name element or a sequence of firstName an optional middleName and a lastName lt xsd group name nameTypes gt lt xsd choice gt lt xsd element name name type xsd string gt xsd sequence lt xsd element name firstName type xsd string gt lt xsd element name middleName type xsd string minOccurs 0 gt lt xsd element name lastName type xsd string gt xsd sequence xsd choice xsd group The xsd all particle defines an unordered set of elements The following complex type definition allows its contained elements to appear in any order xsd complexType name bookType gt lt xsd all gt lt xsd element name title type xsd string gt lt xsd element name author type xsd string gt lt xsd element name character type characterType minOccurs 0 maxOccurs unbounded xsd all http www xml com pub a 2000 1 1 29 schemas part1 html page 4 1 di 2 10 05 2001 9 18 43 XML Products Tools Training O REILLY x e XML com Using W3C XML Schema Nov 29 2000 THIS SITE IS ON THE xsd attribute name isbn type isbnType use required xs
331. presentation semantics Adobe Acrobat purc pdf t File Edit Document Tools Plug ns View Windov m From Customer Reference cust123 Figure 1 2 XSL rendering for example The above again illustrates the two distinctive styling steps transforming the instance of the XML vocabulary into a new instance according to a vocabulary of rendering semantics and formatting the instance of the rendering vocabulary in the user agent The rendering semantics of much of the XSL vocabulary are device independent so we can use one set of constructs regardless of the rendering medium It is the rendering agent s responsibility to interpret these constructs accordingly In this way the XSL semantics can be interpreted for print display aural or other presentations There are indeed some specialized semantics we can use to influence rendering on particular media though these are just icing on the cake 1 1 5 Extensible Stylesheet Language Transformations XSLT We all have needs to transform our structured information when it is not appropriately ordered for a purpose other than how it is created The XSLT 1 0 Recommendation describes a transformation instruction vocabulary of constructs that can be expressed in an XML model of elements and attributes e http www w3 org TR xslt 1 1 5 1 Transformation by example http www xml com pub a 2000 08 holman s1 html page 2 5 di 19 10 05 2001 9 03 31 XML com What i
332. provide role information in an attribute called role e A title for the resource to serve as a displayable caption that explains to users the part the resource plays in the link A link author can optionally provide title information in an attribute called title XLink does not require that application software make any particular use of title information e Behavior policies to use in traversing to this resource A link author can optionally use attributes called show and actuate to communicate general policies concerning the traversal behavior of the link The show attribute can have one of the values new replace and embed the actuate attribute can have one of the values auto and user A link author can also optionally use an attribute called behavior to communicate detailed instructions for traversal behavior The contents format and meaning of this attribute are unconstrained See 6 Link Behavior for more information on the behavior related attributes Following are sample declarations of these attributes enclosed in a remote resource semantics att parameter entity http www w3 org TR 1998 WD xlink 19980303 8 di 16 10 05 2001 9 30 10 XML Linking Language XLink ENTITY remote resource semantics att role CDATA IMPLIED title CDATA IMPLIED TMP CTED IMPLIED actuate autol user behavior CDATA show embed replace new IMPLIED 4 1 4 Local Resource Semantics The following semantic informa
333. pub a 2000 09 xlink index html page 3 5 di 5 10 05 2001 9 11 35 XML com What is XLink Sep 18 2000 lt The Who What How and Why of P2P O REILLY xX o xml from the inside out ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Find it on O Reilly Network FIND gt Search Article Archive FAQs Add the latest news from XML com to your web site P gt COLUMNS XML Deviant XML COM O REILLY NETWORK The O Reill coming soon OREILLY COM What is XLink by Fabio Arciniegas A September 18 2000 Only connect That was the whole of the Table of Contents sermon Introduction E M An Example XLink Forster 1879 1970 XLink Reference he XLink Type Attribute XLink Types Use and Composition Simple Links eTools and References Conclusion The very nature of the success of the Web lies in its capability for linking resources However the unidirectional simple linking structures of the Web today are not enough for the growing needs of an XML world The official W3C solution for linking in XML is called XLink XML Linking Language This article explains its structure and use according to the most recent Candidate Recommendation July
334. quence of this for each non root element C in the document there is one other element P in the document such that C is in the content of P but is not in the content of any other element that is in the content of P P is referred to as the parent of C and C as a child of P 2 2 Characters Definition A parsed entity contains text a sequence of characters which may represent markup or character data Definition A character is an atomic unit of text as specified by ISO IEC 10646 ISO IEC 10646 see also ISO IEC 10646 2000 Legal characters are tab carriage return line feed and the legal characters of Unicode and ISO IEC 10646 The versions of these standards cited in A 1 Normative References were current at the time this document was prepared New characters may be added to these standards by amendments or new editions Consequently XML processors must accept any character in the range specified for Char The use of compatibility characters as defined in section 6 8 of Unicode see also D21 in section 3 6 of Unicode3 is discouraged Character Range 2 Char x9 xA xD 4x20 4xD7FF any Unicode character xEOO00 xFFFD 4x10000 4x10FFFF excluding the surrogate blocks FFFE and FFFF The mechanism for encoding character code points into bit patterns may vary from entity to entity All XML processors must accept the UTF 8 and UTF 16 encodings of 10646 the mechanisms for signaling which of the t
335. r declarations for such documents the rule that an entity must be declared is a well formedness constraint only if standalone yes Validity Constraint Entity Declared In a document T with an external subset or external parameter entities with standalone no the Name given in the entity reference must match that in an entity declaration For interoperability valid documents should declare the entities amp 1t gt apos quot in the form specified in 4 6 Predefined Entities The declaration of a parameter entity must precede any reference to it Similarly the declaration of a general entity must precede any reference to it which appears in a default value in an attribute list declaration Well Formedness Constraint Parsed Entity An entity reference must not contain the name of an unparsed entity T Unparsed entities may be referred to only in attribute values declared to be of type ENTITY or ENTITIES Well Formedness Constraint No Recursion A parsed entity must not contain a recursive reference to itself either directly or indirectly T Well Formedness Constraint In DTD Parameter entity references may only appear in the DTD TD Examples of character and entity references Example of a parameter entity reference 4 2 Entity Declarations Definition Entities are declared thus Entity Declaration 70 EntityDecl 71 GEDecl GEDecl PEDecl lt ENTITY Ui S Name S EntityDef Sg
336. racters and _ are allowed as name start characters e Characters and are allowed as name characters C XML and SGML Non Normative XML is designed to be a subset of SGML in that every XML document should also be a conforming SGML document For a detailed comparison of the additional restrictions that XML places on documents beyond those of SGML see Clark D Expansion of Entity and Character References Non Normative This appendix contains some examples illustrating the sequence of entity and character reference recognition and expansion as specified in 4 4 XML Processor Treatment of Entities and References If the DTD contains the declaration then the XML processor will recognize the character references when it parses the entity declaration and resolve them before storing the following string as the value of the entity example A reference in the document to amp example will cause the text to be reparsed at which time the start and end tags of the p element will be recognized and the three references will be recognized and expanded resulting in a p element with the following content all data no delimiters or markup http Awww w3 org TR REC xml 37 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition A more complex example will illustrate the rules and their effects fully In the following example the line numbers are solely for reference This produces th
337. racters of ASCII have their normal positions width and values the actual encoding declaration must be read to detect which of these applies but since all of these encodings use the same bit patterns for the ASCII characters the encoding declaration itself may be read reliably e 4C 6F A7 94 EBCDIC in some flavor the full encoding declaration must be read to tell which code page is in use e other UTF 8 without an encoding declaration or else the data stream is corrupt fragmentary or enclosed in a wrapper of some kind This level of autodetection is enough to read the XML encoding declaration and parse the character encoding identifier which is still necessary to distinguish the individual members of each family of encodings e g to tell UTF 8 from 8859 and the parts of 8859 from each other or to distinguish the specific EBCDIC code page in use and so on Because the contents of the encoding declaration are restricted to ASCII characters a processor can reliably read the entire encoding declaration as soon as it has detected which family of encodings is in use Since in practice all widely used character encodings fall into one of the categories above the XML encoding declaration allows reasonably reliable in band labeling of character encodings even when external sources of information at the operating system or transport protocol level are unreliable Once the processor has detected the character encoding in use it ca
338. ramming language or interface like the Document Object Model DOM where the programmer is responsible for handling the low level manipulation of information constructs XSLT includes constructs which we use to identify and iterate over structures found in the source information The information being transformed can be traversed in any order needed and as many times as required to produce the desired result We can visit source information numerous times if the result of transformation requires that information to be present numerous times We users of XSLT don t have the burden of implementing numerous practical algorithms required to present information The designers of XSLT have specified that such algorithms be implemented within the processor itself and have enabled us to engage these algorithms declaratively High level functions such as sorting and counting are available to us on demand when we need them Low level functions such as memory management node manipulation and garbage collection are all integral to the XSLT processor This declarative nature of the stylesheet markup makes XSLT so very much more accessible to non programmers than the imperative nature of procedurally oriented transformation languages Writing a stylesheet is as simple as using markup to declare the behavior of the XSLT processor much like HTML is used to declare the behavior of the web browser to paint information on the screen The designers have also accommoda
339. rary to find books on raising donkeys as pets In S most libraries these days you d use the computer lookup system basically an electronic version of the old card file Add the latest news This system allows you to list books by author title subject from XML com to fi and so on The list includes the date author title and lots of your web site other useful information including most important of all Click here where each book is gt COLUMNS XML Deviant Scenario 2 The Video Store http www xml com pub a 2001 01 24 rdf html page 1 1 di 3 10 05 2001 9 14 28 XML com What is RDF Jan 24 2001 Style Matters XML Q amp A Transforming XML Perl and XML gt GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIONS THIS SITE IS ON THE You re in a video store and you want a movie by John Huston A large modern video store offers a lookup facility that s similar to the library s Of course the search properties are different director actors and so on but the results are more or less the same Scenario 3 The Phone Book You re working late at a customer s office in South Denver and it seems that a pizza is essential if work is to continue Fortunately every office comes equipped with a set of Yellow Pages that when properly used can lead to quick pizza delivery The Common
340. ration 46 contentspec EMPTY ANY Mixed children where the Name gives the element type being declared Validity constraint Unique Element Type Declaration http Awww w3 org TR REC xml 15 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition No element type may be declared more than once Examples of element type declarations 3 2 1 Element Content Definition An element type has element content when elements of that type must contain only child elements no character data optionally separated by white space characters matching the nonterminal S Definition In this case the constraint includes a content model a simple grammar governing the allowed types of the child elements and the order in which they are allowed to appear The grammar is built on content particles cps which consist of names choice lists of content particles or sequence lists of content particles Element content Models 47 children lt choice seq Fe 48 cp z Name choice seq 1 2 49 choice sco CIS 42 em 4 Se I o amp o 04 37 73 JP E VC Proper Group PE Nesting 50 seq im CO 87 xm E TS Be mg BO t VC Proper Group PE Nesting where each Name is the type of an element which may appear as a child Any content particle in a choice list may appear in the element content at the location where the choice list appears in
341. rch Article Archive FAQs Add the latest news from XML com to your web site Click here D COLUMNS XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES gt RDF Applications with Prolog OREILLY COM NENNEN 7 What Do XML Documents E Prine This Artic Look Like mE by Norman Walsh October 03 1998 If you are conversant with HTML or SGML XML documents will look familiar A simple XML document is presented in Example 1 Example 1 A Simple XML Document lt xml version 1 0 lt oldjoke gt lt burns gt Say lt quote gt goodnight lt quote gt Gracie lt burns gt lt allen gt lt quote gt Goodnight Gracie lt quote gt lt allen gt lt applause gt lt oldjoke gt A few things may stand out to you e The document begins with a processing instruction lt xml gt This is the XML declaration Section 2 8 While it is not required its presence explicitly identifies the document as an XML document and indicates the version of XML to which it was authored e There s no document type declaration Unlike SGML XML does not require a document type declaration However a document type declaration can be supplied and some documents will require one in order to be understood unambiguously e Empty elements lt applause gt in this example have a modified syntax Section 3 1 While most elements in a document are wrappers around some content
342. read reliably 4C 6F A7 94 EBCDIC in some flavor the full encoding declaration must be read to tell which code page is in use UTF 8 without an encoding declaration or else the data stream is mislabeled lacking a required Other encoding declaration corrupt fragmentary or enclosed in a wrapper of some kind Note In cases above which do not require reading the encoding declaration to determine the encoding section 4 3 3 still requires that the encoding declaration if present be read and that the encoding name be checked to match the actual encoding of the entity Also it is possible that new character encodings will be invented that will make it necessary to use the encoding declaration to determine the encoding in cases where this is not required at present http www w3 org TR REC xml 39 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition This level of autodetection is enough to read the XML encoding declaration and parse the character encoding identifier which is still necessary to distinguish the individual members of each family of encodings e g to tell UTF 8 from 8859 and the parts of 8859 from each other or to distinguish the specific EBCDIC code page in use and so On Because the contents of the encoding declaration are restricted to characters from the ASCII repertoire however encoded a processor can reliably read the entire encoding declaration as soon as it has detected
343. recognize the output as being HTML and serialize the result following SGML rules Consider next the following explicitly declared XSLT file he llo xs1 to produce XML output using the HTML vocabulary thus the output is serialized as XHTML http www xml com pub a 2000 08 holman s2_1 html 3 di 6 10 05 2001 9 06 12 XML com Getting started with XSLT and XPath Aug 23 2000 lt P syescssome l 02 l Imellesjsel I xSI 1 0 nerto win CicemeSoircmelcineS Con crain ne gt lt xsl transform xmlns xsl http www w3 org 1999 XSL Transform version 1 0 gt lt xsl output method xml omit xml declaration yes gt lt xsl template match gt lt b gt lt i gt lt u gt lt xsl value of select greeting gt lt u gt lt i gt lt b gt lt xsl template gt lt f sis dl trans E Cue Example 2 4 An explicitly declared simple stylesheet This file explicitly declares the document element of an XSLT stylesheet with the requisite XSLT namespace and version declarations Line 7 declares the output to follow XML lexical conventions and that the XML declaration is to be omitted from the serialized result Lines 9 through 11 declare the content of the result that is added when the source information position matches the XPath expression in the mat ch attribute on line 9 The value of matches the root of the document hence this refers to the XSLT processor s initial focus The result w
344. redefine restriction schema union e union ref Derivation of datatypes by union union id ID memberTypes List of QName any attributes with non schema namespace gt Content annotation simpleType union Can be included in simpleType e unique ref Definition of a uniqueness constraint unique id ID name NCName any attributes with non schema namespace gt Content annotation selector field unique Can be included in element Portions of this document are Copyright 1999 2000 W3C9 MIT INRIA Keio THA TE www thawte com http www xml com pub a 2000 1 1 29 schemas structuresref html 7 di 7 10 05 2001 9 21 46 XML com The Annotated XML Specification Apr 15 1998 Pre conference workshops 25th July O REILLY e xml from the inside out XML COM O REILLY NETWORK ONJAVA COM Conference 26th amp 27th July Holiday Inn London Victoria OREILLY COM es RESOURCE P CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Apache 2 0 Basics Ryan Bloom Find it at ONLamp com FIND Search Article Archive FAQs The Print This Articl Annotated XML Specification by C M Sperberg McQueen Jean Paoli Tim Bray April 15 1998
345. res and phone companies In fact most such products define their own system of metadata and their own facilities for storing and managing it They typically do not offer facilities for sharing or interchanging it This doesn t cause too much of a problem assuming they do a decent job with the user interface We are comfortable enough with the general process we call looking things up really searching via metadata that we are able to adapt and use all these different systems http www xml com pub a 2001 01 24 rdf html page 1 2 di 3 10 05 2001 9 14 28 XML com What is RDF Jan 24 2001 Not Just For Searching The most common daily use of metadata is to aid our discovery of things But there are lots of other uses going on behind the scenes The library and video store are storing other metadata that you don t see how often the books and videos are being used how much it cost to buy them where to go for a replacement etc Running a library or a video store would be unthinkable without metadata Similarly the phone company of course uses its metadata most obviously to print the Yellow Pages but for many other internal management and administration tasks What About the Web The Web is a lot like a really really big library There are millions of things out there and if you know the URL in effect a kind of call number you can get them Since the Web has books movies and pizza joints the number of ways you might
346. ressions in XSLT the linking group uses XPath as the core of expressions in the XPointer Recommendation In order to address components you have to know the addressing scheme with which the components are arranged The basis of addressing XML documents is an abstract data model of interlinked nodes arranged hierarchically echoing the tree shape of the nested elements in an instance Nodes of different types make up this hierarchy each node representing the parsed result of a syntactic structure found in the bytes of the XML instance This abstraction insulates addressing from the multiple syntactic forms of given XML constructs allowing us to focus on the information itself and not the syntax used to represent the information Note 2 We see XML documents as a stream or string of bytes that follow the rules of the XML 1 0 Recommendation Stylesheets do not regard instances in this fashion and we have to change the way we think of our XML documents in order to successfully work with our information This leap of understanding ranks high on the list of key aspects of stylesheet writing I needed to internalize before successfully using this technology We are given tools to work in the framework provided by the abstraction a set of data types used to represent values found in the generalization and a set of functions we use to manipulate and examine those values The data types include strings numbers boolean values and sets of nod
347. rg TR REC xml 20 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition Following are examples of attribute normalization Given the following declarations the attribute specifications in the left column below would be normalized to the character sequences of the middle column if the attribute a is declared NMTOKENS and to those of the right columns if a is declared CDATA Attribute Attrbutespecification ais aisNMTOKENS ais aisCDATA ey rm x20 x y Zz 4x20 4x20 A 4x20 4x20 B x20 x20 xD xD A xA xA B xD xD xD A xA xA xA B xD xD Note that the last example is invalid but well formed if a is declared to be of type NMTOKENS 3 4 Conditional Sections Definition Conditional sections are portions of the document type declaration external subset which are included in or excluded from the logical structure of the DTD based on the keyword which governs them Conditional Section 61 conditionalSect includeSect ignoreSect 62 includeSect uso C S INCLUDE S TJ extSubsetDecl gt VC Proper Conditional Section PE Nesting 63 ignoreSect w lt S IGNORE S ike d ignoreSectContents VC Proper Conditional Section PE Nesting 64 ignoreSectContents Ignore ignoreSectContents Ignore 65 Ignore ss Char Char gt Char Validity constraint P
348. rge numbers The Web is already big and getting bigger and we are probably going to have literally billions of these floating around millions even for a big Intranet Scalability is important Properties are Resources Properties can have their own properties and can be found and manipulated like any other Resource This is important because there are going to be lots of them too many to look at one by one For example I might want to know if anyone out there has defined a Property that describes the genre of a movie with values like Comedy Horror Romance and Thriller I ll need metadata to help with that Values Can Be Resources For example most web pages will have a property named Home Page which points at the home page of their site So the values of properties which obviously have to include things like title and author s name also have to include Resources Statements Can Be Resources Statements can also have properties Since there s no GOD to provide useful assertions for all the resources and since the Web is way too big for us to provide our own we re going to need to do lookups based on other people s metadata as we do today with Yahoo This means that we ll want given any Statement such as The Subject of this Page is Donkeys to be able to ask Who said so And When One useful way to do this would be with metadata so Statements will need to have Properties Why Not Just Use XML XML allows you to inven
349. ribe a related set of information in a tree like hierarchical fashion and gain the benefits of having done so whether the information captures an invoice related transaction between computers or the content of a user manual rendered on paper Sponsored By XML Path Language XPath XPath is a string syntax for building addresses to the information found in an XML document We use this language to specify the locations of document structures or data found in an XML document when processing that information using XSLT XPath allows us from any location to address any other location or content Extensible Stylesheet Language Family XSLT XSL Two vocabularies specified in separate W3C Recommendations provide for the two distinct styling processes of transforming and rendering XML instances We can transform information using one vocabulary into an alternate form by using the Extensible Stylesheet Language Transformations XSLT The Extensible Stylesheet Language XSL is a rendering vocabulary describing the semantics of formatting information for different media Namespaces We use XML namespaces to distinguish information when mixing multiple vocabularies in a single instance Without namespaces our processes would find the information ambiguous when identical names have been chosen by the designers of the vocabularies we use Stylesheet Association We declare our choice of an associated stylesheet for an XML instance
350. ribute specifications of the element Definition with the Name in each pair referred to as the attribute name and Definition the content of the AttValue the text between the or delimiters as the attribute value Note that the order of attribute specifications in a start tag or empty element tag is not significant Well formedness constraint Unique Att Spec No attribute name may appear more than once in the same start tag or empty element tag Validity constraint Attribute Value Type The attribute must have been declared the value must be of the type declared for it For attribute types see 3 3 Attribute List Declarations Well formedness constraint No External Entity References Attribute values cannot contain direct or indirect entity references to external entities Well formedness constraint No in Attribute Values The replacement text of any entity referred to directly or indirectly in an attribute value must not contain a An example of a start tag lt termdef id dt dog term dog gt Definition The end of every element that begins with a start tag must be marked by an end tag containing a name that echoes the element s type as given in the start tag http www w3 org TR REC xml 14 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition End tag 42 ETag Name S gt An example of an end tag temic uSSJVJ Definition The text between the start tag and end
351. rigger described by an XPath expression Lines 6 through 10 describe the template rule for processing the root of the document as indicated by the trigger in the mat ch attribute on line 6 The result document element and boilerplate is added to the result tree on lines 7 and 8 Line 9 instructs the XSLT processor in xxs1 apply templates to visit all record element children of the sales document element as specified in the select attribute For each location visited the processor pushes that location through the stylesheet thus triggering the template of result markup it can match for each location Lines 12 and 13 describe the result markup when matching a record element The focus moves to the record element being visited The template rule on line 13 adds the markup for the HTML unordered list ul element to the result tree The content of the list is created by instructing the processor to visit all children of the focus location implicitly by not specifying any select attribute and apply the templates of result markup it triggers for each child The only children of record are cust elements The stylesheet does not provide any template rule for the cust element so built in template rules automatically process the children of each location being visited in turn Implicitly then our source information is being traversed in the depth first order visiting the locations in parse order and pushing each l
352. rm them all that is needed to use XSLT for this is a preprocess to convert existing Standard Generalized Markup Language SGML markup conventions into XML markup conventions XHTML can be created from HTML using a handy free tool on the W3C site http www w3 org People Raggett tidy This tool corrects whatever improperly coded HTML it can and flags any that it cannot correct When the output is configured to follow XML lexical conventions the resulting file can be used as an input to the XSLT processor 1 1 5 5 Validation unnecessary but convenient That an XSLT processor need not incorporate a validating XML processor to do its job does not minimize the importance of source validation when developing a stylesheet Often when working incrementally to develop a stylesheet by simultaneously working on the test source file and stylesheet algorithm time can be lost by inadvertently introducing well formed but invalid source content Because there is no validation in the XSLT processor all well formed source will be processed without errors producing a result based on the data found The first reaction of the stylesheet writer is often that a problem has been introduced in the stylesheet logic when in fact the stylesheet works fine for the intended source data The real problem is that the source data being used isn t as intended Note 6 Personally I run a separate post process source file validation after running the source file through
353. rmation For better performance reasons a processor may choose to not consider a top level instruction until there is need within the stylesheet to use it All other instructions are found somewhere in a result tree template and are not executed until that point at which the processor is asked to add the instruction to the result tree Instructions themselves are never added to the result tree Some XSLT instructions are control constructs used by the processor to manage our stylesheets The wrapper and top level elements declare our globally scoped constructs Procedural and process control constructs give us the ability to selectively add only portions of templates to the result rather than always adding an entire template Logically oriented constructs give us facilities to share the use of values and declarations within our own stylesheet files Physically oriented constructs give us the power to share entire stylesheet fragments Other XSLT instructions are result tree value placeholders We declare how a value is calculated by the processor or obtained from a source tree or both calculated by the processor from a value from a source tree The value calculation is triggered when the XSLT processor is about to add the instruction to the result tree The outcome of the calculation which may be nothing is added to the result tree All other instructions engage customized non standard behaviors and are specified using extension elements in a standar
354. rms match only if they have the same representation in both strings At user option processors may normalize such characters to some canonical form T No case folding is performed T Of strings and rules in the grammar A string matches a grammatical production if it belongs to the language generated by that production U Of content and content models An element matches its declaration when it conforms in the fashion described in the constraint Element Valid for compatibility Definition A feature of XML included solely to ensure that XML remains compatible with SGML H for interoperability Definition A non binding recommendation included to increase the chances that XML documents can be processed by the existing installed base of SGML processors which predate the WebSGML Adaptations Annex to ISO 8879 T 2 Documents Definition A data object is an XML document if it is well formed as defined in this specification A well formed XML document may in addition be valid if it meets certain further constraints T Each XML document has both a logical and a physical structure Physically the document is composed of units called entities An entity may refer to other entities to cause their inclusion in the document A document begins in a root or document entity Logically the document is composed of declarations elements comments character references and processing instructions all of which are indicated in the document
355. rocessor This script is useful for diagnosing problems by revealing the result of transformation This script has also been used extensively by some to create static HTML snapshots of their XML for delivery to non XML aware browsers Pages 1 2 3 Next Page gt THA TE www thawte com http www xml com pub a 2000 08 holman s2_1 html page 1 6 di 6 10 05 2001 9 06 37 XML com Getting started with XSLT and XPath Aug 23 2000 O REILLY x Xx M Sas 9e CONFERENCE amp E SITION 200 21 25 May 2001 Berlin Germany www xmleurope com XML COM O REILLY NETWORK OREILLY COM ONJAVA COM o a xml from the inside out RESOURCE Getting started with XSLT and XPath CENTERS by G Ken Holman Pages 1 2 3 amp Print This Article Business O REILLY Graphics 2 1 2 Some more complex examples OPEN Metadata Mobile Lhe following more complex examples are meant merely as illustrations of some of the powerful facilities and SOURCE techniques available in XSLT These samples expose concepts such as variables functions and process control CONVENTION Programming constructs a stylesheet writer uses to effect the desired result but does not attempt any tutelage in their use Protocols Schemas Note This subsection can be skipped entirely or for quick exposure to some of the facilities available in XSLT Style and XPath only briefly reviewed In the associated narratives I ve avoided the prec
356. rocessor can validate that the information content conforms not only to the lexical rules for XML well formedness but http www xml com pub a 2000 08 holman s1 html page 1 4 di 8 10 05 2001 9 02 26 XML com What is XSLT I Aug 16 2000 also the syntax rules dictated by the supplied document model validity Looking at the same customer element as before now on line 12 the document model indicates on line 6 that the db attribute is indeed required if the attribute is absent the XML processor can report syntactic model constraint violation even if the element is otherwise lexically well formed The document model can also provide additional information not evident without a document model such as the information on line 4 that the id attribute for purchase is of XML type ID 1 1 1 2 No built in meanings or concepts The area of semantics associated with XML instances is very gray A document model is but one component used to help describe the semantics of the information found in an instance While well formed instances do not have a formal document model often the names of the constructs used within the instances give hints to the associated semantics Without a formalism yet available in our community to express semantics in a rigorous fashion we users of XML do or should capture the semantics of a given vocabulary in prose whether or not the document model is formalized The XML 1 0 Recommendation only
357. roper Conditional Section PE Nesting If any of the lt or gt of a conditional section is contained in the replacement text for a parameter entity reference all of them must be contained in the same replacement text Like the internal and external DTD subsets a conditional section may contain one or more complete declarations comments processing instructions or nested conditional sections intermingled with white space http Awww w3 org TR REC xml 21 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition If the keyword of the conditional section is INCLUDE then the contents of the conditional section are part of the DTD If the keyword of the conditional section is IGNORE then the contents of the conditional section are not logically part of the DTD If a conditional section with a keyword of INCLUDE occurs within a larger conditional section with a keyword of IGNORE both the outer and the inner conditional sections are ignored The contents of an ignored conditional section are parsed by ignoring all characters after the following the keyword except conditional section starts lt and ends gt until the matching conditional section end is found Parameter entity references are not recognized in this process If the keyword of the conditional section is a parameter entity reference the parameter entity must be replaced by its content before the processor decides whether to in
358. rposes This means though that it is possible to successfully process a http www xml com pub a 2000 08 holman s1 html page 2 9 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 source file with a stylesheet designed for an entirely different vocabulary The results will probably be totally inappropriate but there is nothing inherent to an instance that ties it to a single stylesheet or a set of stylesheets Stylesheet designers might well consider how their stylesheets could validate input perhaps issuing error messages when unexpected content arrives However this is a matter of practice and not a constraint 1 1 5 4 XML source and stylesheet The input files to an XSLT processor are one or more stylesheet files and one or more source files The initial inputs are a single stylesheet file and a single source file Other stylesheet files are assimilated before the first source file is processed The XML processor will then access other source files according to the first files XML content The XSLT processor may then access other source files at any time under stylesheet control All of the inputs must be well formed but not necessarily valid XML documents This precludes using an HTML file following non XML lexical conventions but does not rule out processing an Extensible Hypertext Markup Language XHTML file as an input Many users of existing HTML files that are not XML compliant will need to manipulate or transfo
359. rrences of the character element as the author wishes Both attributes have a default value of one We then specify the list of all its children in the same way lt xsd element name name type xsd string gt lt xsd element name friend of type xsd string minOccurs 0 maxOccurs unbounded gt lt xsd element name since type xsd date gt lt xsd element name qualification type xsd string gt And we terminate its description by closing the complexType and element elements lt xsd sequence gt lt xsd complexType gt lt xsd element gt The sequence of elements for the document element book is now complete lt xsd sequence gt We can now declare the attributes of the document elements which must always come last There appears to be no special reason for this but the W3C XML Schema Working Group thought it simpler to impose a relative order to the definitions of the list of elements and attributes within a complex type and that it was more natural to define the attributes after the elements lt xsd attribute name isbn type xsd string gt And close all the remaining elements lt xsd complexType gt lt xsd element gt lt xsd schema gt That s it This first design sometimes known as Russian Doll Design tightly follows the structure of our example document One of the key features is to define each element and attribute within its context and to allow multiple occurrences of
360. rs and lt definition of an element groufpDernvation Content Types xsd group name mainBookElements Constraints xsd sequence xsd element name title type amsih saple and lt xsd element name author typer ysa xsd sequence Namespaces xsd group W3C XML Schema and Instance Documents lt definition of an attribute grpWy3C XML Schema Datatypes Reference xsd attributeGroup name bookAttibpus esr Schenia xsd attribute name isbn CYPE gua Rete cequs ed gt xsd attribute name available pee esa sey ng gt lt xsd attributeGroup gt These groups can be used in the definition of complex types as shown below lt xsd complexType name bookType gt lt xsd sequence gt lt xsd group ref mainBookElements gt lt xsd element name character type characterType minOccurs 0 maxOccurs unbounded xsd sequence xsd attributeGroup ref bookAttributes gt lt xsd complexType 2 gt lt xsd complexType gt These groups are not datatypes but are containers holding a set of elements or attributes that can be used to describe complex types Compositors So far we have seen the xsd sequence compositor which defines ordered groups of elements in fact it defines ordered groups of particles which can also be groups or other compositors W3C XML Schema supports two additional compositors that can be mixed to allow various combinations Each of these com
361. rt of a Universal Resource Identifier URI Multiple steps in a location path are separated by either one or two oblique characters Filters can be specified to further refine the nature of the components of our information being addressed 01 select question 3 answer 1 Example 1 5 A multiple step XPath expression in a select attribute The above example selects only the first answer child of the third question child of the focus element 01 select id start question answer y Example 1 6 A more complex XPath expression in a select attribute The above example uses an XPath address identifying some descendants of the element in the instance that has the unique identifier with the value start Those identified are the question elements whose answer attribute is equal to the string equal to the lower case letter y The value returned is the set of nodes representing the elements meeting the conditions expressed by the address The address is used in a select attribute thus the XSLT processor is selecting all of the addressed elements for some kind of processing 1 1 2 3 XPath is not a query language It is important to remember that addressing information is only one aspect of querying information Other aspects include query operators that massage intermediate results into a final result While a few operators and functions are available in XSLT to use values identified in documents these are oriented t
362. rt1 html 1 di 3 10 05 2001 9 17 07 ue d OY cee conferences oreilly com INNOVATE COLLABORATE DISCOVER XML com Using W3C XML Schema Nov 29 2000 TOOLBOX gt Syntax Checker XML Testbed SEYBOLD PUBLICATIONS THIS SITE IS ON THE z xsd sequence The sequence element is a compositor that defines an ordered sequence of sub elements We will see the two other compositors choice and all in the following sections Now we can define the title and author elements as simple types they don t have attributes or non text children and can be described directly within a degenerate element element The type xsd string is prefixed by the namespace prefix associated with XML Schema indicating a predefined XML Schema datatype lt xsd element name title type xsd string gt lt xsd element name author type xsd string gt Now we must deal with the character element a complex type Note how its cardinality is defined lt xsd element name character minOccurs 0 maxOccurs unbounded gt xsd complexType xsd sequence Unlike other schema definition languages W3C XML Schema lets us define the cardinality of an element i e the number of possible occurrences with some precision We can specify both minOccurs the minimum number of occurrences and maxOccurs the maximum number of occurrences Here maxOccurs is set to unbounded which means that there can be as many occu
363. rties might be expressed by attributes on the link the link s element type name or in some other way and are not considered full fledged resources of the link Most out of line links are extended links as these have a far wider range of uses 4 3 Extended Links An extended link differs from a simple link in that it can connect any number of resources not just one local resource optionally and one remote resource and in that extended links are more often out of line than simple links The additional capabilities of extended links are required for e Enabling outgoing links in documents that cannot be modified to add an inline link e Creating links to and from resources in formats with no native support for embedded links such as most multimedia formats e Applying and filtering sets of relevant links on demand e Enabling other advanced hypermedia capabilities http www w3 org TR 1998 WD xlink 19980303 10 di 16 10 05 2001 9 30 10 XML Linking Language XLink Application software might provide traversal among all of a link s participating resources subject to semantic constraints outside the scope of this specification and might signal the fact that a given resource or sub resource participates in one or more links when it is displayed even though there is no markup at exactly that point to signal it A linking element for an extended link contains a series of child elements that serve as locators Because an extended link
364. ry XML Development Goals The XML specification sets out the following goals for XML Section 1 1 In this article citations of the form Section 1 1 these are references to the W3C Recommendation Extensible Markup Language XML 1 0 If you are interested in more technical detail about a particular topic please consult the specification 1 It shall be straightforward to use XML over the Internet Users must be able to view XML documents as quickly and easily as HTML documents In practice this will only be possible when XML browsers are as robust and widely available as HTML browsers but the principle remains 2 XML shall support a wide variety of applications XML should be beneficial to a wide variety of diverse applications http www xml com pub a 98 10 guide1 html 3 di 6 10 05 2001 9 27 57 XML com What is XML Oct 03 1998 authoring browsing content analysis etc Although the initial focus is on serving structured documents over the web it is not meant to narrowly define XML XML shall be compatible with SGML Most of the people involved in the XML effort come from organizations that have a large in some cases staggering amount of material in SGML XML was designed pragmatically to be compatible with existing standards while solving the relatively new problem of sending richly structured documents over the web It shall be easy to write programs that process XML documents The coll
365. ry appropriate to push where the order is dictated by the source information and to pull when responding to a push where the order is known by the stylesheet The most common use of this combination in a template is localized pull access to values that are relative to the focus being matched by nodes being pushed Note that push oriented stylesheets more easily accommodate changes to the data and are more easily exploited by others who wish to reuse the stylesheets we write The more granularity we have in our template rules the more flexibly our stylesheets can respond to changes in the order of data The more we pull data from our source tree the more dependent we are on how we have coded the access to the information The more we push data through our stylesheet the less that changes in our data impact our stylesheet code Look again at the examples discussed earlier in this article and analyze the use of the above pull and push constructs to meet the objectives of the transformations These introductions and samples in this article have set the context and only scratch the surface of the power of XSLT to effect the transformations we need when working with our structured information XML com has continuing coverage and tutorials about XPath and XSLT in its regular column Transforming XML This is a prose version of an excerpt from the book Practical Transformation Using XSLT and XPath Eighth Edition ISBN 1 894049 05 5 at the time of thi
366. s Joel Nava H Adobe Conleth O Connell j H 1 Vignette Peter Sharpe H j SoftQuad John Tigue H DataChannel http www xml com axml testaxml htm 34 di 34 10 05 2001 9 26 16 XML com A Technical Introduction to XML Oct 03 1998 O REILLY e xml from the inside out XML COM O REILLY NETWORK ONJAVA COM LINUX OREILLY COM j Find it on amp 9 O Reilly Network E Er RESOURCE P CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Find it at ONJava com FIND Search Article Archive FAQs A Technical Introduction to XML by Norman Walsh October 03 1998 Print This Article This introduction to XML presents the Extensible Markup Language at a reasonably technical level for anyone interested in learning more about structured documents In addition to covering the XML 1 0 Specification this article outlines related XML specifications which are evolving The article is organized in four main sections plus an appendix Start Here Author s Note It is somewhat remarkable to s think that this article which ES rntrodu t ppneared initially in the Winter 1997 edition of the World Wide What is Web Journal was out of date by the time the final XML Recommendation was approved in February And even as this up
367. s thus giving an application developer standardized interfaces to the transformed information expressed http www xml com pub a 2000 08 holman s1 html page s3 8 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 using the application s custom semantics vocabulary The developer s programming is then complete and the vendor accommodates each customer vocabulary with an appropriate stylesheet for translation to the application semantics 1 2 4 Three tiered architectures A three tiered architecture can meet technical and business objectives by delivering structured information to web browsers by using XSLT on the host or on the user agent or even on both Considering technical issues first the server can distribute the processing load to XML XSLT aware user agents by delivering a combination of the stylesheet and the source information to be transformed on the recipient s platform Alternatively the server can perform the transformations centrally to accommodate those user agents supporting only HTML or HTML CSS vocabularies transformation script Web Host PN NENNEN document XML Browser HTML Browser K XSLT Process transformation script Figure 1 9 Server side Transformation Architecture There may be good business reasons to selectively deliver richly marked up XML to the user agent or to arbitrarily transform XML to HTML on the server regardless of the user agent capabilities Even if it is tec
368. s Article W hataseXSLT Getting started with XSLT and XPath by G Ken Holman August 23 2000 Getting started with XSLT and XPath Examining working stylesheets can help us understand how we use Table of Contents XSLT and XPath to perform transformations This article first dissects some example stylesheets before introducing basic terminology and 2 Getting started with XSLT and design principles XPath e2 1 Stylesheet examples 2 1 1 Some simple examples 2 1 2 Some more complex examples 2 2 Syntax basics stylesheets templates instructions 2 2 1 Explicitly declared stylesheets 2 2 2 Implicitly declared stylesheets XML Products 2 1 Stylesheet examples Let s first look at some example stylesheets using two implementations of XSLT 1 0 and XPath 1 0 the XT processor from James Clark and the third web release of Internet Explorer 5 s MSXML Technology Preview Tools Training These two processors were chosen merely as examples of respectively standalone and browser based XSLT XPath implementations without prejudice to other conforming implementations The code samples only use syntax conforming to XSLT 1 0 and XPath 1 0 recommendations O REILLY xn http Awww xml com pub a 2000 08 holman s2_1 html 1 di 6 10 05 2001 9 06 12 FIND gt Search Article Archive FAQs Add the latest news from XML com to I your web site Click here D COLUMNS
369. s XSLT I Aug 16 2000 We can characterize XSLT from other techniques for transmuting our information by regarding it simply as Transformation by Example differentiating many other techniques as Transformation by Program Logic This perspective focuses on the distinction that our obligation is not to tell an XSLT processor how to effect the changes we need rather we tell an XSLT processor what we want as an end result and it is the processor s responsibility to do the dirty work The XSLT Recommendation gives us a vocabulary for specifying templates that function as examples of the result Based on how we instruct the XSLT processor to access the source of the data being transformed the processor will incrementally build the result by adding the filled in templates We write our stylesheets or transformation specifications primarily with declarative constructs though we can employ procedural techniques if and when needed We assert the desired behavior of the XSLT processor based on conditions found in our source We supply examples of how each component of our result is formulated and indicate the conditions of the source that trigger which component is next added to our result Alternatively we can selectively add components to the result on demand Consider once again the customer information in our example purchase order at Example 1 1 An example of the HTML vocabulary supplied to the XSLT processor to produce the markup in Exam
370. s are not expanded Parameter entities are not recognized in the body of a document Looking back at the element declarations in Example 2 you ll notice that two of them have the same content model lt ELEMENT burns PCDATA quote lt ELEMENT allen PCDATA quote gt At the moment these two elements are the same only because they happen to have the same literal definition In order to make more explicit the fact that these two elements are semantically the same use a parameter entity to define their content model The advantage of using a parameter entity is two fold First it allows you to give a descriptive name to the content and second it allows you to change the content model in only a single place if you wish to update the element declarations assuring that they always stay the same lt ENTITY personcontent PCDATA quote gt http www xml com pub a 98 10 guide2 html 7 di 10 10 05 2001 9 28 30 XML com What Do XML Documents Look Like Oct 03 1998 lt ELEMENT burns personcontent gt lt ELEMENT allen personcontent gt Notation Declarations Notation declarations Section 4 7 identify specific types of external binary data This information is passed to the processing application which may make whatever use of it it wishes A typical notation declaration is lt NOTATION GIF87A SYSTEM GIF gt Do I need a Document Type Declaration As we ve seen XML
371. s by the scope of values encompassing the scopes of other values Though trees shape a number of areas of XML both logically markup and physically entities such as files or other resources they are not the only means by which relationships are specified For example a quantum of information can arbitrarily point or refer to other information elsewhere through use of unique identifiers Two basic objectives of representing information hierarchically are satisfied by the XML Recommendation It provides e an unambiguous mechanism for constraining structure in a stream of information XML defines the concept of well formedness Well formedness dictates the syntax used for markup languages within the content of an instance of information This is the syntax of using angle brackets lt and and the ampersand amp to demarcate and identify constituent components of information within a file a resource or a bound data stream Users of the Hypertext Markup Language HTML will recognize the use of these characters for marking the vocabulary described by the designers of the World Wide Web in their web documents e alanguage for specifying how a system can constrain the allowed logical hierarchy of information structures XML defines the concept of validity with a syntax for a meta markup language used to specify vocabularies A Document Type Definition DTD describes the structural schema mandating the user defined constraints
372. s composed of units called entities An entity may refer to other entities to cause their inclusion in the document A document begins in a root or document entity Logically the document is composed of declarations elements comments character references and processing instructions all of which are indicated in the document by explicit markup The logical and physical structures must nest properly as described in 4 3 2 Well Formed Parsed Entities 2 1 Well Formed XML Documents Definition A textual object is a well formed XML document if 1 Taken as a whole it matches the production labeled document 2 It meets all the well formedness constraints given in this specification 3 Each of the parsed entities which is referenced directly or indirectly within the document is well formed Document 1 document prolog element Misc Matching the document production implies that 1 It contains one or more elements http www w3 org TR REC xml 5 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition 2 Definition There is exactly one element called the root or document element no part of which appears in the content of any other element For all other elements if the start tag is in the content of another element the end tag is in the content of the same element More simply stated the elements delimited by start and end tags nest properly within each other Definition As a conse
373. s containing encoding declarations 4 4 XML Processor Treatment of Entities and References The table below summarizes the contexts in which character references entity references and invocations of unparsed entities might appear and the required behavior of an XML processor in each case The labels in the leftmost column describe the recognition context Reference in Content as a reference anywhere after the start tag and before the end tag of an element corresponds to the nonterminal content Reference in Attribute Value as a reference within either the value of an attribute in a start tag or a default value in an attribute declaration corresponds to the nonterminal AttValue Occurs as Attribute Value as a Name not a reference appearing either as the value of an attribute which has been declared as type ENTITY or as one of the space separated tokens in the value of an attribute which has been declared as type ENTITIES Reference in Entity Value as a reference within a parameter or internal entity s literal entity value in the entity s declaration corresponds to the nonterminal Entity Value Reference in DTD as a reference within either the internal or external subsets of the DTD but outside of an Entity Value AttValue PI Comment SystemLiteral PubidLiteral or the contents of an ignored conditional section see 3 4 Conditional Sections Entity Type Charact External Parsed cone Parameter Internal General General
374. s reserved to indicate character data The moniker PCDATA stands for parseable character data Elements that contain only other elements are said to have element content Section 3 2 1 Elements that contain both other elements and PCDATA are said to have mixed content Section 3 2 2 For example the definition for burns might be lt ELEMENT burns PCDATA quote gt The vertical bar indicates an or relationship the asterisk indicates that the content is optional may occur zero or more times therefore by this definition burns may contain zero or more characters and quote tags mixed in any order All mixed content models must have this form PCDATA must come first all of the elements must be separated by vertical bars and the entire group must be optional Two other content models are possible EMPTY indicates that the element has no content and consequently no end tag and ANY indicates that any content is allowed The ANY content model is sometimes useful during document conversion but should be avoided at almost any cost in a production environment because it disables all content checking in that element Here is a complete set of element declarations for Example 1 Example 2 Element Declarations for Old Jokes lt ELEMENT oldjoke burns allen applause gt lt ELEMENT burns PCDATA quote gt lt ELEMENT allen PCDATA quote gt lt ELEMENT quote PCDATA gt lt ELEMENT applause EMPTY
375. s subject to normalization where the attribute appears in the document with a value which will change as a result of normalization or e element types with element content if white space occurs directly within any instance of those types An example XML declaration with a standalone document declaration 2 10 White Space Handling In editing XML documents it is often convenient to use white space spaces tabs and blank lines to set apart the markup for greater readability Such white space is typically not intended for inclusion in the delivered version of the document On the other hand significant white space that should be preserved in the delivered version is common for example in poetry and source code An XML processor must always pass all characters in a document that are not markup through to the application A validating XML processor must also inform the application which of these characters constitute white space appearing in element content A special attribute named xml space may be attached to an element to signal an intention that in that element white space should be preserved by applications In valid documents this attribute like any other must be declared if it is used When declared it must be given as an enumerated type whose values are one or both of default and preserve For example The value default signals that applications default white space processing modes are acceptable for th
376. s that could easily be used together in an XML instance the Scalable Vector Graphics SVG vocabulary and the Mathematical Markup Language MathML In SVG the lt set gt element type is used to scope a value for reference by descendent elements In MathML the lt set gt element type defines a set in the mathematical sense of a collection Remembering that names in XML follow rigid lexical constraints we pick out of thin air a prefix we use to distinguish each element type from their respective vocabulary The prefix we choose is not mandated by any organization or any authority in our instances we get to choose any prefix we wish We should however make the prefix meaningful or we will obfuscate our information so let s choose in this example http Awww xml com pub a 2000 08 holman s1 html page 2 14 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 to distinguish the two element types as lt svg set gt and math set Note that making the prefix short is a common convention supporting human legibility and using the colon separating the prefix from the rest of the name is prescribed by the Namespaces in XML recommendation While we are talking about names let s not forget that some Recommendations utilize the XML name lexical construct for other purposes such as naming facilities that may be available to a processor We get to use this namespace prefix we ve chosen on these names to guarantee uniqueness
377. s writing published by Crane Softwrights Ltd written by G Ken Holman this excerpt was edited by Stan Swaren and reviewed by Dave Pawson THA TE www thawte com http www xml com pub a 2000 08 holman s2_1 html page 3 8 di 8 10 05 2001 9 08 04 XML com What is XLink Sep 18 2000 O REILLY xXx o a xml from the inside out ONJAVA COM RESOURCE gt CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web gt ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema O REILLY NETWORK What is RDF Apache 2 0 Basics Ryan Bloom al 1 Find it at ONLamp com FIND Search Article Archive FAQs Add the latest news from XML com to your web site l gt COLUMNS XML Deviant Pre conference workshops 25th July Conference 26th amp 27th July Holiday Inn London Victoria OREILLY COM What is XLink by Fabio Arciniegas A September 18 2000 Only connect That was the whole of the Table of Contents sermon Introduction E M An Example XLink Forster 1879 1970 XLink Reference he XLink Type Attribute XLink Types Use and Composition Simple Links eTools and References Conclusion The very nature of the success of the Web lies in its capability for linking resources However the unidirectional simple
378. sections begin with the string lt CDATA and end with the string T CDATA Sections 18 CDSect CDStart CData CDEnd Hoke ta ntik t Eas v 20 CData i Char Char UT 59V qelsueus 21 Clomid 8 ge 2 Within a CDATA section only the CDEnd string is recognized as markup so that left angle brackets and ampersands may occur in their literal form they need not and cannot be escaped using amp 1t and amp amp CDATA sections cannot nest An example of a CDATA section in which lt greeting gt and lt greeting gt are recognized as character data not markup 2 8 Prolog and Document Type Declaration Definition XML documents may and should H 1 begin with an XML declaration which specifies the version of XML being used T For example the following is a complete XML document well formed but not valid T and so is this Ee eee M The version number 1 0 should be used to indicate conformance to this version of this specification it is an error for a document to use the value 1 0 if it does not conform to this version of this specification It is the intent of the XML working group to give later versions of this specification numbers other than 1 0 but this intent does not indicate a commitment J to produce any future versions of XML nor if any are produced to use any particular numbering scheme Since future versions are not ruled out this construct is provided as a
379. shed semantics Nothing is imposed by any process when creating a new XML vocabulary that happens to use the same names Applications using XML processors to access XML information must be instructed how to interpret and implement the desired semantics 1 1 2 XML Path Language XPath Assuming that we have structured our information using XML how are we going to talk about address what is inside our documents Locating http www xml com pub a 2000 08 holman s1 html 5 di 8 10 05 2001 9 01 41 XML com What is XSLT I Aug 16 2000 information in an XML document is critical to both transforming it and to associating or relating it to other information When we write stylesheets and use linking languages we can address components of our information for a processor by our use of the XML Path Language also called XPath e http www w3 org TR xpath 1 1 2 1 Addressing structured information The W3C working group responsible for stylesheets collaborated with the W3C working group responsible for the next generation of hyperlinking to produce XPath as a common base for addressing requirements shared by their respective Recommendations Both groups extend the core XPath facilities to meet the needs they have in each of their domains the stylesheet group uses XPath as the core of expressions in XSLT the linking group uses XPath as the core of expressions in the XPointer Recommendation In order to address components you have
380. sor which defines the t ext xm1 and application xml MIME types and provides some useful guidance In the interests of interoperability however the following rule is recommended e If an XML entity is in a file the Byte Order Mark and encoding declaration are used if present to determine the character encoding G W3C XML Working Group Non Normative This specification was prepared and approved for publication by the W3C XML Working Group WG WG approval of this specification does not necessarily imply that all WG members voted for its approval The current and former members of the XML WG are e Jon Bosak Sun Chair James Clark Technical Lead Tim Bray Textuality and Netscape XML Co editor Jean Paoli Microsoft XML Co editor C M Sperberg McQueen U of Ill XML Co editor Dan Connolly W3C W3C Liaison Paula Angerstein Texcel Steve DeRose INSO Dave Hollander HP Eliot Kimber ISOGEN Eve Maler ArborText Tom Magliery NCSA Murray Maloney SoftQuad Grif SA Muzmo and Veo Systems MURATA Makoto FAMILY Given Fuji Xerox Information Systems Joel Nava Adobe Conleth O Connell Vignette Peter Sharpe SoftQuad http www w3 org TR REC xml 40 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition e John Tigue DataChannel H W3C XML Core Group Non Normative The second edition of this specification was prepared by the W3C XML Core Working Group WG The members of t
381. specific linked data to be treated in an application appropriate manner such as indication by highlighting scrolling etc traversal The action of using a link that is of accessing a resource Traversal may be initiated by a user action for example clicking on the displayed content of a linking element or occur under program control 1 4 Notation The formal grammar for locators is given using a simple Extended Backus Naur Form EBNF location as described in the XML specification 2 Locator Syntax The locator for a resource is typically provided by means of a Uniform Resource Identifier or URI XPointers can be used in conjunction with the URI structure as fragment identifiers or queries to specify a more precise sub resource XPointers can be used in conjunction with URIs to specify a more precise sub resource A locator generally contains a URI as described in IETF RFCs IETF RFC 1738 and IETF RFC 1808 As these RFCs state the URI may include a trailing query marked by a leading and be followed by a and a fragment identifier with the query interpreted by the host providing the indicated resource and the interpretation of the fragment identifier dependent on the data type of the indicated resource In order to locate XML documents and portions of documents a locator value may contain either a URI or a fragment identifier or both Any fragment identifier for pointing into XML must be an XPointer Special syn
382. ssor Treatment of Entities and References 4 4 1 Not Recognized http www w3 org TR REC xml 2 di 41 10 05 2001 9 29 12 Extensible Markup Language XML 1 0 Second Edition 4 4 2 Included 4 4 3 Included If Validating 4 4 4 Forbidden 4 4 5 Included in Literal 4 4 6 Notify 4 4 7 Bypassed 4 4 8 Included as PE 4 5 Construction of Internal Entity Replacement Text 4 6 Predefined Entities 4 7 Notation Declarations 4 8 Document Entity 5 Conformance 5 1 Validating and Non Validating Processors 5 2 Using XML Processors 6 Notation Appendices A References A 1 Normative References A 2 Other References B Character Classes C XML and SGML Non Normative D Expansion of Entity and Character References Non Normative E Deterministic Content Models Non Normative F Autodetection of Character Encodings Non Normative F 1 Detection Without External Encoding Information F 2 Priorities in the Presence of External Encoding Information G W3C XML Working Group Non Normative H W3C XML Core Group Non Normative I Production Notes Non Normative 1 Introduction Extensible Markup Language abbreviated XML describes a class of data objects called XML documents and partially describes the behavior of computer programs which process them XML is an application profile or restricted form of SGML the Standard Generalized Markup Language ISO 8879 By construction XML
383. st declaration is provided for a given element type or more than one attribute definition is provided for a given attribute but this is not an error 3 3 1 Attribute Types XML attribute types are of three kinds a string type a set of tokenized types and enumerated types The string type may take any literal string as a value the tokenized types have varying lexical and semantic constraints The validity constraints noted in the grammar are applied after the attribute value has been normalized as described in 3 3 Attribute List Declarations Attribute Types 54 AttType m StringType TokenizedType EnumeratedType 55 StringType CDATA 56 TokenizedType ID VC ID VC One ID per Element Type VC ID Attribute Default IDREF VC IDREF IDREFS VC IDREF ENTITY VC Entity Name ENTITIES VC Entity Name NMTOKEN VC Name Token NMTOKENS VC Name Token Validity constraint ID Values of type ID must match the Name production A name must not appear more than once in an XML document as a value of this type i e ID values must uniquely identify the elements which bear them Validity constraint One ID per Element Type No element type may have more than one ID attribute specified Validity constraint ID Attribute Default An ID attribute must have a declared default of ZIMPLIED or REQUIRED Validity constraint IDREF Values of type IDREF must match the Name productio
384. stered copy of the materials you are entitled to request copies of updates to the material at no extra cost after every time they are revised thus your reference is always the latest version published by Crane The publishing plan for each publication is noted below in each description Important Note Your purchase of the materials is for your own use only The password access to the materials entitles you to download the PDF file for you to print or use without sharing with others Please have others obtain their own copy of these publications for their use Thank you Purchasers have ten different publishing formats to choose from e A4 full page single sided a4 pdf bound A4 full page double sided a4 dbl pdf long edge duplex bound A4 full page 2 up per page a4 2up pdf optional long or short edge duplex A4 half page single sided a4 bind pdf cut stacked bound A4 half page double sided a4 bind dbl pdf short edge duplex cut stacked bound US letter full page single sided us pdf bound US letter full page double sided us dbl pdf long edge duplex bound US letter full page 2 up per page us 2up pdf optional long or short edge duplex US letter half page single sided us bind pdf cut stacked bound US letter half page double sided us bind dbl pdf short edge duplex cut stacked bound Notes e bound versions have their
385. t a datatype to a finite set of values enumeration id ID value string fixed boolean false any attributes with non schema namespace gt Content annotation lt enumeration gt Can be included in restriction e extension ref Extension of a datatype lt extension base QName id ID any attributes with non schema namespace gt restriction Content annotation attribute attributeGroup anyAttribute lt extension gt Can be included in complexContent simpleContent e field ref Definition of the field to be used for a uniqueness constraint lt field id ID xpath An XPath expression http www xml com pub a 2000 1 1 29 schemas structuresref html 3 di 7 10 05 2001 9 21 46 XML com W3C XML Schema Structures Reference Nov 29 2000 lt field gt any attributes with non schema namespace gt Content annotation Can be included in key keyref unique e group ref Definition of or reference to a group of elements group group id ID maxOccurs nonNegativeInteger unbounded 2 1 minOccurs nonNegativeInteger 1 name NCName ref QName any attributes with non schema namespace gt Content annotation all choice sequence Can be included in choice complexType redefine schema sequence e import ref Import of a import import W3C XML Schema for another namespace
386. t is enlarged by the attachment of one leading and one following space x20 character the intent is to constrain the replacement text of parameter entities to contain an integral number of grammatical tokens in the DTD U 4 5 Construction of Internal Entity Replacement Text In discussing the treatment of internal entities it is useful to distinguish two forms of the entity s value Definition The literal entity value is the quoted string actually present in the entity declaration corresponding to the non terminal Ent ityValue Definition The replacement text is the content of the entity after replacement of character references and parameter entity references The literal entity value as given in an internal entity declaration Ent ityValue may contain character parameter entity and general entity references Such references must be contained entirely within the literal entity value The actual replacement text that is included as described above must contain the replacement text of any parameter entities referred to and must contain the character referred to in place of any character references in the literal entity value however general entity references must be left as is unexpanded For example given the following declarations then the replacement text for the entity book is The general entity reference amp rights would be expanded should the reference amp book appear in the document s content or an
387. t s a Document The number of applications currently being developed that are based on or make use of XML documents is truly amazing particularly when you consider that XML is not yet a year old For our purposes the word document refers not only to traditional documents like this one but also to the miriad of other XML data formats These include vector graphics e commerce transactions mathematical equations object meta data server APIs and a thousand other kinds of structured information So XML is Just Like HTML No In HTML both the tag semantics and the tag set are fixed An lt h1 gt is always a first http www xml com pub a 98 10 guide1 html 1 di 6 10 05 2001 9 27 57 XML Products Tools Training Sponsored By XML com What is XML Oct 03 1998 Add the latest mews from XML com to your web site Click here COLUMNS gt XML Deviant Style Matters XML Q amp A Transforming XML Perl and XML GUIDES XML Resources Buyer s Guide Events Calendar Standards List Submissions List TOOLBOX Syntax Checker XML Testbed SEYBOLD FUBLICATIONS THIS SITE IS ON THE level heading and the tag ati product code is meaningless The W3C in conjunction with browser vendors and the WWW community is constantly working to extend the definition of HTML to allow new tags to keep pace with changing technology and to bring variations in presentati
388. t tags which may contain both text data and other tags XML has a built in distinction between element types for example the IMG element type in HTML and elements for example an individual lt img src Madonna jpg gt this corresponds naturally to the distinction between Properties and Statements So it seems as though XML documents should be a natural vehicle for exchanging general purpose metadata XML however falls apart on the Scalability design goal There are two problems 1 The order in which elements appear in an XML document is significant and often very meaningful This seems highly unnatural in the metadata world Who cares whether a movie s Director or Title is listed first as long as both are available for lookups Furthermore maintaining the correct order of millions of data items is expensive and difficult in practice 2 XML allows constructions like lt Description gt The value of this property contains some text mixed up with child properties such as its temperature lt Temp gt 48 lt Temp gt and longitude lt Longt gt 101 lt Longt gt amp Disclaimer lt Description gt When you represent general XML documents in computer memory you get weird data structures that mix trees graphs and character strings In general these are hard to handle in even moderate amounts let alone by the billion On the other hand something like XML is an absolutely necessary part of the solution to RDF s Interchange desig
389. t the year value used in this URI value is not used as a version indictor rather the W3C convention for assigning namespace URI values incorporates the year the value was assigned to the working group An XSLT processor responsible for interpreting an XSLT stylesheet recognizes instructions and named system properties using the http www w3 org 1999 XSL Trans form namespace An XSLT processor will not recognize using an archaic value for working draft specifications of XSLT XSLT use namespace qualified names to identify extensions that implement non standardized facilities A number of kinds of extensions can be defined in XSLT including functions instructions serialization methods sort methods and system properties http www xml com pub a 2000 08 holman s1 html page 2 16 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 The XT XSLT processor written by James Clark is an example of a processor implementing extension facilities XT uses the http www jclark com xt namespace to identify the extension constructs it implements Remembering that this is a URI and not a URL you will not find any kind of resource or file when using this value as a URL We also use our own namespaces in an XSLT stylesheet for two other purposes We need to specify the namespaces of the elements and attributes of our result if the process interpreting the result relies on the vocabulary to be identified Furthermore our own non default na
390. t to the application After encountering a fatal error the processor may continue processing the data to search for further errors and may report such errors to the application In order to support correction of errors the processor may make unprocessed data from the document with intermingled character data and markup available to the application Once a fatal error is detected however the processor must not continue normal processing T i e it must not continue to pass character data and information about the document s logical structure to the application in the normal way at user option Conforming software may or must depending on the modal verbi in the sentence behave as described if it does it must provide users a means to enable or disable the behavior described validity constraint J A rule which applies to all valid XML documents Violations of validity constraints are errors they must at user option be reported by validating XML processors http www xml com axml testaxml htm 3 di 34 10 05 2001 9 26 15 The Annotated XML Specification well formedness constraint j 1 A rule which applies to all well formed XML documents Violations of well formedness constraints are fatal errors match Definition Of strings or names Two strings or names being compared must be identical Characters with multiple possible representations in ISO IEC 10646 e g characters with both precomposed and base diacritic fo
391. tabase as follows Name start characters must have one of the categories LI Lu Lo Lt NL e Name characters other than Name start characters must have one of the categories Mc Me Mn Lm or Nd e Characters in the compatibility area i e with character code greater than xF900 and less than xFFFE are not allowed in XML names T Characters which have a font or compatibility decomposition i e those with a compatibility formatting tag in field 5 of the database marked by field 5 beginning with a are not allowed The following characters are treated as name start characters rather than name characters because the property file classifies them as Alphabetic x02BB x02C1 x0559 x06E5 x06E6 Characters x20DD x20E0 are excluded in accordance with Unicode section 5 14 Character x00B7 is classified as an extender because the property list so identifies it Character x0387 is added as a name character because x00B7 is its canonical equivalent Characters and _ are allowed as name start characters Characters and are allowed as name characters C XML and SGML Non Normative XML is designed to be a subset of SGML in that every valid XML document should also be a conformant SGML document For a detailed comparison of the additional restrictions that XML places on documents beyond those of SGML see Clark http www xml com axml testaxml htm 31 di 34 10 05 2001 9 26 16 The Annotat
392. tag is called the element s content Content of Elements 43 content CharData element Reference CDSect PI Comment Je CharData Definition An element with no content is said to be empty The representation of an empty element is either a start tag immediately followed by an end tag or an empty element tag Definition An empty element tag takes a special form Tags for Empty Elements 44 EmptyElemTag i Name S Attribute S WFC Unique Att Spec Empty element tags may be used for any element which has no content whether or not it is declared using the keyword EMPTY For interoperability the empty element tag should be used and should only be used for elements which are declared EMPTY Examples of empty elements 3 2 Element Type Declarations The element structure of an XML document may for validation purposes be constrained using element type and attribute list declarations An element type declaration constrains the element s content Element type declarations often constrain which element types can appear as children of the element At user option an XML processor may issue a warning when a declaration mentions an element type for which no declaration is provided but this is not an error Definition An element type declaration takes the form Element Type Declaration 45 elementdecl lt ELEMENT S Name S contentspec VC Unique Element Type S Decla
393. tax may be used to request the use of particular processing models in accessing the locator s resource This is designed to reflect the realities of network operation where it may or may not be desirable to exercise fine control over the distribution of work between local and remote processors Locator 1 hOcedbnet 2 URI Connector _XPointer Name URI Connector XPointer Name BPI Connector 3ss r 1 3 URE 9 SS URI ela In this discussion the term designated resource refers to the resource which an entire locator serves to locate The following rules apply e The URI if provided locates a resource called the containing resource e If the URI is not provided the containing resource is considered to be the document in which the linking element is contained e If an XPointer is provided the designated resource is a sub resource of the containing resource otherwise the designated resource is the containing resource http www w3 org TR 1998 WD xlink 19980303 5 di 16 10 05 2001 9 30 10 XML Linking Language XLink e If the Connector is followed directly by a Name the Name is shorthand for the XPointer id Name that is the sub resource is the element in the containing resource that has an XML ID attribute whose value matches the Name This shorthand is to encourage use of the robust id addressing mode e If the connector is this signals an intent that the containing resource is
394. ted the programmer as well as the non programmer in that there are procedural constructs specified XSLT is in theory Turing complete thus any arbitrarily complex algorithm could theoretically be implemented using the constructs available While there will always be a trade off between extending the processor to implement something internally and writing an elaborate stylesheet to implement something portably there is sufficient expressive power to implement some algorithmic business rules and semantic processing in the XSLT syntax In short straightforward and common requirements can be satisfied in a straightforward fashion while unconventional requirements can be satisfied to an extent as well with some programming styled effort Note 4 Theory aside the necessarily verbose XSLT syntax dictated by its declarative nature and use of XML syntax makes the coding of some complex algorithms a bit awkward I have implemented some very complex traversals and content generation with successful results but with code that could be difficult to maintain my own valiant if not always satisfactory documentation practices notwithstanding http Awww xml com pub a 2000 08 holman s1 html page 2 7 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 The designers of XSLT recognized the need to maintain large transformation specifications and the desire to tap prior accomplishments when writing stylesheets so they have include
395. the prefix i or I e alanguage identifier assigned by the user or agreed on between parties in private use these must begin with the prefix x or X in order to ensure that they do not conflict with names later standardized or registered with IANA There may be any number of Subcode segments if the first subcode segment exists and the Subcode consists of two letters then it must be a country code from ISO 3166 Codes for the representation of names of countries If the first subcode consists of more than two letters it must be a subcode for the language in question registered with IANA unless the Langcode begins with the prefix x or X http www xml com axml testaxml htm 10 di 34 10 05 2001 9 26 16 The Annotated XML Specification It is customary to give the language code in lower case and the country code if any in upper case Note that these values unlike other names in XML documents are case insensitive For example The intent declared with xm1 lang is considered to apply to all attributes and content of the element where it is specified unless overridden with an instance of xm1 1ang on another element within that content A simple declaration for xm1 1ang might take the form EID AMNEM but specific default values may also be given if appropriate In a collection of French poems for English students with glosses and notes in English the xml lang attribute might be declared this wa
396. the document Definition An unparsed entity is a resource whose contents may or may not be text and if text may not be XML Each unparsed entity has an associated notation identified by name Beyond a requirement that an XML processor make the identifiers for the entity and notation available to the application XML places no constraints on the contents of unparsed entities Parsed entities are invoked by name using entity references unparsed entities by name given in the value of ENTITY or ENTITIES attributes Definition General entities are entities for use within the document content In this specification general entities are sometimes referred to with the unqualified term entity when this leads to no ambiguity Definition Parameter entities are parsed entities for use within the DTD These two types of entities use different forms of reference and are recognized in different contexts Furthermore they occupy different namespaces a parameter entity and a general entity with the same name are two distinct entities T 4 1 Character and Entity References Definition A character reference refers to a specific character in the ISO IEC 10646 character set for example one not directly accessible from available input devices T Well Formedness Constraint Legal Character Characters referred to using character references must match the production for Char If the character reference begins with amp 4 x the digits a
397. the last do the following O For a character reference append the referenced character to the normalized value O For an entity reference recursively apply step 3 of this algorithm to the replacement text of the entity O Fora white space character 71x20 xD xA x9 append a space character 71x20 to the normalized value O For another character append the character to the normalized value If the attribute type is not CDATA then the XML processor must further process the normalized attribute value by discarding any leading and trailing space x20 characters and by replacing sequences of space x20 characters by a single space x20 character Note that if the unnormalized attribute value contains a character reference to a white space character other than space x20 the normalized value contains the referenced character itself xD xA or x9 This contrasts with the case where the unnormalized value contains a white space character not a reference which is replaced with a space character 4x20 in the normalized value and also contrasts with the case where the unnormalized value contains an entity reference whose replacement text contains a white space character being recursively processed the white space character is replaced with a space character 4x20 in the normalized value All attributes for which no declaration has been read should be treated by a non validating processor as if declared CDATA http Awww w3 o
398. this page Module Introductions and Preview only 2001 01 19 over 130 pages including the complete text of the first two and last two modules is included to illustrate the bulleted nature of the content and the level of detail of the remainder of the materials the last two modules include cross reference information enhanced from the W3C documents as well as http www cranesoftwrights com training 3 di 5 10 05 2001 9 01 00 Crane Softwrights Ltd Training Programmes and Training Material illustrative documentation for XT and Microsoft IES Pricing information is available at the top of this page note that the purchase includes subscription to all future updates of the same material whether you buy an individual copy a copy for a single site s local intranet or a copy for a world wide corporate intranet There is a published review of the book and a brief public testimonial regarding this work on the XSL List We encourage all suggestions to improve the materials in order that existing customers can get updated publications and future customers get as complete a collection of information as possible 2 Staff Licenses The same purchase rights given to an individual for perpetual no charge updates to a purchased book is granted to staff members in either a site wide staff license or a world wide staff license Your organization can give your staff but not your customers access to a copy of a Crane book on your own intran
399. ting of tags attribute values and their types and defaults the names of external files that may be referenced and whether or not they contain XML the formats of some external non XML data that may be referenced and the entities that may be encountered There are four kinds of declarations in XML element type declarations attribute list declarations entity declarations and notation declarations Element Type Declarations Element type declarations Section 3 2 identify the names of elements and the nature of their content A typical element type declaration looks like this lt ELEMENT oldjoke burns allen applause gt This declaration identifies the element named old joke Its content model follows the element name The content model defines what an element may contain In this case an oldjoke must contain burns and allen and may contain applause The commas between element names indicate that they must occur in succession The plus after burns indicates that it may be repeated more than once but must occur at least once The question mark after applause indicates that it is optional it may be absent or it may occur exactly once A name with no punctuation such as allen must occur exactly once Declarations for burns allen applause and all other elements used in any content model must also be present for an XML processor to check the validity of a document In addition to element names the special symbol PCDATA i
400. tion can be provided for the local resource of a link if the link is inline e The role of the resource to identify to application software the part it plays in the link Note that a link as a whole may also be given its own role as described in 4 1 2 Link Semantics A link author can optionally provide role information in an attribute called content role e A title for the resource to serve as a displayable caption that explains to users the part the resource plays in the link A link author can optionally provide title information in an attribute called content title XLink does not require that application software make any particular use of title information Following are sample declarations of these attributes enclosed in a local resource semantics att parameter entity ENTITY local resource semantics att Weontentz role CDATA IT MPLIED content itle CDATA IMPLIED 4 2 Simple Links Simple links can be used for purposes that approximate the functionality of a basic HTML A link but they can also support a limited amount of additional functionality Simple links have only one locator and thus for convenience combine the functions of a linking element and a locator into a single element As a result of this combination the simple linking element offers both a locator attribute and all the link and resource semantic attributes Following is a sample declaration for a simple link showing all the possible XLink re
401. tion rules arc type elements The relationships between resources involved in a link are specified using arcs Arc type elements i e those with xlink type arc use the to and from attributes to designate the start and end points of an arc acted xlink type arc xlink from maria xlink to metropolis gt Aside from the traversal attributes to and from arcs may include the following e show This attribute is used to determine the desired presentation of the ending resource Its possible values are new open a new window replace load the referenced resource in the same window embed embed the pointed resource a movie for example none unrestricted and other unrestricted by the XLink spec but the processor should look into the subelements for further information e title Just as with resources this is simply a human readable string with a short description for the arc e actuate This attribute is used to determine the timing of traversal to the ending resource Its possible values are onLoad load the ending resource as soon as the start resource is found onRequest e g user clicks the link other and none e arcrole The advanced uses of arcrole and its counterpart the role attribute are beyond the scope of this article Please refer to section 5 of the XLink specification for a discussion on linkbases For our discussion suffice it to say that this attribute must be a URI refer
402. to an application using the processor Since there are no formalized semantic description facilities in XML any XML that is used is not tied to any one particular concept or application There are no rendition or transformation rules or constructs defined in XML The only purpose of XML is to unambiguously identify and deliver constituent components of data There are no inherent meanings or semantics of any kind associated with element types defined in a document model There are no defined controls for implying any rendering semantics Even the xm1 space attribute allowing for the differentiation of whitespace found in a document is not an aspect of rendering but of information description The author or modeler of an instance is indicating with this reserved attribute termed special in XML 1 0 the nature of the information and how the whitespace found in the information is to be either preserved or handled by a processor in a default fashion Some new users of XML who have a background in a markup language such as HTML often assume a magical association of semantics with element types of the same names they have been exposed to in their prior work In a web page they can safely assume that the construct lt p gt will be interpreted as a paragraph or lt em gt as emphasized text However this interpretation is solely the purview of the designers of HTML and user agents attempting to conform to the World Wide Web Consortium W3C publi
403. to be fetched as a whole from the host that provides it and that the XPointer processing to extract the sub resource is to be performed on the client that is to say on the same system where the linking element is recognized and processed e If the connector is no intent is signaled as to what processing model is to be used for accessing the designated resource Note that by definition a URI includes an optional query component In the case where the URI contains a query to be interpreted by the server information providers and authors of server software are urged to use queries as follows Query 4 Query XML XPTR XPointer Name 3 Link Recognition The existence of a link is asserted by a linking element Linking elements must be recognized reliably by application software in order to provide appropriate display and behavior There are several ways link recognition could be accomplished for example reserving element type names reserving attributes or leaving the matter of recognition entirely up to stylesheets and application software Reserving attributes provides a balance between giving users control of their own markup language design and keeping the important structural fact is a link explicit within documents Therefore XLink linking related elements are recognized based on the use of a designated attribute named xm1 1ink Possible values are simple and extended which identify linking elements
404. to help deal with the situation where an extended link group directs application software to locate another document which proves to contain an extended link group of its own There is a potential for infinite regress and yet there are situations where processing several levels of extended link groups is useful The steps attribute should have a numeric value that http www w3 org TR 1998 WD xlink 19980303 12 di 16 10 05 2001 9 30 10 XML Linking Language XLink serves as a hint from the author to any link processor as to how many steps of extended link group processing should be undertaken It does not have any normative effect For example should a group of documents be organized with a single hub document containing all the out of line links it might make sense for each non hub document to contain an extended link group containing only one reference to the hub document In this case the best value for steps would be 2 6 Link Behavior Link formatting and link behavior are inextricably connected In general formatting involves the appearance or treatment of the link prior to any user action such as choice of font color icons and other devices to show that a link is present Behavior focuses on what happens when the link is traversed such as opening closing or scrolling windows or panes displaying the data from various resources in various ways testing authenticating or logging user and context information or executing v
405. to know the addressing scheme with which the components are arranged The basis of addressing XML documents is an abstract data model of interlinked nodes arranged hierarchically echoing the tree shape of the nested elements in an instance Nodes of different types make up this hierarchy each node representing the parsed result of a syntactic structure found in the bytes of the XML instance This abstraction insulates addressing from the multiple syntactic forms of given XML constructs allowing us to focus on the information itself and not the syntax used to represent the information Note 2 We see XML documents as a stream or string of bytes that follow the rules of the XML 1 0 Recommendation Stylesheets do not regard instances in this fashion and we have to change the way we think of our XML documents in order to successfully work with our information This leap of understanding ranks high on the list of key aspects of stylesheet writing I needed to internalize before successfully using this technology We are given tools to work in the framework provided by the abstraction a set of data types used to represent values found in the generalization and a set of functions we use to manipulate and examine those values The data types include strings numbers boolean values and sets of nodes of our information The functions allow us to cast these values into other data type representations and to return massaged information according
406. ttached to the process rectangle This serves to remind the reader that the serialization of the result into an XML file is a separate task one that is the responsibility of the XSLT processor and not the stylesheet writer In all diagrams the left pointing triangle represents a hierarchically marked up document such as an XML or HTML document This convention stems from considering the apex of the hierarchy at the left with the sub elements nesting within each other towards the lowest leaves of the hierarchy at the right of the triangle Processes are depicted in rectangles while arbitrary data files of some binary or text form are depicted in parallelograms Other symbols representing screen display print and auditory output are drawn with hopefully obvious shapes 1 2 2 Transformation from XML to XSL formatting semantics When the result tree is specified to utilize the XSL formatting vocabulary the normative behavior of an XSL processor incorporating an XSLT processor is to interpret the result tree This interpretation reifies the semantics expressed in the constructs of the result tree to some medium be it pixels on a screen dots on paper sound through a synthesis device or another medium that makes sense for presentation transformation script Aural Process Aural Print Process Process source document XSL Formatting and optional Flow Object Semantics serialized _Interpr
407. ttribute book isbn 0836217462 xmlns http example org ns b xmlns xsi http www w3 0rg 2000 10 XMLSchema xsi schemaLocation http example org ns book Introducing Our First Schema Slicing the Schema Defining Named Types Groups Compositors and Derivation Content Types Constraints Building Usable and Reusable Schemas sNamespacesn W3C XML Schema and Instance Documents W3C XML Schema Datatypes Reference eq 5 XML Schema Suuetires Reference xsd XML Products Tools The other use of xsi attributes is to provide information about how an element corresponds to a schema These attributes are xsi type which lets you define the simple or complex type of an element and xsi null which lets you specify a null value for an element that has to be defined as nu11able true in the schema You don t need to declare these attributes in your schema to be able to use them in an instance document Training http www xml com pub a 2000 1 1 29 schemas part1 html page 9 1 di 2 10 05 2001 9 20 06 XML com Using W3C XML Schema Nov 29 2000 THIS SITE IS ON THE 5 RDF Applications with Prolog http www xml com pub a 2000 1 1 29 schemas part1 html page 9 2 di 2 10 05 2001 9 20 06 XML com W3C XML Schema Datatypes Reference Nov 29 2000 O REILLY o xml from the inside out ONJAVA COM XML COM O REILLY NETWORK Is Open Source Un American Find it at ONLamp co
408. tylesheet Language XSL Working Draft describes a vocabulary recognized by a rendering agent to reify abstract expressions of format into a particular medium of presentation Both XSLT and XSL are endorsed by members of WSSSL an association of researchers and developers passionate about the application of markup technologies in today s information technology infrastructure 1 1 4 Extensible Stylesheet Language XSL When we need to present our structured information in a given medium or different media we all have common needs for how the result appears and way the result flows through that appearance The XSL Working Draft describes the current work developing a vocabulary of formatting and flow semantics that can be expressed using an XML model of elements and attributes e http www w3 org TR WD xsl 1 1 4 1 Formatting and flow semantics vocabulary http www xml com pub a 2000 08 holman s1 html page 2 3 di 19 10 05 2001 9 03 31 XML com What is XSLT I Aug 16 2000 This hierarchical vocabulary captures formatting semantics for rendering textual and graphic information in different media A rendering agent is responsible for interpreting an instance of the vocabulary for a given medium to reify a final result This is no different in concept and architecture than using HTML and Cascading Stylesheets CSS as a hierarchical vocabulary for rendering a set of information in a web browser In essence we are transforming our XM
409. ub a 98 10 guideO html 2 di 3 10 05 2001 9 27 20 XML com A Technical Introduction to XML Oct 03 1998 pu Julliet aste d t p Coen Find it on the O Reilly Network http www xml com pub a 98 10 guideO html 3 di 3 10 05 2001 9 27 20 XML com What is XML Oct 03 1998 O REILLY e xml from the inside out XML COM O REILLY NETWORK ONJAVA COM Find it on the O Reilly Network Welcome to Your Desktop OREILLY COM es RESOURCE P CENTERS Business Graphics Metadata Mobile Programming Protocols Schemas Style Web ESSENTIALS Annotated XML What is XML What is XSLT What is XLink What is XML Schema What is RDF Find it in the O Reilly Network P2P DevCenter FIND gt Search Article Archive FAQs What is XML by Norman Walsh October 03 1998 Print This Article XML is a markup language for documents containing structured information Structured information contains both content words pictures etc and some indication of what role that content plays for example content in a section heading has a different meaning from content in a footnote which means something different than content in a figure caption or content in a database table etc Almost all documents have some structure A markup language is a mechanism to identify structures in a document The XML specification defines a standard way to add markup to documents Wha
410. uctured nor text nor in any format anticipated by the designers of the Recommendation We do have a responsibility to fill in a critical piece of the formula described below but we can leverage this single effort in the equation to allow us and our colleagues to continue to use W3C Recommendations with our XML data Not using XSLT to produce custom output Consider first the scenario without using XSLT where we must write individual XML aware applications to accommodate our information vocabularies For each of our vocabularies we need separate programs to convert to the common custom format required by the application This incurs programming resources to accommodate any and every change to our vocabularies in order to meet the new inputs to satisfy the same custom output http www xml com pub a 2000 08 holman s1 html page 3 5 di 10 10 05 2001 9 05 02 XML com What is XSLT I Aug 16 2000 XML XML Vocabulary 1 Vocabulary n Conversion Conversion source program 1 resulting source program n resulting document file document file vocabulary 1 vocabulary n Figure 1 6 Accommodating multiple inputs with different XML vocabularies Using XSLT to produce custom output If however we focus on the custom output instead of focusing on our vocabulary inputs we can leverage a single investment in programming across all of our vocabularies Moreover by being independent of the vocabulary used in the source we can accommodate
411. ument element as is our example the value returned is the concatenation of all PCDATA text in the entire instance A literal result element is any element in a stylesheet that is not a top level element and is not either an XSLT instruction or an extension instruction A literal result element can use the default namespace or any namespace not declared in the stylesheet to be an instruction namespace When the XSLT processor reads the stylesheet and creates the abstract nodes in the stylesheet tree those nodes that are literal result elements represent the nodes that are added to the result tree Though the definition of those nodes is dictated by the XML syntax in the stylesheet entity the syntax used does not necessarily represent the syntax that is serialized from the result tree nodes created from the stylesheet nodes Literal result elements marked up in the stylesheet entity may have attributes that are targeted for the XML processor used by the XSLT processor targeted for the XSLT processor or targeted for use in the result tree Some attributes are consumed and acted upon as the stylesheet file is processed to build the stylesheet tree while the others remain in the stylesheet tree for later use Those literal result attributes remaining in the stylesheet tree that are qualified with an instruction namespace are acted on when they are asked to be added to the result tree 2 2 5 Templates and template rules Many XSLT instructions are co
412. ument model is useful to an XML processor or to a system working with XML instances that model has no impact on the implicit structural model and only minor influence on the interpretation of content found in the instance This point holds true whether the model is expressed in a DTD or in some of the other Recommendations for structural and content schemata being developed Consider the following valid XML instance purcdtd xml lt xml version 1 0 gt lt DOCTYPE purchase lt ELEMENT purchase customer prod lt ATTLIST purchase id ID REQUIRED gt lt ELEMENT customer EMPTY gt lt ATTLIST customer db CDATA REQUIREI lt ELEMENT product amount gt lt ATTLIST product db CDATA REQUIREI lt ELEMENT amount ESAMI lt purchase id p001 gt lt customer db cust123 gt lt product db prod345 gt lt amount gt 23 45 lt amount gt Onc oXe BIG TE lt purchase gt Example 1 2 A valid XML purchase order instance See how the information content is no different from the previous example but in this case an explicit document model using XML 1 0 DTD syntax is included it could have been included by reference to a separate resource A processor can validate that the information content conforms not only to the lexical rules for XML well formedness but http www xm
413. us A B C D is identical to A B C D A B matches A or B but not both A B matches any string that matches A but does not match B Act matches one or more occurrences of A Concatenation has higher precedence than alternation thus A B is identical to A Bt A matches zero or more occurrences of A Concatenation has higher precedence than alternation thus A B is identical to A B Other notations used in the productions are JV nae PE http www w3 org TR REC xml 32 di 41 10 05 2001 9 29 13 Extensible Markup Language XML 1 0 Second Edition comment wfe sse well formedness constraint this identifies by name a constraint on well formed documents associated with a production Veet xe validity constraint this identifies by name a constraint on valid documents associated with a production A References A 1 Normative References IANA CHARSETS Internet Assigned Numbers Authority Official Names for Character Sets ed Keld Simonsen et al See ftp ftp isi edu in notes iana assignments character sets IETF RFC 1766 IETF Internet Engineering Task Force RFC 1766 Tags for the Identification of Languages ed H Alvestrand 1995 See http www ietf org rfc rfc 1766 txt ISO IEC 10646 ISO International Organization for Standardization ISO IEC 10646 1993 E Information technology Universal Multiple Octet Coded Character Set UCS Part 1 Architecture and Basic
414. wed for in the specification xml stylesheet alternate yes title small href small xsl type text xsl Example 1 15 Alternative stylesheet association A URL that does not include a reference to another resource but rather is defined exclusively by a local named reference specifies a stylesheet resource that is located inside the XML document being processed as in the following example 01 lt xml stylesheet href stylel type text xsl Example 1 16 Associating an internal stylesheet The Recommendation designers expect additional schemes for linking stylesheets and other processing scripts to XML documents to be defined in future specifications http www xml com pub a 2000 08 holman s1 html page 2 18 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 Note 11 Embedding stylesheet association information in an XML document and using the XML processing instruction to do so are both considered stopgap measures by the W3C This Recommendation cautions readers that no precedents are set by employing these makeshift techniques and that urgency dictated their choice Indeed there is some question as to the appropriateness of tying processing to data so tightly and we will see what considered approaches become available to us in the future Pages 1 2 3 Next Page Where Are You Exactly A GPS Introduction Find it on the O Reilly Network http www xml com pub a 2000 08 h
415. wo is in use or for bringing other encodings into play are discussed later in 4 3 3 Character Encoding in Entities 2 3 Common Syntactic Constructs This section defines some symbols used widely in the grammar S white space consists of one or more space x20 characters carriage returns line feeds or tabs White Space 3 S 4x20 4x9 xD xA Characters are classified for convenience as letters digits or other characters A letter consists of an alphabetic or syllabic base character or an ideographic character Full definitions of the specific characters in each class are given in B Character Classes Definition A Name is a token beginning with a letter or one of a few punctuation characters and continuing with letters digits hyphens underscores colons or full stops together known as name characters Names beginning with the string xm1 or any string which would match X x M m L 1 are reserved for standardization in this or future versions of this specification Note The Namespaces in XML Recommendation XML Names assigns a meaning to names containing colon characters Therefore authors should not use the colon in XML names except for namespace purposes but XML processors must accept the colon as a name character An Nmtoken name token is any mixture of name characters Names and Tokens http www w3 org TR REC xml 6 di 41 10 05 2001 9 29 12 Extensible Markup Language XML
416. x0556 x0559 x0561 x0586 4x05D0 4x05EA 4x05F0 4x05F2 4x0621 4x063A x0641 x064A x0671 x06B7 x06BA x06BE x06C0 x06CE x06D0 x06D3 x06D5 X06E5 x06E6 x0905 x0939 x093D x0958 x0961 x0985 x098C x098F x0990 x0993 x09A8 x09AA x09BO0 x09B2 x09B6 x09B9 x09DC x09DD x09DF x09E1 x09F0 x09F1 x0A05 x0A0A x0A0F x0A10 x0A13 x04A28 4 x0A2A 4x0A30 x0A32 4x0A33 xOA35 x0A36 xOA38 x0A3 9 3 x0A59 x0A5C xOA5SE fx0A72 x0A74 x0A85 x0A8B x0A8D xOASF x0A91 43 x0A93 4x0AA8 xXOAAA x0ABO 3 x0AB2 x0AB3 SxOAB5 x0AB9 xXOABD xOAEO 4 x0B05 4x0BOC 3xOBOF x0B10 4 x0B13 4x0B28 xOB2A x0B30 x0B32 x0B33 x0B36 Xx0B39 x0B3D x0B5C xX0B5D 4x0B5F 4x0B61 xOB85 x0B8A xOB8E x0B90 xOB92 x0B95 43x0B99 4x0B9A XOB9C xXO0B9E x0B9F x0BA3 4x0BAA4 x0OBA8 4x0BAA xOBAE x0BB5 xOBB7 x0BB9 4 x0C05 4x0COC 43xOCOE 4x0C10 43x0C12 4x0C28 43x0C2A 4x0C33 4 x0C35 4x0C39 xO0C60 x0C61 xOC85 x0C8C xOC8E x0C90 xO0C92 x0CA8 xOCAA x0CB3 xOCB5 x0CB9 xOCDE fxOCEO xOCE1 x0D05 x0DOC xODOE x0D10 xOD12 x0D28 xOD2A x0D39 xOD60 x0D61 xORO1 x0E2E x0E30 xOR32 x0E33 xOR40 x0E45 x0E81 x0E82 XOE84 x0E87 xX0E88 x0E8A xXOE8D xOR94 x0E97 xOR99 x0E9F xOEA1 x0EA3 XOEA5 x0EA7 xOEAA 4Sx0EAB xOEAD 4xOE
417. xsd field xpath name gt lt xsd unique gt This location of the xsd unique element in the schema gives the context node in which the constraint holds By inserting xsd unique under our book element we specify that the character has to be unique in the context of a book only The two XPaths defined in the uniqueness constraint are evaluated relative to the context node The first of these paths is defined by the selector element The purpose is to define the element which has the uniqueness constraint the node to which the selector points must be an element node The second path specified in the xsd field element is evaluated relative to the element identified by the xsd selector and can be an element or an attribute node This is the node whose value will be checked for uniqueness Uniqueness over a combination of several values can be specified by adding other xsd field elements within xsd unique Keys The second constraint construct xsd key is similar to xsd unique except that the value specified as unique can be used as a key This means that it has to be non null and that it can be referenced To use the character name as a key we can replace the xsd unique by xsd key xsd key name charNameIsKey xsd selector xpath character gt xsd field xpath name gt xsd key The third construct xsd keyref allows us to define a reference to a key To show its usage we introdu
418. y 3 Logical Structures Definition Each XML document contains one or more elements E the boundaries of which are either delimited by start tags and end tags or for empty elements by an empty element tag Each element has a type U identified by name sometimes called its generic identifier GI and may have a set of attribute specifications Each attribute specification has a name and a value Element 39 element EmptyElemTag STag content WFC ETag Element Type Match IVG Element Valid This specification does not constrain the semantics use or beyond syntax names of the element types and attributes H except that names beginning with a match to X x M m L 1 are reserved for standardization in this or future versions of this specification Well Formedness Constraint Element Type Match The Name in an element s end tag must match the element type in the start tag Validity Constraint Element Valid An element is valid if there is a declaration matching element decl where the Name matches the element type T and one of the following holds 1 The declaration matches EMPTY and the element has no content Ti 2 The declaration matches children and the sequence of child elements belongs to the language generated by the regular expression in the content model with optional white space characters matching the nonterminal S between each pair of child elements T 3
419. y that associate lookup information donkeys John Huston Pizza South Side with the information you re really after Here s a subtle but important point in theory metadata is not really necessary you could go through the library one book at a time looking for donkey books or through the video store shelves until you found your movie or call all the numbers in your area code until you find pizza delivery But that would be very wasteful in fact it would be stupid Metadata is the way to go It s All Different Behind the Scenes In each of our scenarios we used metadata and we used it in remarkably similar ways Does this mean that the library the video store and the phone company all use the same metadata setup Of course not Every library has a choice among at least two systems for organizing their books and among many vendors who will sell them software to do the looking up The same is obviously true for video stores and phone companies In fact most such products define their own system of metadata and their own facilities for storing and managing it They typically do not offer facilities for sharing or interchanging it This doesn t cause too much of a problem assuming they do a decent job with the user interface We are comfortable enough with the general process we call looking things up really searching via metadata that we are able to adapt and use all these different systems http www xml com pub a
420. y serialize the start of an element as soon as the element content of the result is defined There is no need to maintain nor is there any ability in the stylesheet to add to the start of an element once the stylesheet begins supplying element content The XSLT 1 0 Recommendation defines three output methods for lexically reifying the abstract result tree as serialized syntax XML conventions HTML conventions and simple text conventions An XSLT http www xml com pub a 2000 08 holman s1 html page 2 12 di 19 10 05 2001 9 03 32 XML com What is XSLT I Aug 16 2000 processor can be extended to support custom serialization methods for specialized needs 1 1 5 10 Result tree oriented objective This result abstraction impacts how we design our stylesheets We have to always remember that the result of transformation is created in result parse order thus allowing the XSLT processor to immediately serialize the result without maintaining the result for later purposes The examples of transformation that we include in our stylesheet already represent examples of the nodes that we want added to the result tree but we must ensure these examples are triggered to be added to the result tree in result parse order otherwise we will not get the desired result We can peruse and traverse our source files in any predictable order we need to produce the result but we can only produce the result tree once and then only in result tree parse order
421. ypes 54 AttType StringType TokenizedType EnumeratedType 55 Ge sbagwee sse CEA 56 TokenizedType ID wes 3 VC One TOF eer Element Type Yes UID Attribute Default PED Newer Vez IDREE Y IDE SY Weg JUDIE TINE IEEE Y Wier Entity Name aN TE IP IES Y WC Entdty Name NMTOKEN VC Name Token NMTOKENS VC Name Token Validity Constraint ID Values of type ID must match the Name production A name must not appear more than once in an XML document as a value of this type i e ID values must uniquely identify the elements which bear them T i Validity Constraint One ID per Element Type No element type may have more than one ID attribute specified T Validity Constraint ID Attribute Default An ID attribute must have a declared default of 8IMPLIED or REQUIRED T Validity Constraint IDREF Values of type IDREF must match the Name production and values of type IDREFS must match Names each Name must match the value of an ID attribute on some element in the XML document i e IDREF values must match the value of some ID attribute T Validity Constraint Entity Name http www xml com axml testaxml htm 15 di 34 10 05 2001 9 26 16 The Annotated XML Specification Values of type ENTITY must match the Name production values of type ENTITIES must match Names each Name must match the name of an unparsed entity declared in the DTD T Validity

Download Pdf Manuals

image

Related Search

Related Contents

Cap_Anleitung franz    Philips Norelco Bodygroom 3100 BG2034    Quantum L100 Computer Drive User Manual  Memorex MLT4221P Flat Panel Television User Manual  BW-306-01 Service Manual RC400 (English)  "service manual"  取扱説明書 - LIXIL  

Copyright © All rights reserved.
Failed to retrieve file