I restarted from a BaseX-supplied example, here-attached, which works as
expected.
It uses a <bind nodeset="..." /> definition.
Considering nodeset as deprecated in XF2.0 , I changed it to ref, then the
demo fails ! (in a bizarre way).
This asks 2 questions:
- What is the XF version supported by XsltForms: 1.1 + some 2.0?
- Can you reproduce this behaviour (in a non-BaseX system)?
TIA,
Best regards,
Robert.
On Thu, May 2, 2019 at 9:55 AM Steven Pemberton <[email protected]>
wrote:
> If I were you I would comment parts out, and try to locate what is causing
> the problem.
>
> Steven
>
>
> On Wed, 01 May 2019 17:40:49 +0200, Robert Kirkpatrick <[email protected]>
> wrote:
>
> Additional point:
> My test relies on a BaseX http server, as you can see from the xsltforms
> url (port 8984).
> This should not make a difference, but well a variation with the tests you
> made.
> Regards,
> Robert.
>
> On Wed, May 1, 2019 at 2:58 PM Robert Kirkpatrick <[email protected]>
> wrote:
>
>> Very strange.
>> I'm using Chrome Version 73.0.3683.103
>>
>> On Wed, May 1, 2019 at 12:58 PM Steven Pemberton <[email protected]>
>> wrote:
>>
>>> On Tue, 30 Apr 2019 19:29:39 +0200, Robert Kirkpatrick <
>>> [email protected]> wrote:
>>>
>>> Thank you Steven.
>>>
>>> Indeed type errors show up clearly. But in my example, the displayed
>>> values were not typed in via the form, but defined in the <instance/> as
>>> default values: ? for item, 0 for amount.
>>> And very weirdly, they are output *concatenated* in *both* form fields
>>> !!
>>> An X error flag indicates a problem, not surprising, but totally blind..
>>> !?
>>>
>>>
>>> I ran your test in 4 different browsers, and didn't get this problem.
>>>
>>> Steven
>>>
>>>
>>>
>>> Robert.
>>>
>>> On Tue, Apr 30, 2019 at 2:14 PM Steven Pemberton <
>>> [email protected]> wrote:
>>>
>>>> On Tue, 30 Apr 2019 11:35:47 +0200, Robert Kirkpatrick <
>>>> [email protected]> wrote:
>>>>
>>>> (Newcomer first post)
>>>>
>>>> Hello,
>>>>
>>>> Here is a basic Xform:
>>>> [image: image.png]
>>>>
>>>> When I hover over the error flags, I only get a little question mark.
>>>> What can I do to display the error associated with the event, which I
>>>> can't identify?
>>>>
>>>> As far as I recall, you only get the red X if the value doesn't match
>>>> the node's type or constraints.
>>>>
>>>> I don't understand why you are getting an X for Item, because that's a
>>>> string; amount is an integer, and ?0 is not a valid integer value, so
>>>> that's why you are getting it there.
>>>>
>>>> To get a message to show, you need to include an <alert/> element in
>>>> the input; for instance
>>>>
>>>> <xf:label>Amount:</xf:label><xf:alert>Must be an integer</xf:alert>
>>>>
>>>>
>>>> There must be some binding mistake in the form, here attached, but the
>>>> messages associated with xforms-binding-error are not displayed.
>>>>
>>>> The bindings are fine. If there were a binding error, the control would
>>>> not show up.
>>>>
>>>> Hope this helps somewhat.
>>>>
>>>> Steven
>>>>
>>>>
>>>> Thanks for any help,
>>>> Robert.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>
>
>
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://localhost:8984/static/xsltforms/xsltforms.xsl" type="text/xsl"?>
<?css-conversion no?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title>BaseX XForms Demo</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<!-- XForms data models -->
<xf:model>
<xf:instance>
<track xmlns="">
<metadata>
<title>Like A Rolling Stone</title>
<artist>Bob Dylan</artist>
<date>1965-06-21</date>
<genre>Folk</genre>
</metadata>
</track>
</xf:instance>
<xf:bind id="_date" ref="//date" type="xs:date" />
</xf:model>
</head>
<body>
<div class="right">
<img src="basex.svg" width="96" />
</div>
<h2>BaseX XForms Demo</h2>
<ul>
<li> In this example, the XForms model is defined in the
<code>head</code> section of the XML document.</li>
<li> The XForms model consists of an <b>instance</b> and a <b>binding</b>.</li>
<li> The instance contains the data, and the binding specifies the type
of elements (in this case the <code>date</code> element).</li>
</ul>
<h3>XForm Widgets <small> – coupled to and synchronized with XML Data Model</small></h3>
<ul>
<li> Whenever you modify data in the edit components, the XML data model will
be updated, and all other output and input components will reflect the changes.</li>
<li> XForms also cares about type conversion: as the <code>date</code>
element is of type <code>xs:date</code>: a date picker is offered.</li>
</ul>
<div>Below, three different views on the XForms model are supplied. Please open the source
view of this HTML document to see how the input and output fields are specified.</div>
<table width="100%">
<tr>
<td width="30%">
<h4>Input Form</h4>
<table>
<tr>
<td>Title:</td>
<td>
<xf:input class="input-medium" ref="/track/metadata/title" incremental="true" />
</td>
</tr>
<tr>
<td>Artist:</td>
<td>
<xf:input class="input-medium" ref="//artist" incremental="true" />
</td>
</tr>
<tr>
<td>Date:</td>
<td>
<xf:input bind="_date" />
</td>
</tr>
<tr>
<td>Genre:</td>
<td>
<xf:select1 ref="//genre" appearance="minimal" incremental="true">
<xf:item>
<xf:label>Classic Rock</xf:label>
<xf:value>Classic Rock</xf:value>
</xf:item>
<xf:item>
<xf:label>Folk</xf:label>
<xf:value>Folk</xf:value>
</xf:item>
<xf:item>
<xf:label>Metal</xf:label>
<xf:value>Metal</xf:value>
</xf:item>
<xf:item>
<xf:label>Gospel</xf:label>
<xf:value>Gospel</xf:value>
</xf:item>
<xf:item>
<xf:label>Instrumental</xf:label>
<xf:value>Instrumental</xf:value>
</xf:item>
<xf:item>
<xf:label>Soul</xf:label>
<xf:value>Soul</xf:value>
</xf:item>
<xf:item>
<xf:label>Pop</xf:label>
<xf:value>Pop</xf:value>
</xf:item>
</xf:select1>
</td>
</tr>
</table>
</td>
<td width="30%">
<h4>Output Form</h4>
<table>
<tr>
<td>Artist:</td>
<td>
<xf:output ref="//artist" />
</td>
</tr>
<tr>
<td>Title:</td>
<td>
<xf:output ref="//title" />
</td>
</tr>
<tr>
<td>Date:</td>
<td>
<xf:output ref="//date" />
</td>
</tr>
<tr>
<td>Genre:</td>
<td>
<xf:output ref="//genre" />
</td>
</tr>
</table>
</td>
<td width="40%">
<h4>XML Data Model</h4>
<pre>
<xf:output value="serialize(., 'yes')" />
</pre>
</td>
</tr>
</table>
</body>
</html>_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support