RE: New XML and XPath built-ins for CWM

Tim,
    My question was about computed 'resources' (as opposed to computed
properties). My early implementation of XPath built-ins is at: 

http://www.xrules.org/cwm/default.aspx


    This implementation is limited because I couldn't find support for
computed resources in CWM. To explain the need for computed resources,
see this example:

("<Order><Item>Book</Item><Item>Pen</Item></Order>" "/Order/Item")
xpath:selectSingleNode :node .


    The problem with this is that each time I use the property I have to
pass the whole XML document as a string and have it parsed. This is,
obviously, not practical for big XML documents. It would be great if I
can load and parse the XML document once, and then from that point
forward, treat it as a resource (object) inside CWM. My code will, then,
look like this:


"<Order>...</Order>"	x:parseAsXmlDocument		:xml .

(:xml "/Order/Item")	xpath:selectSingleNode 		:node .


where, :xml is of type x:XmlDocument and :node is of type x:XmlNode.


    So, :xml is treated as a resource in CWM, yet a reference to an
external implementation (a DOM in this case) is available that can be
used by properties such as xpath:selectSingleNode to execute XPath
expressions. 

    There might be support for this in CWM already, but I couldn't find
it!!

Regards,
Waleed



-----Original Message-----
From: public-cwm-talk-request@w3.org
[mailto:public-cwm-talk-request@w3.org] On Behalf Of Tim Berners-Lee
Sent: Thursday, March 09, 2006 11:40 AM
To: Waleed Abdulla
Cc: cwm; Dan Connolly
Subject: Re: New XML and XPath built-ins for CWM


Waleed,

Juts came across your question a year ago asking about cwm built-ins.

Yes, cwm does support computed properties.

Did you get anywhere with making XPath builtins and XML dom data types?

Tim BL

Received on Friday, 10 March 2006 20:07:26 UTC