Thanks for getting back to me, Habs:
So a short illustrative example attached. This form works fine in
exist-db, and I've declared tei in the html header (although clearly
there is nothing prefixed with 'tei'), all good. But as soon as I try
and apply the tei namespace to the listPerson instance (I've tried
adding it everywhere), the form fields no longer render (and don't
appear to be loaded at all). I've tried adding the tei prefix to the
instance, the form fields and both at the same time, but still not got
anywhere yet...
Any suggestions gratefully received!
Cheers
Ralph
On 05/12/2021 16:58, Habs wrote:
On Sun, 5 Dec 2021, Ralph Corrigan wrote:
Hi all, You were kind enough to help me earlier in the year when I was looking
at xsltforms for the first time, and things have moved a long way from
there. But I'm hitting a problem going back through the documents and
forms trying to make them conformant with TEI (not my choice, because
we're not actually encoding text, but anyway). These problems arose
early on, so I removed it and ran everything through the empty namespace
(xmlns="").
So target (e.g.) is:
<TEI xmlns=""> ....................
<listPerson/>
</TEU>
And the instance that populates it is:
<xf:instance id"XX">
<items xmlns="">
<listPerson/>
</items>
</xf:instance>.
On the form itself, the input fields all use the xf: prefix, so
<xf:input ref="instance('XX')/listPerson/person"> etc. An xquery POST
then inserts the instance data (using request:get-data()/*) into the
original xml document.
This all works absolutely fine and does everything I would expect it to.
However, if I change the namespace in the instance to <items
xmlns="http://www.tei-c.org/ns/1.0"> [1] the xf:input fields no longer
render. Try as I might, wherever I put the namespace declaration on the
form (and even if I add it to the xsltforms.xsl) the fields no longer
render. I have noticed that there is no reference to the TEI namespace
in the finally generated header, which I'#m guessing could be the
problem, but I've no idea how to get it there:
<html xmlns:xalan="http://xml.apache.org/xalan"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:ajx="http://www.ajaxforms.net/2006/ajx"
xmlns:txs="http://www.agencexml.com/txs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><!--HTML elements
generated by XSLTForms 1.5.5 (661) - Copyright (C) 2021 <agenceXML> -
Alain Couthures - http://www.agencexml.com-->.
I thought I'd be able to work around it by calling a src instance from
the main TEI namespace xml document, but this runs into the same
problem.
Any ideas about how I get round this (or do it properly in the first
place)!
If not sorted yet, please will you by reply, attach the smallest complete xform
and any instance(s) that are not working as you'd expect.
I'm not a 'namespace' guru, but namespaces I find can be quite testing.
Thank you
Habs
--- Sent using Alpine/Pine, probably the best MUA ---
My Tox Messaging Id:
9F10AC64260ADEBAEA017ACB71B7CD2E962596FC4293025C0F79D77FFEB4CE5C7B0BED41D925
Get a client here: https://tox.chat/clients.html
<?xml-stylesheet href="/db/apps/xsltforms/xsltforms.xsl" type="text/xsl"?><?xsltforms-options debug="yes"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title> New Person</title>
<xf:model>
<xf:instance id="template">
<items xmlns="">
<listPerson>
<person xml:id="Unique name" sex="">
<persName xml:lang="">
<forename>Forename</forename>
<surname>Surname</surname>
</persName>
</person>
</listPerson>
</items>
</xf:instance>
</xf:model>
</head>
<body>
<xf:group id="Key" ref="instance('template')/listPerson">
<h2>Person list</h2>
<h3>Person</h3>
<div class="row">
<xf:input ref="person/@xml:id">
<xf:label>Unique name</xf:label>
</xf:input>
</div>
<div class="row">
<h3>Name(s)</h3>
<xf:input ref="person/persName/forename">
<xf:label>Forename</xf:label>
</xf:input>
<xf:input ref="person/persName/surname">
<xf:label>Surname</xf:label>
</xf:input>
</div>
</xf:group>
</body>
</html>_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support