论坛首页 入门技术论坛

XML XLS AND XSLT AND XPATH AND XPOINTER AND COCOON

浏览 1813 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (1)
作者 正文
   发表时间:2009-01-09  
there are two ways of chainging schemas together .import import a schema from another namespace into target schema. include include a schema that reside in the same namespace as the target schema.these goals are in tension with one another.the working group's strategix guidlines for changes between version1.0 and 1.1 can be summaried as follows:support for versioning support for cooccurrence constraints. xsd schemas can be described in terms of an abstract data model. in defining schemas in terms of an abstract data model, this specification rigorously specifies the information which musty be avaible to a conforming xsd processor. schema component is the generic term for the building blocks that make up the abstract data model of the schema. an xsd schema is a set of schema comoponents. there are several kinds of schema component,falling into three groups. the primary schema components which may or must have names are as follows:simple type definitions , complex type definitions attributes declarations,element declarations.  the second schema components are as follow: attribute group definitions,identity-constraint definitions,type alternatives,assertions,model group definitions,notation declarations. finally, the helper schema components provide small parts of other schema components, they are dependent on their context: annotation,model groups,particles,wildcards,attribute uses. for each kind of schema component there is a corresponding normative xml represention.  xslt----- a language for transforming xml documents. xsl or xsl-fo a language for formatting xml documents,xpath---- a language for navigating through elements and attributers in xml documents.

xsl-fo documents are xml files with output information. they contain information about the output layout and output contents. xsl -fo documents are stored in files with a .fo or .fob file extension. it is also quite common to see sxl-fo documents stored with an .xml extension,because this makes them more accessibel to xml editors.
an xsd schema is a set of components such as type definitions and element declarations. these can be used to assess the validity of well-formed element and attribute information items.

The xsl language consists of two parts: an xsl transformation language and a formating object specification. the xsl transformation lanuage and the formating object specification are implemented as xml namespaces. the xsl transformation lanuage is  a desciption of how a processor can transform an xml from one structure to another. the transformation process in a general sense takes one document tree and transforms it into another document tree. its most likely and perhaps obvious use would be to convert an xml document from a semantic structure to a display structure. the formatting object specofication provides for new formatting semantics developed as an xml vocabulary. a style sheet consists of one or more templates that contain patterns. As their name imlies, templates provide a structure form the output document. The output elements can be almost anything. xsl templates reference xml data via patterns. xsl uses patterns to specify the xml elements to which the xsl template applies. this method of pattern matching makes xsl a declarative lanuiage as opposed to a procudural language. That is , the patterns describe the specific  branch in the document tree to match by identifying its hierarchical structure whithin that tree. the most straightforward way to get data into a template is to use the xsl:value-of element combined with the select attribute. The xsl:value-of element retrieves the value of the element indicated by the select attribute. This value is then inserted into the template as text. queries are the muscle behind xsl while the term query might sound like a highly technical programming term. Queries provide a way to address data by specifying a pattern and then matching that pattern.Queries also provide a sorting mechanism in xsl. In xsl , every element must have a template so that the document can be processed properly. When the processor recognizes that an element does not have a template, it  uses a built-in  default template for that element.The default template simply targets the element in question and specifies no formatting for it. The value of using xml as a data source in application is entirely dependent on the ability of the application and ultimately the user to access that data. There are three ways to access data in an xml document. The first way is to walk the xml document tree and pull out information as we come across what we are looking for. The second method is to use the xml data source object to populate a table with xml data. while this method provides more flexibility.We also looked at using xsl to apply rules a document that describe how the data should be presented.

Xpath has seven node types:root,element,attribute,text,comment,processing instruction and namespace. The Xpath tree has a single root node which contains all other nodes in the tree.

To prcoess xslt documnets, you will need an xslt processor. Apache has created the XALAN xslt processor for java and c++.  xslt uses XPATH expression to locate nodes in an xml document.In an xsl transformation, there are two trees of nodes. The first node tree is the source tree. The nodes in this tree correspond to the original xml document to which the transformation is applied. The second node tree is the result tree. The result tree contains all of the nodes produced by the xsl transformation. The result tree represents the document produced by the transformation.

THE W3C IS currently working on a specification to provide base uris for relative links,similar to the html element base.
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics