XSLT工作原理

1、XSL processing flow

clip_image001

An XML document and an XSL stylesheet are input to the XSL processor. Let's look at the steps in Figure 1 in more detail:

  1. Match template patterns. As the XML document content is accessed (element by element), the match attribute for each template rule is compared against that portion (element and its children) of the XML document. The XSL processor accesses the XML document from top to bottom, so the matching process is sequential.
  2. Determine correct template. The XSL processor selects a template rule pattern that matches the XML document. The pattern for a match attribute can be very concise, specifying the path to a particular element or a particular attribute, or more general, allowing matches to any occurrence of an element or attribute within the XML document regardless of its parentage. The determination process takes these factors into account.
  3. Create results for output. The XSL processor deals with the template rule. Depending upon the rule body data, the literal data, XML document content, or both may be put into the output stream or other actions can take place. A result tree is created containing the results of the rule processing. As each rule is processed, information may be added to the results tree.
  4. Any more templates? After checking other templates that need to be processed, the XSL processor continues processing or outputs the results tree and ends the execution.

2、微软MSXML解析器的工作机制:

 

clip_image002

 

3、Diagram of the basic elements and process flow of Extensible Stylesheet Language Transformations.

clip_image003

转载于:https://www.cnblogs.com/ghpaas/p/3832993.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值