commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaroslav Pullmann <jaroslav.pullm...@fit.fraunhofer.de>
Subject [SCXML] Retrieving a (wrapped) NodeSet for an XPath / user defined XPath functions
Date Tue, 20 Oct 2009 14:42:21 GMT

  Dear Rahul, dear all,

   the result value of an XPath-selection is limited to an XPathConstants.NODE
  as of XPathEvaluator#evalLocation(Context, String). Having a root element is
  reasonable for assignments etc. but I'd need to select a NodeSet based on the
  XPath predicates first (and then wrap it evt. into a result element).

  My use case resembles the form interpretation algorithm (FIA) of VXML: the
  <datamodel> of a state is updated continually by the payload of arriving events
  (inputs). There is an UI (form) which reflects the current datamodel and on each
  change the remaining "empty" <data> items should be selected and presented for
  completion:

<state id="collectInput">		
	<datamodel>
		<data id="statedata">...</data>
		<data id="empty"><my:empty xmlns:my="urn:myns"/></data>
	</datamodel>
			
		
	<transition event="submit">

		<!-- store input -->
		<assign expr="$_eventdata/data" location="$statedata/dataitem[@id = $_eventdata/data/@id]"/>

		<!-- test for remaining empty fields, wrap resulting NodeSet into "my:empty" element
 -->
		<assign expr="my:filter($statedata/item[. = ''],'my:empty')" location="$empty" />

		<myfn:updateGUI/>

	</transition>
	
	<transition cond="count($empty/my:empty) = 0" target="nextInputState" />

  </state>


  Although the XPathEvaluator accpets XPathFunctions as constructor arguments,
  there are no public accessors to the namespace and variable contexts. Could you
  please provide an exmaple how to accomplish access to a data NodeSet using an
  XPathFunction or an other way ?

   Many thanks !
     Jaro











-- 
Jaroslav Pullmann
Web Compliance Center - Fraunhofer FIT
Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
Phone: +49-2241-142623    Fax: +49-2241-142065

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message