블로그 이미지
충남대학교대학원 컴퓨터공학과 박사1년차 석박사통합과정 데이터베이스시스템연구실 Yim, Hyung-jun

 
 

Five XSLT 2.0 Features that Simplify XML

XML | 2008/03/21 15:56 | Posted by Yim, Hyung-jun

Five XSLT 2.0 Features that Simplify XML Document Transformations
by Jinyu Wang ORACLE Technology Network

1. Introduce
five new features in XSLT 2.0 that will help overcome these limitations:
Grouping: allows simplified and efficient content grouping
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
<?xml:namespace prefix = o /><?xml:namespace prefix = o />
<?xml:namespace prefix = o /><?xml:namespace prefix = o />
<?xml:namespace prefix = o />

Multiple Outputs: creates multiple output documents in one XSLT transformation
Temporary Tree: eliminates node-set conversions
Character Mapping: replaces the error-prone character escaping
Datatype Binding: allows processing data according to their datatypes.

2. Feature 1: Grouping

3. Feature 2: Multiple Outputs

4. Feature 3: Temporary Trees

5. Feature 4: Character Mapping

6. Feature 5: Datatype Binding

7. Summary
If you write an XSL stylesheet, the features discussed in this paper will not only save you time, but also improve the performance of your XSLT transformations.

'XML' 카테고리의 다른 글

Five XSLT 2.0 Features that Simplify XML  (0) 2008/03/21
The Future of XSLT 2.0  (0) 2008/03/21
XQueryP: An XML Application Development Language  (0) 2008/03/21
XQueryP: Programming with XQuery  (0) 2008/03/21

The Future of XSLT 2.0

XML | 2008/03/21 15:52 | Posted by Yim, Hyung-jun

The Future of XSLT 2.0
by Kurt Cagle March 21, 2007 O'Reilly XML.Com

1. Introduce
- XSLT 2.0 is increasingly being used as a "router" language, replacing such applications as Microsoft's BizTalk Server
- XSLT has a paradigm-altering function called document(), as well as another interesting capability called parameters
- The document function can work on static XML content, but it can also use the GET protocol (through query strings) to retrieve content from web services
- Parameters can be set from the hosting language to determine these web services invocations and, additionally, can be calculated from within the XSLT and passed in the same manner
 
2. Important New Features
- xsl:function
  * which makes it far easier to modularize XSLT functionality in order to turn XSLT into a formal "programming language."
- Formal XPath extension mechanism
  * XSLT now has a formal (and consistent) means of invoking methods written in other languages from within an XSLT expression
- unparsed-text() and unparsed-text-available()
- Sequences
- Numeric iterations
- Regular expressions
- result-document and output
- Inline control keywords
- Character maps
- Tunnel parameters
- Datatypes
- Standalone processing
 
3. XSLT 2.0 as Router
- XSLT2 transformation and bound it to one or more external objects under appropriate namespaces
- It is not generally possible to invoke an XSLT transformation that is created by another transformation in one pass, regardless of the version (nor should it be, for security reasons)
- what you are passing is initially XML, to be transformed as XML
- makes it easier to stop potentially expensive server operations from being invoked if such calls exceed some parameter (such as the rate of automated requests coming from a given client)
- XSLT at that point acts as a job-control language, based not only upon the incoming data but also upon the results of processing that data
 
4. XSLT 2.0, XQuery, and XForms
- I think the "X" model — XQuery + XSLT2 + XHTML + XForms — will likely prove a potent one in the future
 
5. The Future of XSLT
- Predicting the future of any technology, especially one as esoteric as XSLT, is an exercise fraught with risk
- XSTL 2.0 is generally easier to learn than its predecessor, is considerably more powerful, makes most of the right moves with regard to extensibility
- making it a remarkably successful cross-platform solution
 
각각의 자세한 특징을 알고 싶다면 article을 읽어 보세요 
전에 랩 세미나 때에 발표주제로 한 번 공부를 해보았는데, 그 때는 단순한 XSLT 2.0에 대한 특징만 나열해 놓았었다. 지금 그 발표자료를 다시 보았더니, 특징들이 머릿속에 정리가 되었다. 하지만, 그 특징들은 단순한 특징들에 불구하였다. 정말 중요한 Router의 기능을 가지고 있었는데 말이다. Router기능이라고 하면 네트워크에서 Router라고 일반적으로 생각할 수 있는데, 여기는 그게 아니다. 데이터를 프로세싱하는 과정에 대해 각각 접근하는 메카니즘을 Router의 기능으로 말하고 있다. 제대로 이해한지는 모르겠지만, XQuery + XSLT 2.0 + XHTML + XForms가 실현이 된다면 어떻게 될까라는 의문이 든다. 다음주 주제도 XSLT 2.0이니 좀 더 자세히 살펴 보아야 겠다.

'XML' 카테고리의 다른 글

Five XSLT 2.0 Features that Simplify XML  (0) 2008/03/21
The Future of XSLT 2.0  (0) 2008/03/21
XQueryP: An XML Application Development Language  (0) 2008/03/21
XQueryP: Programming with XQuery  (0) 2008/03/21

XQueryP: An XML Application Development Language

XML | 2008/03/21 15:49 | Posted by Yim, Hyung-jun

XQueryP: An XML Application Development Language
Don Chamberlin, Michael J. Carey, Mary Fernández, Daniela Florescu, Giorgio Ghelli, Donald Kossmann, Jonathan Robie, Jérôme Siméon

Abstract
- Operating on XML data with a traditional programming language leads to a serious "impedance mismatch" because the type system of the programming language is not based on XML
 
1. Introduction
- modern business applications use XML to represent data that is heterogeneous, or sparse, or has an intrinsic order
- XML data from other applications or from a database must be transformed into programming language objects before it can be operated on by the business logic
- we explore the possibility of extending XQuery to implement the business logic of XML-based applications, much as SQL has been extended for relational applications
- the case for extending XQuery in a similar way is perhaps stronger due to the large mismatch between programming language type systems and XML Schema, which includes features such as complex types, attributes, multiple kinds of inheritance, and recursive hierarchies
- Our design goal is to find a small set of upwardcompatible extensions to XQuery with Update that can enable the development of XML-based applications
 
2. Sequential Execution, Blocks, and Assignments
- XQuery, like SQL, is a functional language in which data flows from one expression to another by function calls and returns, without side effects
- XQuery 1.0 has no notion of state, and no defined order for the evaluation of expressions except where one expression serves as an operand of another
- In XQuery with Update, a given query may contain several updating expressions, but each of these expressions operates on the data in its initial state, and all updates are held in a pending list and applied together at the end of query processing
- Expressions are evaluated in a well-defined order, and the side effects of each expression are visible to the next expression to be evaluated
 
3. Control Flow
- XQuery 1.0 defines constructs for conditional branching (if-then-else) and iteration (the forclause of a FLWOR expression)
 
4. Exception Handling
- In XQuery, all types of values have symmetric constructor and deconstructor operators, with the exception of the error value
- QName error code, an optional string description, and an optional value that can be used to encapsulate query state when the
error is constructed
- No XQuery expression can take the error value as input--therefore when an error is raised, control flow returns to the application environment
- Each catch clause contains a NameTest (for identifying a type of error), three optional variables (to be bound to the three parts of the error), and a return expression (for handling the error)
- The default clause has a similar structure, except that it has no NameTest because it applies to all types of errors
 
5. Building Data Structures with References
- In XQuery, this functionality is provided by the element constructor expression, which creates a new element whose content is a sequence of objects
- Constructor expressions are different from other XQuery expressions in that they make copies of their operands
- All other kinds of XQuery expressions return nodes by reference rather than by copy
 
6. Invoking and Coordinating Web Services
- In order to facilitate the development of Web applications, XQueryP provides the ability to access web services using a service import declaration in the prolog
- This import takes advantage of the natural correspondence between web services and XQuery modules
- XQuery module definition groups together a set of global variables and functions, which can then be imported and used in another module
- The module definition declares a namespace which is shared by the variables and functions in the module
- XQueryP supports service imports, which allow an application to import a web service as though it were an XQuery module
- Because XQuery and WSDL-based web services both rely on XML as a data model and XML Schema as a type system, this import provides a simple interface to web services without the need to generate a complex mapping between XML Schema and a programming language type system such as JAXB
- the service import behaves the same as an XQuery module import that provides access to one or more functions and/or types defined by the web service
- web service operations correspond to XQuery functions, including how function signatures are derived from WSDL descriptions of a web service
 
9. Conclusions and Future Work
- XQueryP is a proposal for extending XQuery to support development of XML-based applications without relying on a host programming language
- We believe that the proposed language extensions can dramatically reduce the amount of code required to develop web services and other XML applications
- This simplification is made possible by operating on XML in its native data model rather than transforming it into a different
type system
- The XQueryP approach makes it possible to tightly integrate all three parts of an application (storage, logic, and presentation) by basing them all on XML
- One area in which additional work is needed is that of providing mechanisms for XQueryP applications to interact with their external environments

'XML' 카테고리의 다른 글

