webMethods

webMethods

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.  Urgent Problem: how to xquery this dependent schema.

    Posted Mon February 12, 2007 06:43 PM

    Hi,
    I don’t know how to access to any branch which uses other imported schema.
    I mean, when I try to access for example to the branch of this schema “rp210Elements:FrameworkTitle” It return an error.
    Can anybody help me?

    This is a small fragment of my schema:


    rp210Elements:FrameworkCodeEnglish </rp210Elements:FrameworkCode>
    rp210Elements:FrameworkTitleNijinski Production version1</rp210Elements:FrameworkTitle>
    rp210Elements:PrimaryExtEnglish</rp210Elements:PrimaryExt>

    I have tested these two possibilities and they don’t work:

        for $b in input()//rp210Elements:FrameworkTitle
    return $b
    
    for $b in input()//rp210Elements:FrameworkTitle
    return $b
    

    I will be very grateful if someone knows that because I’m stopped in my task.
    Regards,
    Diego


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: Urgent Problem: how to xquery this dependent schema.

    Posted Mon February 12, 2007 11:44 PM

    A little more information might help us answer your question. What did you expect to get? What do you mean by “don’t work”—did you get a result different from what you expected, or an error? If it was an error, what was the error message?

    Also, I expect this was a copy/paste error, but your “two possibilities” look identical to me.

    One other thing—in general, you should avoid ‘//’ in path expressions for performance reasons.


    #webMethods
    #API-Management
    #Tamino


  • 3.  RE: Urgent Problem: how to xquery this dependent schema.

    Posted Tue February 13, 2007 11:00 AM

    This is my involved schemas and the xml file test.
    To remember the question I want to access to any branch which uses
    other imported schema.
    So when I try to access for example to the branch of this schema
    “rp210Elements:FrameworkTitle” to get the element=“Nijinski Production
    version1” I can’t do it.

    This is a small fragment of my schema:


    rp210Elements:FrameworkCodeEnglish </rp210Elements:FrameworkCode>
    rp210Elements:FrameworkTitleNijinski Production
    version1</rp210Elements:FrameworkTitle>
    rp210Elements:PrimaryExtEnglish</rp210Elements:PrimaryExt>

    I have tested these two possibilities and they don’t work:

       for $b in input()//rp210Elements:FrameworkTitle
    return $b
    

    –>Do not return anything

       for $b in input()//FrameworkTitle
    return $b
    

    –>It return the error: “namespace prefix undefined”, “code: INOXQE6354”

    I also attached the xml file thet I try to query.
    NOTE:the schemas are correctly inserted on Tamino.

    Thanks for your help,
    Regards,
    Diego
    DVD.xml (165 KB)


    #webMethods
    #Tamino
    #API-Management


  • 4.  RE: Urgent Problem: how to xquery this dependent schema.

    Posted Tue February 13, 2007 12:44 PM

    Hi Diego,

    the XQuery cannot work, because you did not declare the namespace.
    Hint: there is a documentation for each error code (e.g. INOXQE6354) in the manual. In this case it reads:

    
    INOXQE6354  	Namespace prefix undefined
    Explanation 	
    
    The namespace declaration is missing.
    Action 	
    
    Include a namespace declaration in the XQuery prolog.

    There is also a section on XQuery Syntax in the manual.

    So you should change the query to something like

    
    declare namespace rp210Elements="urn:SMPTE:Dictionary" 
    for $b in input()//rp210Elements:FrameworkTitle 
    return $b 

    Regards

    Harald


    #webMethods
    #Tamino
    #API-Management


  • 5.  RE: Urgent Problem: how to xquery this dependent schema.

    Posted Tue February 13, 2007 06:34 PM

    Thanks a lot, it really works!!!
    My new problem is when I try to insert that query as Java code.
    It works with the Tamino XQuery tool. But I have now a new problem, cos that line that include a namespace declaration in the XQuery prolog gives me an error.

    In this case I got a result:
    query = “for $b in input()/DVD/Media return $b”
    TXQuery querysome = TXQuery.newInstance( query );

    But in this query return the ERROR INOXQE6352:
    “declare namespace rp210Elements=“urn:SMPTE:Dictionary” for $b in input()//rp210Elements:FrameworkTitle return $b”

    I don’t know how could I solve it.
    Can anyone help me? I will be very grateful for it.
    Regards,
    Diego


    #webMethods
    #Tamino
    #API-Management