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.


#TechXchangePresenter
 View Only
Expand all | Collapse all

XQuery Updates giving an error

  • 1.  XQuery Updates giving an error

    Posted Thu March 30, 2006 12:44 PM

    Hi,
    I am trying to create an update xquery to change a record with a certain id, but it keeps giving me an error. I’ve search on the net, but I can’t find what it means. I think its something to do with the schema

    The query is

    
    {-- Enter a PEA ID below--}
    update let $peaID := '1217'
    {-- RUN QUERY --}
    do replace input()/pea[id = $peaID][currentStatus/status = 'raised']/currentStatus/status/text() with 'inPreperation'

    Which is giving me the following error

    
    (cvc-enumeration-valid) A value not defined in the respective enumeration has been found during validation; datatype validation for element 'status' of type xs:string failed

    The schema is just a simple type like so:

          <xs:complexType mixed="false" name="peaCurrentStatusType">
    <xs:sequence maxOccurs="1" minOccurs="1">
    [b]            <xs:element maxOccurs="1" minOccurs="1" name="status" type="peaStatusType"/>[/b]
    <xs:element maxOccurs="1" minOccurs="1" name="lastChangeDate" type="xs:dateTime"/>
    </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="peaStatusType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="inPreparation"/>
    <xs:enumeration value="raised"/>
    <xs:enumeration value="approved"/>
    <xs:enumeration value="completed"/>
    <xs:enumeration value="denied"/>
    <xs:enumeration value="canceled"/>
    <xs:enumeration value="withdrawn"/>
    <xs:enumeration value="deniedWithConditions"/>
    </xs:restriction>
    </xs:simpleType>

    Any Ideas why this isn’t working would be very much appreciated :smiley:


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: XQuery Updates giving an error

    Posted Thu March 30, 2006 12:50 PM

    Hi Ryan,
    I think you have met your typo
    inPreparation or inPreperation ?

    Finn


    #webMethods
    #API-Management
    #Tamino


  • 3.  RE: XQuery Updates giving an error

    Posted Fri March 31, 2006 04:26 PM

    Thanks, can’t believe I didn’t spot that


    #API-Management
    #Tamino
    #webMethods