Five XSLT 2.0 Features that Simplify XML  (0) 2008/03/21
The Future of XSLT 2.0  (0) 2008/03/21
XQueryP: An XML Application Development Language  (0) 2008/03/21
XQueryP: Programming with XQuery  (0) 2008/03/21

XQueryP: Programming with XQuery

XML | 2008/03/21 15:47 | Posted by Yim, Hyung-jun

XQueryP: Programming with XQuery
Don Chamberiln, Michael Carey, Daniela Florescu, Donald Kossmann, Jpnathan Robie

Abstract
- XQuery is a declarative language for querying and updating XML data sources
- Interfacing XQuery to a host programming language is difficult because of the type system mismatch, and global optimization is difficult in a mixed-language environment
 
1. Introduction
- Transforming data from one environment to another impacts performance and adds unnecessary complexity
- No programming language supports the type system of XML Schema or provides direct support for recursively nested XML structures
 
impedance mismatch
(1) Enhance a procedural language with relational query operators so that it no longer needs to call SQL
(2) Enhance SQL with extensions to support application logic without relying on a host language
 
- One possible reason is that procedural languages do not offer the same opportunities for optimization that are available in declarative languages such as SQL
- Another possible reason is that users prefer to have a query language that can be used in multiple environments rather than restricting data access to a single programming environment
 
- In general, industry experience suggests that it is easier to add a few carefully-selected control flow operations to a database query language than it is to embed a foreign type system and persistence model into a procedural programming language
- The available approaches for dealing with impedance mismatch in the XML world fall into the same general categories as the older relational database approaches
- add XML types and retrieval/update operations to an existing programming language
- extending XQuery with operations that support application development
- Our goal is to find the minimum extension to XQuery that is sufficient for this purpose, and to explore the benefits of this extension
(1) XQuery already has a form of iteration and conditional expressions, so the extensions needed for application development
are minimal
(2) The mismatch with the type system of a typical host language is even greater for XML data than for relational data
 
2. XQueryP
- Our goal is to define the smallest extension to XQuery that makes development of simple applications reasonably feasible
 
2.1 Sequential Execution Mode
- In XQuery, as in SQL, data is passed from one expression to
another by physical nesting of the expressions
- Side effects are saved on "pending update lists" and made effective only as the last step in query processing
- As a result, the side effects of one expression cannot be seen by other expressions
- In order to make the result well-defined, it would be necessary to define an ordering on the evaluation of expressions in the expression tree
- We propose to define such an ordering and to make it effective by means of a prolog declaration called an execution declaration
 
2.2 Blocks
- Blocks provide a new way of combining expressions that takes advantage of sequential mode
- Each declaration names one or more variables and can provide a type and an initializing expression for each variable
 
2.3 Assginment
- We define a new kind of expression, called an assignment
expression, to bind a variable to a new value
- Assignment expressions allow different parts of a computation to exchange information through side effects rather than by returning values
 
2.4 Discussion of binding semantics
- In sequential mode, each iteration can see the modifications made by the previous iteration, even though the bound variables (which contain node references) are not re-evaluated
 
2.5 Functions and Blocks
- In a function declaration, the body of a function is an expression enclosed in curly braces
- In order to allow a function body to include a block without requiring an additional set of curly braces, we replace EnclosedExpr with Block in the grammar production for FunctionDecl. This is a compatible change.
 
2.6 While expression
- In sequential mode, successive iterations may see a different
dynamic context, and there is a need to terminate an iteration based on the dynamic context
- The result of a while expression is the concatenation of all the
values returned by its body expression, in iteration order. A while expression is an updating expression if its body expression is an updating expression; otherwise it is a non-updating expression
 
3. Explicit Atomicity
- Many applications need to preserve atomicity for a series of
updates
- we propose an XQuery extension that permits users to control the atomicity of their updates without recourse to a host programming language
- The natural unit of atomicity is a block of expressions
- Snapshot granularity is controlled by a prolog declaration (execution mode), but atomicity is controlled by expression syntax
 
4. Example
 
5. Related Work
 
6. Conclustion and Future Work
- We have investigated a proposal for XQuery language extensions to support the development of simple applications without relying on a host programming language
- XQueryP introduces sequential execution mode, blocks, assignment expressions, and while expressions. Explicit atomicity introduces the notion of an atomic block
- XQuery can also support web-based user interfaces, dynamically generating XHTML or serving as a scripting language to coordinate sideeffecting external functions

'XML' 카테고리의 다른 글

Five XSLT 2.0 Features that Simplify XML  (0) 2008/03/21
The Future of XSLT 2.0  (0) 2008/03/21
XQueryP: An XML Application Development Language  (0) 2008/03/21
XQueryP: Programming with XQuery  (0) 2008/03/21