Custom XSD model in form-builder

9 views
Skip to first unread message

Patxi Alba

unread,
May 21, 2020, 8:25:11 AM5/21/20
to Orbeon Forms
Hello,

The form builder can generate an instance based on uploaded XSD, which already has this XSD a data structure defined.

Is it possible to make the form builder work with the uploaded XSD model? Will it generate the XML with the target namespace and the structure provided by the XSD?

In various tests I have not been able to make it work with the complexTypes.

Greetings and thanks.


This is the XSD structure we use:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="www.xxx.com"
xmlns:tns="www.xxx.com"
elementFormDefault="qualified"
attributeFormDefault="unqualified" >

<!-- <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="www.yyy.com"/> -->

<!-- TIPUS SIMPLES -->
<xsd:simpleType name="StringNoBuit">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>

<!-- EL CONTINGUT CONCRET -->
<xsd:complexType name="Contingut">
<xsd:sequence>
<xsd:element name="nom" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="cognoms" type="tns:StringNoBuit" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="Document">
<xsd:sequence>
<xsd:element name="contingut" type="tns:Contingut" minOccurs="1" maxOccurs="1"/>
<!-- <xsd:element ref="ds:Signature" minOccurs="0"/> -->
</xsd:sequence>
</xsd:complexType>

<!-- Top-level element -->
<xsd:element name="document" type="tns:Document"/>

</xsd:schema>

Message has been deleted
Message has been deleted

Alessandro Vernet

unread,
May 21, 2020, 7:12:43 PM5/21/20
to orb...@googlegroups.com
Hi,

You can have Orbeon Forms generate a schema for a form you created in Form
Builder, but the structure of the XML document used to capture data is
strictly determined by the structure of your form in Form Builder. You can't
have a different structure, and "map" fields to elements in the XML
document. If you need a different structure, you'll want to do the mapping
from the XML document produced by Orbeon Forms to the XML document you need
in a service Orbeon Forms can call when users submit the form, this for
instance with XSLT.

And you'll let me know if you were looking for something different, or I
misunderstand your question.

https://doc.orbeon.com/form-runner/api/other-apis/xml-schema-generation

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

Patxi Alba

unread,
May 25, 2020, 5:26:47 AM5/25/20
to Orbeon Forms
Thank you if you have answered my question.

The target namespace cannot be modified either, right?

Alessandro Vernet

unread,
May 25, 2020, 2:29:26 PM5/25/20
to orb...@googlegroups.com
Correct, the elements in the produced document are always in no namespace.
Reply all
Reply to author
Forward
0 new messages