[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] XML documents get richer and richer the more XSLT rules that process it
- From: Dimitre Novatchev <dnovatchev@gmail.com>
- To: "Costello, Roger L." <costello@mitre.org>, xml-dev@lists.xml.org
- Date: Wed, 19 May 2010 05:43:34 -0700
So, this could be written as a (possibly endless) composition of a
function with itself -- so this is iteration.
The function is defined as simply applying the transformation on the
"current input". Then the result becomes the "current input" and the
same function (applying the transformation) is aggain applied, ...etc,
..., etc. up to reaching a specified condition, or ad infinitum.
This seems meaningful for both cases -- reaching a condition or
continuing ad infinitum. The endless iteration can be regarded as
constant obtaining/refining of the "closure" of the initial input with
the transformation as the "operation".
The ad infinitum case is not meaningless -- there might be some value
in obtaining/maintaining a more and more "refined" result or just in
continuing the process (if due to some reasons it is vitally important
we shouldn't stop).
Cheers,
Dimitre.
On Tue, May 18, 2010 at 10:07 PM, Dimitre Novatchev
<dnovatchev@gmail.com> wrote:
> It seems you are discovering functional composition.
>
>
> Cheers,
> Dimitre
>
>
> On Tue, May 18, 2010 at 4:15 PM, Costello, Roger L. <costello@mitre.org> wrote:
>> Olivier Rossel wrote:
>>
>>> rules can add data to the working memory, and these data will
>>> trigger other rules that add other data to the working memory,
>>> and so on.
>>
>> Fascinating!
>>
>> I decided to create an example to illustrate this. Would someone be willing to create an XSLT implementation?
>>
>> This is the input document to an XSLT program:
>>
>> <Gun>
>> <serial>ABCD</serial>
>> </Gun>
>>
>> The XSLT program contains a rule for the Gun serial element. The rule fires. The rule maps serial numbers to person names. Thus, the rule adds person information to the XML document. After the rule finishes, this is the XML document:
>>
>> <GunLicense>
>> <registeredGun>
>> <Gun>
>> <serial>ABCD</serial>
>> </Gun>
>> </registeredGun>
>> <holder>
>> <Person>
>> <name>Fred Blogs</name>
>> </Person>
>> </holder>
>> </GunLicense>
>>
>> The XSLT program contains a rule for the Person name element. The rule fires. The rule maps names to drivers license numbers. The rule adds drivers license information to the XML document. After the rule finishes, this is the XML document:
>>
>> <GunLicense>
>> <registeredGun>
>> <Gun>
>> <serial>ABCD</serial>
>> </Gun>
>> </registeredGun>
>> <holder>
>> <Person>
>> <name>Fred Blogs</name>
>> <driversLicenseNumber>ZXYZXY</driversLicenseNumber>
>> </Person>
>> </holder>
>> </GunLicense>
>>
>> The XSLT program contains a rule for the driversLicenseNumber element. The rule has information about a speeder that the police just pulled over, and a recent robbery where the robber dropped the gun. The driver's license and Gun serial number match the values in the XML document. The rule knows that only one gun can have any given serial number, and only one person can have any given driver's license number, so the rule outputs this as the result XML document:
>>
>> <Alert>
>> The speeder is the person who committed the recent robbery!
>> </Alert>
>>
>> Recap: the initial XML input into the XSLT program is small. A rule for the Gun serial element fires and adds Person data to the XML input document. This causes a rule for the Person name element to fire, which adds driver's license data to the XML input document. This causes a rule for driver's license element to fire, which recognizes that the speeder is the robber; the rule outputs an XML document that alerts the police about the person he has pulled over.
>>
>> The XSLT rules add data to the XML input document! The XML document gets richer and richer the more rules that process it!
>>
>> Would someone be willing to write an XSLT program that implements this?
>>
>> Thanks Olivier!
>>
>> /Roger
>>
>>
>> _______________________________________________________________________
>>
>> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
>> to support XML implementation and development. To minimize
>> spam in the archives, you must subscribe before posting.
>>
>> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
>> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
>> subscribe: xml-dev-subscribe@lists.xml.org
>> List archive: http://lists.xml.org/archives/xml-dev/
>> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>>
>>
>
>
>
> --
> Cheers,
> Dimitre Novatchev
> ---------------------------------------
> Truly great madness cannot be achieved without significant intelligence.
> ---------------------------------------
> To invent, you need a good imagination and a pile of junk
> -------------------------------------
> Never fight an inanimate object
> -------------------------------------
> You've achieved success in your field when you don't know whether what
> you're doing is work or play
> -------------------------------------
> I enjoy the massacre of ads. This sentence will slaughter ads without
> a messy bloodbath.
>
--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
I enjoy the massacre of ads. This sentence will slaughter ads without
a messy bloodbath.
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]