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.  define attribute witn namespace and no targetnamespace

    Posted Tue June 26, 2007 10:36 AM

    Hi,

    I want to define a tsd which contains an attribute on the root element. This attribute needs to have a namespace, but the tsd document does not contain a target namespace.

    the xml doc that uses this tsd looks like

    Any clues?


    #API-Management
    #webMethods
    #Tamino


  • 2.  RE: define attribute witn namespace and no targetnamespace

    Posted Thu June 28, 2007 05:20 PM

    define a tsd with just the attribute and the corresponding namespace.
    Then define a tsd with no target namespace and import the attribute’s schema. Add the attribute to the element and you are done

    regards

    Harald


    #Tamino
    #webMethods
    #API-Management


  • 3.  RE: define attribute witn namespace and no targetnamespace

    Posted Tue August 14, 2007 01:33 PM

    Hi,

    I’ve created the following tsd’s (see attachments) where the id.tsd conaints the attribute I want to index. The id.tsd is imported in the type-tech-rdc.tsd (renamed to .xml so they could be attached)

    Next I run explain this query in Xquery tool:
    declare namespace imp=“http://nsp.rdc.nl/tamino/import/1.0”;
    for $a in input()/TYPE-TECH-ABON[not(@imp:id = input()/typekeuring-export/feed/@srcref)]
    return $a

    The explain states the following:
    This query compiles successfully.
    This query will retrieve all documents from the doctype ETG-CVO/TYPE-TECH-ABON.
    This query will perform an index scan (details unknown).

    the srcref attribute is also indexed and that seems to be ok. But I’m wondering if the imp:id index is being used, since the query takes a very long time on a database with 600 - 700 small (usually round 500Kb - 1 Mb) documents in it.

    Any help would be great!

    Thanks,

    Danny
    type-tech-rdc.xml (1.56 KB)
    id.xml (1.24 KB)


    #API-Management
    #webMethods
    #Tamino


  • 4.  RE: define attribute witn namespace and no targetnamespace

    Posted Tue August 14, 2007 02:21 PM

    Hi Danny

    Does it make any difference if you construct the xquery like this ?
    declare namespace imp=“http://nsp.rdc.nl/tamino/import/1.0”;
    let $a :=input()/typekeuring-export/feed/@srcref
    for $b in input()/TYPE-TECH-ABON
    where not(@imp:id = $a)
    return $b

    Finn


    #Tamino
    #webMethods
    #API-Management


  • 5.  RE: define attribute witn namespace and no targetnamespace

    Posted Tue August 14, 2007 02:23 PM

    UPS I forgot the $b ref…

    declare namespace imp=“http://nsp.rdc.nl/tamino/import/1.0”;
    let $a :=input()/typekeuring-export/feed/@srcref
    for $b in input()/TYPE-TECH-ABON
    where not($b/@imp:id = $a)
    return $b


    #API-Management
    #webMethods
    #Tamino


  • 6.  RE: define attribute witn namespace and no targetnamespace

    Posted Tue August 14, 2007 02:33 PM

    Great!

    I’ve tested it and this is what the explain function says:

    This query compiles successfully.
    This query will perform an index scan (details unknown).
    This query will perform an index scan (details unknown).

    The analyzed query:
    {?explain?}
    declare namespace imp=“http://nsp.rdc.nl/tamino/import/1.0”;
    let $a :=input()/typekeuring-export/feed/@srcref
    for $b in input()/TYPE-TECH-ABON where not($b/@imp:id = $a)
    return $b

    The query takes about 5 secs now instead of 10 mins!

    Thanks for your help Finn!

    (Although doing the query your way means changing some software that actually does the query).


    #webMethods
    #Tamino
    #API-Management