Expand my Community achievements bar.

What am I doing wrong with my form - XML schema producing inconsistent results

Avatar

Former Community Member

I have an interactive dynamic form built in LCD 8.2.  The idea is that users fill in the form to indicate any fields that they want to update on our directory.

We do not have the necessary plumbing to get it to feed directly to the directory so the workaround is that the form generates an XML file.  These files are then imported into Excel and then that file is submitted as a bulk update request.

I have a schema that I have embedded in the form using the Data Connection

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">


<xsd:element name="MySite">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="unbounded" name="general">
     <xsd:complexType>
      <xsd:all>
       <xsd:element minOccurs="0" maxOccurs="1" name="FullName" />
       <xsd:element minOccurs="0" maxOccurs="1" name="StaffNumber" />
       <xsd:element minOccurs="0" maxOccurs="1" name="JobTitle" />
       <xsd:element minOccurs="0" maxOccurs="1" name="Responsibilities" />
       <xsd:element minOccurs="0" maxOccurs="1" name="LineManager" />
       <xsd:element minOccurs="0" maxOccurs="1" name="LMStaffNumber" />
       <xsd:element minOccurs="0" maxOccurs="1" name="AltContact" />
       <xsd:element minOccurs="0" maxOccurs="1" name="AltSE" />
       <xsd:element minOccurs="0" maxOccurs="1" name="Unit" />
       <xsd:element minOccurs="0" maxOccurs="1" name="TelExt" />
       <xsd:element minOccurs="0" maxOccurs="1" name="WorkMobile" />
       <xsd:element minOccurs="0" maxOccurs="1" name="OutHoursTel" />
      </xsd:all>
     </xsd:complexType> 
    </xsd:element>
   </xsd:sequence>
  </xsd:complexType>
</xsd:element>
</xsd:schema>

I use this same schema in Excel and then generate a test file from my form and then import it.  All goes well.

I then try it again or get someone else to try it and it fails.  What am I doing wrong?  I thought that embedding the schema into the form would mean that it would become part of the form but I keep getting an error message saying it cannot find an XML map that corresponds to the data. 

4 Replies

Avatar

Former Community Member

Embedding the schema into the form is not doing anything but taking up space. Once you point the data connection to the schema yu are creating a structure that conforms to that schema...so that all dat acoming out of the form will follow that schema (whether it is there or not). Is the error coming when you load the form in Designer or when you are filling it out in Acrobat/Reader?

If you export the data out of the form and validate it against the schema does it conform?

Paul

Avatar

Former Community Member

Thanks for your reply.

The form is fine and no error messages are evident until I attempt to import an xml file into Excel.  The schema is very, very basic and no validation has been applied.

I've looked at the form today to investigate what the problem may be and have discovered three issues.

I tried with two different versions of the form to try and work out why one version worked and the other did not.  The only obvious difference between them was that one had been Reader Enabled and it was this form that did not work.

The non-enabled form produced this output:

<?xml version="1.0" encoding="UTF-8" ?>
- <MySite>
- <general>
<FullName>th</FullName>
</general>
</MySite>

The enabled form produced something different.

<?xml version="1.0" encoding="UTF-8" ?>

- <xfa:data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
- <MySite>
- <general>
<FullName>gt</FullName>
</general>
</MySite>
<MySite />
</xfa:data>

Files with this extra line of code would fail to be imported into the Excel file.

Another issue was that the Reader Enabled form had a completely different file path for the embedded schema.  In the non-enabled version the path pointed to the correct location on my personal drive.  The Reader Enabled version could not find the schema as the path was incorrect and was pointing to a folder on the temporary drive.  At no point had I manually amended this path to point to there!

The non-enabled form allowed me to import an xml file whereas the enabled form gave me an error message stating that:
"The document restricts some Acrobat features to allow for extended features in Adobe Reader.  To create a copy of the document that is not restricted (and has no extended features in Adobe Reader), click Save a Copy."

Are these expected behaviours or is there something wrong?

Avatar

Former Community Member

You are xprtinng teh data as xdp (an xml format that is used by the LiveCycle server). This is wrapping an extra set of nodes around your form (xfa:data). Change the submit button or your save data option to save as XML data and it will match your schema. You coudl also remove the xfa:data wrapper nodes to get to the same place if you wish.

Paul