Expand my Community achievements bar.

Can I use Non-standard XSD Data Types in my XSD; if so how?

Avatar

Level 2

Please help if you can, this is a complex question, so bear with me.

Also note that I am in Livecycle 8.2 ES (not ES2 or higher).

I am working on creating XSD schemas to map to form objects.

I have created one master schema document that is wired into multiple forms, and I have one separate schema for reusable form objects, that I refer to as a "common node".

All of my individual form schemas are brought together in this one Master Schema via the use of include statements.

**************************************
EXAMPLE: This is like my Master Schema

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

<!--W3C Schema written by Benjamin P. Lyons - Twin Technologies July 2010-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" >

<xs:include schemaLocation="./commonElementsNode.xsd" />
<xs:include schemaLocation="./form1111.xsd" />
<xs:include schemaLocation="./form2222.xsd" />
<xs:include schemaLocation="./form3333.xsd" />


<xs:element name="form">
<xs:complexType>
  <xs:sequence>

   <xs:element ref="commonElementsNode" />
   <xs:element ref="form1111" />
   <xs:element ref="form2222" />
   <xs:element ref="form3333" />
     
  
  </xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>
**********************************************

This works fine.

I can load this up in Designer in the Data View and everything appears in the Data View hierarchy correctly, with "form" as the top node.

And as long as I use standard "xs:" data types - everything works great.  So if I go into LiveCycle Designer and I go to File --> Form Properties --> Preview --> Generate Preview Data and generate dummy XML data - it respects my XSD conventions.

Now here is where the problem arises:

In these schemas, I need to define the data types.

The client I am working for needs me to use their data types.

These data types are not standard xs: data types, like "xs:string" or "xs:date".

Rather, the data types are ones that have been defined in other schemas and reserved to a namespace.


For instance, rather than use xs:date I need to use something like:  "myns:DateType"

*************************************************
This "myns:DateType" is defined as:

<xs:complexType name="DateType">
  <xs:simpleContent>
   <xs:extension base="xs:date">
    <xs:attribute name="format" type="xs:string" use="optional">
     <xs:annotation>
      <xs:documentation xml:lang="en">
       <mydoc:Name>Date Format Text</mydoc:Name>
       <mydoc:Definition>The format of the date content</mydoc:Definition>
       <mydoc:PrimitiveType>string</mydoc:PrimitiveType>
      </xs:documentation>
     </xs:annotation>
    </xs:attribute>
   </xs:extension>
  </xs:simpleContent>
</xs:complexType>

****************************************************

Note that I have redacted this data type slightly and changed the namespace to protect the anonymity of my client, but we can assume that their data type is valid and currently in use with other systems.

It conforms to W3 standards.

Note also how this type is an enumeration of the base type "xs:date".

This is defined in a schema called something like "MyCoreTypes.xsd"

There is a namespace reservation in this file that looks something like this:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns:myns="http://clinetname.com/schemas/mycoretypes" >

So there is a name space reservation there.

In my aforementioned "Master Schema" file, I have an include statement that looks like this:

<xs:include namespace="http://clinetname.com/schemas/mycoretypes" schemaLocation="./MyCoreTypes.xsd" />

(let's assume that the schema is in the same folder, as the Master Schema, so we can use the "./" relative path.)

Now the problems is that in all my forms, where I have a myns:DateType (e.g.:  in form1111, a "Date of Birth" element that looks like this: <xs:element name="OwnerBirthDt" type="myns:DateType"/> ) the XSD is not respected when the XML dummy data is generated in LiveCycle Designer implying that the XSD's data types are not being recognized properly.

Has anyone had this problem before?

Is there a solution?

Is it even possible to use these kind of include or import references in LiveCycle to define a data type other that the standard "xs:" data types?

Please let me know - it would be greatly appreciated.

I am more than willing to clarify the question further if others are willing to help.

Thanks -

Ben Lyons

0 Replies