IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  xs:Key is working on Tamino 4.4?

    Posted Wed December 14, 2005 09:51 PM

    All,

    I’m working with Tamino 4.4 and I want to set a constrain using xs:key. I know that Tamino 4.4 schema supports xs:key, but I’m not sure if the feature is working.

    I made the following simple schema with a constrain xs:key, the problem is that I can insert several times the Person document with the same ID, it supposes that the ID should be unique due to it was declared as the key elemet.

    Also I would like to use keyRef for integrity but I want to solve this first issue.

    Is something wrong in my shema? or is not xs:key constrain supported by Tamino?

    Does Tamino 4.4 manage the ref integrity whit xs:key and xs:keyRef?

    Here is the Schema code:

    <?xml version = "1.0" encoding = "UTF-8"?>
    <xs:schema xmlns:tsd = "http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition" xmlns:xs = "http://www.w3.org/2001/XMLSchema">
    <xs:annotation>
    <xs:appinfo>
    <tsd:schemaInfo name = "test">
    <tsd:collection name = "test"></tsd:collection>
    <tsd:doctype name = "Person">
    <tsd:logical>
    <tsd:content>closed</tsd:content>
    </tsd:logical>
    </tsd:doctype>
    </tsd:schemaInfo>
    </xs:appinfo>
    </xs:annotation>
    <xs:element name = "Person">
    <xs:complexType>
    <xs:sequence>
    <xs:element name = "ID" type = "xs:string"></xs:element>
    <xs:element name = "Name" type = "xs:string"></xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:key name = "Person_key">
    <xs:selector xpath = "Person"></xs:selector>
    <xs:field xpath = "ID"></xs:field>
    </xs:key>
    </xs:element>
    </xs:schema>

    Thanks in advance,


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: xs:Key is working on Tamino 4.4?

    Posted Thu December 15, 2005 07:29 AM

    Claudio,

    the xs:key is working as specified: it guarantees uniqueness WITHIN A SINGLE document. What you expect, is uniqueness AMONG SEVERAL documents. There is no standard feature in XML Schema to express this. However, there is a Tamino feature providing exactly this functionality: tsd:unique (please use the documentation search to find out the details)

    Regards

    Harald


    #Tamino
    #API-Management
    #webMethods


  • 3.  RE: xs:Key is working on Tamino 4.4?

    Posted Thu December 15, 2005 08:36 AM

    Hi Claudio

    in addition to Harald’s remark, you should correct the value of the xpath attribute of xs:selector to be “.” (for tsd:unique this is the built-in default):

    <xs:element name = “Person”>
    xs:complexType
    xs:sequence
    <xs:element name = “ID” type = “xs:string”></xs:element>
    <xs:element name = “Name” type = “xs:string”></xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:key name = “Person_key”>
    <xs:selector xpath = “.”></xs:selector>
    <xs:field xpath = “ID”></xs:field>
    </xs:key>
    </xs:element>

    Regards
    Uli


    #webMethods
    #Tamino
    #API-Management


  • 4.  RE: xs:Key is working on Tamino 4.4?

    Posted Thu December 15, 2005 01:37 PM

    Hi,

    Thanks Harald and Uli for your answers.

    About the Harald’s question… I’m expected unique values of a specific element among several documents and I think that xs:keyRef also works within a single document, isn’t it?

    Regards,

    Claudio


    #Tamino
    #webMethods
    #API-Management


  • 5.  RE: xs:Key is working on Tamino 4.4?

    Posted Thu December 15, 2005 05:09 PM

    Hi Claudio

    indeed - xs:keyRef has only a scope of a single document.
    So far, Tamino does not support an analogon to xs:keyRef having
    a scope of all documents in a doctype.

    Regards
    Uli


    #webMethods
    #API-Management
    #Tamino