[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [wsbpel] Issue - 157 - Proposal For Vote
Hi all, Yuzo, thank you for the sample example also. [A] Nature of XSLT The same old reminder to people: XSLT and XQuery are used to create NEW documents or XML fragments based on an existing piece of XML data. Quotation--1: from the Introduction of XSLT 1.0 Spec: -------------------------------------- A transformation expressed in XSLT describes rules for transforming a source tree into a result tree. The transformation is achieved by associating patterns with templates. A pattern is matched against elements in the source tree. A template is instantiated to create part of the result tree. The result tree is separate from the source tree. The structure of the result tree can be completely different from the structure of the source tree. ... ... A template is instantiated for a particular source element to create part of the result tree. A template can contain elements that specify literal result element structure. A template can also contain elements from the XSLT namespace that are instructions for creating result tree fragments. When a template is instantiated, each instruction is executed and replaced by the result tree fragment that it creates. -------------------------------------- [Note: "replace" here does NOT mean replace the source-tree. It means: replace the instructions in the template with execution result. Think of any web-page-template engine. e.g.: ASP, JSP, PHP.] Typically, an XSLT has a default "catch-all-else" copy rule similar to below to do a copy any nodes from source tree to result tree without any transformation: ----------------------------- <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>----------------------------- Quotation--2: [ http://www.w3.org/TR/xslt#copying ] ------------------------------- The xsl:copy element provides an easy way of copying the current node. Instantiating the xsl:copy element creates a copy of the current node. ------------------------------- If the result tree was NOT a distinct copy from the source tree, the above <xsl:copy> would not be needed. In fact, if the above "catch-all-else" copy rule are NOT used in XSLT, most of nodes (if not all) in the source tree will NOT be present in / copied to the result tree. I hope the above quotations are good enough to prove that XSLT creates NEW documents but NOT replacing any existing docs. If not, we just need to cross reference to our W3C rep in XPath, XSLT, and XQuery WG - TRIO in W3C. Furthermore, XSLT is a non-procedural language. If executation of XSLT were allowed to modify any source or existing XML Document, its semantics can be extremely difficult to be defined. E.g. Will rules in XSLT be re-fired, if the source document got changed? (very hairy business there. Will it result in infinite loop?) In short, XSLT is used to create new documents. When the base document is large and delta is small, the runtime efficiencies of such an XSLT will be inheritly low. [B] How to apply XSLT in BPEL Yuzo's example illustrates one of the possible ways to interprete Assaf's original suggestion to apply XSLT in BPEL [i.e. (1b) below]. (1) Using XSLT to transform a variable or a variable part: (1a) Refering to a variable or a variable part as the source document:(2) Still using 100% of current <assign>/<copy> syntax. E.g.: KEY POINTS to analysis about XSLT facilities:
--------------------------------
[Side note: Between (1a) and (1b), I prefer (1a), because I am afraid that we would go through another issue 103 exercise, even though we may be able to reuse a number of definitions from Issue 103. ] [C] Summary Main goals for Issue 157:
Thank you for reading such a long email! Regards, Alex Yiu Satish Thatte wrote: Yuzo, Thanks for the example. I will study it. It seems to me that you have used XPath variable binding in the template, which assumes that our current Xpath variable binding mechanism would carry over without additional work. Is that your understanding? Satish ________________________________ From: Yuzo Fujishima [mailto:fujishima@bc.jp.nec.com] Sent: Sat 6/4/2005 8:11 AM To: Satish Thatte; wsbpeltc Cc: Assaf Arkin; Danny van der Rijn; Charlton Barreto Subject: Re: [wsbpel] Issue - 157 - Proposal For Vote I don't quite see what are the problems. I've written an example and attached the files used. (Apply assign.xsl to var1.xml. Then you'll get newVar1.xml.) Suppose we want to assign from var2 and var3 to var1. In that case, we write something similar to assign.xsl (excluding the variable binding part) within an assign activity. Perhaps we should rename the activity to "transform". The activity should look like below: <transform variable="var1"> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="orderNumber"> <xsl:element name="orderNumber"> <xsl:value-of select="$var2/purchaseOrder/orderNumber"/> </xsl:element> </xsl:template> <xsl:template match="billingAddress"> <xsl:element name="billingAddress"> <xsl:copy-of select="$var3/customers/customer[ @id=$var2/purchaseOrder/buyerId]/address/*"/> </xsl:element> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> </transform> Those parts of var1 that need not be modified are copied by <xsl:template match="@*|node()"> template. Pretty simple and idiomatic. I noticed that the use of XSLT may sometimes result in more efficient (rather than inefficient) processing because multiple assigns can be bunched together to form one transformation. How do you like above? Yuzo Fujishima NEC Corporation Satish Thatte wrote:Alex has pointed out various technical difficulties he sees with using XSLT to resolve 157, privately to some of us at the F2F. The principal one being that XSLT templates costruct new XML documents rather than update existing ones. According to Alex, doing anything else requires non-standard usage of XSLT. I am no XSLT expert so I am looking for confirmation or otherwise of Alex's position. If he is right then we are stuck with doing 157 as far as I can see. I would much prefer not to add features to BPEL for any XML data manipulation, but we have assignment/copy today and we have voted not to remove them so the only other option is to find a way to use some existing XML data manipulation spec as normative with the usual extensibility. XPath is what we have used in copy but that seems to require the sort of xII rules that the current 157 proposals specify. If someone has a simpler way to resolve this I am all ears. Satish ________________________________ From: Assaf Arkin [mailto:arkin@intalio.com] Sent: Fri 6/3/2005 9:28 AM To: Danny van der Rijn Cc: Satish Thatte; Charlton Barreto; wsbpeltc Subject: Re: [wsbpel] Issue - 157 - Proposal For Vote I wouldn't rule out that we closed issue 48 because the scope was a bit more generic, and from the issue list, apparently because 13 solves the problem. So given issue 13 you can incorporate XSLT into BPEL as a proprietary extension. The problem we're facing is how to handle simple assignments as a normalized part of the spec, which 48/13 do not cover. I, for one, am not interested in re-inventing the wheel, so in this particular context I have no problem revisiting issue 48 or resolving this as part of issue 157, whichever is more convenient. Assaf Danny van der Rijn wrote:What you're proposing, Satish, sounds like Issue 48, which was rejected in April of 2004. I'd be happy to revisit it, but I'm not sure how others feel. Danny Satish Thatte wrote:Wonderful. I didn't see this mail before sending mine. +1 ________________________________ From: Charlton Barreto [mailto:cbarreto@adobe.com] Sent: Thu 6/2/2005 9:29 AM To: Assaf Arkin Cc: wsbpeltc Subject: Re: [wsbpel] Issue - 157 - Proposal For Vote I second this proposal. I feel that we should delegate the problem scoped by issue 157 by leveraging another spec which is actually focussed on it, rather than attempting to invest the considerable amount of time and energy necessary to address it in BPEL. On 01/06/2005, at 16:08, Assaf Arkin wrote: I want to propose an alternative way to solve issue 157, without introducing significant complexity to the language. The XSLT specification has been dealing with the exact same problem of evaluating an expression and placing the results in a target context. XSLT provides two separate mechanisms: copy-of and value-of. I would propose using these two XSLT elements as a normative part of the BPEL specification, instead of inventing yet another copy mechanism. http://www.w3.org/TR/xslt#copy-of http://www.w3.org/TR/xslt#value-of Assaf || <arkin.vcf> Charlton Barreto P 1.408.536.4496 cbarreto@adobe.com www.adobe.com <http://www.adobe.com/> logo.gif --------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. You may a link to this group and all your TCs in OASIS at: https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php--------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. You may a link to this group and all your TCs in OASIS at: https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php--------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. You may a link to this group and all your TCs in OASIS at: https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]