paolo,
this one is strange. could you please post the complete stacktrace of
the error ? at which processing stage does it happen ? maybe you can
post your log too ?
regards, uli.
Paolo C. wrote:
Hi everybody,
I have here three samples, the first works, the second
does not and the third works again.
The only difference between form A and form B is the
line :
<xforms:bind id="bind_count_items"
xforms:nodeset="//count_items"
xforms:calculate="count(//items/item)" />
in Form A that becomes in form B :
<xforms:bind id="bind_count_items"
xforms:nodeset="//count_items"
xforms:calculate="count(//items/item[@type='b'])" />
Notice the bracketed predicate [@type='b']
I get this error message in case B :
""No pointer for xpath: @type ""
The only difference between form B and form C is th
line (from the instance data) :
<count_items/>
in Form B that becomes in form C :
<count_items type="anything_goes"/>
This time, everything works fine, so it seems that the
attribute is looked for on the nodeset of the bind
attribute too : isn'it confusing ?
Thank you in advance for your comments.
Paolo Crisafulli
---- Form A ---------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
xml:base="http://localhost:8080/chiba-dev/"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>Simple item list</title>
<xforms:model id="model_1">
<!-- Instance data -->
<xforms:instance id="instance_1">
<list>
<items>
<item type="a">item type
a</item>
<item type="b">item type
b</item>
</items>
<count_items/>
</list>
</xforms:instance>
<!-- Bindings -->
<xforms:bind id="bind_items"
xforms:nodeset="//items">
<xforms:bind id="bind_item"
xforms:nodeset="item"
/>
</xforms:bind>
<xforms:bind id="bind_count_items"
xforms:nodeset="//count_items"
xforms:calculate="count(//items/item)" />
<xforms:submission id="submission_0"
xforms:action="jsp/debug-instance.jsp"
xforms:method="post" />
</xforms:model>
</head>
<body>
<!-- Group -->
<xforms:group id="group_1" appearance="minimal">
<xforms:label id="label_2">Item list - **
<xforms:output bind="bind_count_items" /> **
item(s)</xforms:label>
<!-- Add one item -->
<xforms:trigger id="trigger_2">
<xforms:label id="C-17"
xlink:href="images/add_new.gif">Insert after
selected</xforms:label>
<xforms:action id="action_2">
<xforms:insert id="insert_1"
xforms:at="xforms:index('repeat_1')"
xforms:bind="bind_item" xforms:position="after" />
</xforms:action>
</xforms:trigger>
<!-- Delete one item -->
<xforms:trigger id="trigger_3">
<xforms:label id="C-19"
xlink:href="images/delete.gif">Delete
selected</xforms:label>
<xforms:action id="action_3">
<xforms:delete id="delete_1"
xforms:at="xforms:index('repeat_1')"
xforms:bind="bind_item" />
</xforms:action>
</xforms:trigger>
<!-- Item list -->
<xforms:repeat id="repeat_1"
xforms:bind="bind_item" appearance="full">
<!-- Input Nom -->
<xforms:input id="input_1"
xforms:bind="bind_item">
<xforms:label id="label_3">Item
name</xforms:label>
</xforms:input>
</xforms:repeat>
</xforms:group>
<xforms:submit id="submit_0"
xforms:submission="submission_0">
<xforms:label id="label_7">Submit</xforms:label>
</xforms:submit>
</body>
</html>
---- Form B ---------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
xml:base="http://localhost:8080/chiba-dev/"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>Simple item list</title>
<xforms:model id="model_1">
<!-- Instance data -->
<xforms:instance id="instance_1">
<list>
<items>
<item type="a">item type
a</item>
<item type="b">item type
b</item>
</items>
<count_items/>
</list>
</xforms:instance>
<!-- Bindings -->
<xforms:bind id="bind_items"
xforms:nodeset="//items">
<xforms:bind id="bind_item"
xforms:nodeset="item"
/>
</xforms:bind>
<xforms:bind id="bind_count_items"
xforms:nodeset="//count_items"
xforms:calculate="count(//items/item[@type='b'])" />
<xforms:submission id="submission_0"
xforms:action="jsp/debug-instance.jsp"
xforms:method="post" />
</xforms:model>
</head>
<body>
<!-- Group -->
<xforms:group id="group_1" appearance="minimal">
<xforms:label id="label_2">Item list - **
<xforms:output bind="bind_count_items" /> **
item(s)</xforms:label>
<!-- Add one item -->
<xforms:trigger id="trigger_2">
<xforms:label id="C-17"
xlink:href="images/add_new.gif">Insert after
selected</xforms:label>
<xforms:action id="action_2">
<xforms:insert id="insert_1"
xforms:at="xforms:index('repeat_1')"
xforms:bind="bind_item" xforms:position="after" />
</xforms:action>
</xforms:trigger>
<!-- Delete one item -->
<xforms:trigger id="trigger_3">
<xforms:label id="C-19"
xlink:href="images/delete.gif">Delete
selected</xforms:label>
<xforms:action id="action_3">
<xforms:delete id="delete_1"
xforms:at="xforms:index('repeat_1')"
xforms:bind="bind_item" />
</xforms:action>
</xforms:trigger>
<!-- Item list -->
<xforms:repeat id="repeat_1"
xforms:bind="bind_item" appearance="full">
<!-- Input Nom -->
<xforms:input id="input_1"
xforms:bind="bind_item">
<xforms:label id="label_3">Item
name</xforms:label>
</xforms:input>
</xforms:repeat>
</xforms:group>
<xforms:submit id="submit_0"
xforms:submission="submission_0">
<xforms:label id="label_7">Submit</xforms:label>
</xforms:submit>
</body>
</html>
---- Form C -----------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
xml:base="http://localhost:8080/chiba-dev/"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>Simple item list</title>
<xforms:model id="model_1">
<!-- Instance data -->
<xforms:instance id="instance_1">
<list>
<items>
<item type="a">item type
a</item>
<item type="b">item type
b</item>
</items>
<count_items type="anything_goes"/>
</list>
</xforms:instance>
<!-- Bindings -->
<xforms:bind id="bind_items"
xforms:nodeset="//items">
<xforms:bind id="bind_item"
xforms:nodeset="item"
/>
</xforms:bind>
<xforms:bind id="bind_count_items"
xforms:nodeset="//count_items"
xforms:calculate="count(//items/item[@type='b'])" />
<xforms:submission id="submission_0"
xforms:action="jsp/debug-instance.jsp"
xforms:method="post" />
</xforms:model>
</head>
<body>
<!-- Group -->
<xforms:group id="group_1" appearance="minimal">
<xforms:label id="label_2">Item list - **
<xforms:output bind="bind_count_items" /> **
item(s)</xforms:label>
<!-- Add one item -->
<xforms:trigger id="trigger_2">
<xforms:label id="C-17"
xlink:href="images/add_new.gif">Insert after
selected</xforms:label>
<xforms:action id="action_2">
<xforms:insert id="insert_1"
xforms:at="xforms:index('repeat_1')"
xforms:bind="bind_item" xforms:position="after" />
</xforms:action>
</xforms:trigger>
<!-- Delete one item -->
<xforms:trigger id="trigger_3">
<xforms:label id="C-19"
xlink:href="images/delete.gif">Delete
selected</xforms:label>
<xforms:action id="action_3">
<xforms:delete id="delete_1"
xforms:at="xforms:index('repeat_1')"
xforms:bind="bind_item" />
</xforms:action>
</xforms:trigger>
<!-- Item list -->
<xforms:repeat id="repeat_1"
xforms:bind="bind_item" appearance="full">
<!-- Input Nom -->
<xforms:input id="input_1"
xforms:bind="bind_item">
<xforms:label id="label_3">Item
name</xforms:label>
</xforms:input>
</xforms:repeat>
</xforms:group>
<xforms:submit id="submit_0"
xforms:submission="submission_0">
<xforms:label id="label_7">Submit</xforms:label>
</xforms:submit>
</body>
</html>
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
Chiba-developer mailing list
Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/chiba-developer
--
Ulrich Nicolas Lissé
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
|