Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:04:34+00:00 2026-06-09T14:04:34+00:00

I used a tool to map this xquery but need to understand what the

  • 0

I used a tool to map this xquery but need to understand what the tool did behind the scenes to avoid myself being a slave to the tool

(:: pragma bea:global-element-parameter parameter="$retrieveCustomerByCriteriaResponse1" element="ns0:RetrieveCustomerByCriteriaResponse" location="../wsdl/CustomerService.wsdl" ::)
(:: pragma bea:global-element-return element="ns3:FindCustomerResponse" location="../wsdl/CustomerManagement.wsdl" ::)

declare namespace ns2 = "http://www.somecorp.com/customer";
declare namespace ns1 = "http://www.somecorp.com/creditcard";
declare namespace ns3 = "http://www.somecorp.org/CustomerManagement";
declare namespace ns0 = "http://www.crm.org/CustomerService/";
declare namespace xf = "http://tempuri.org/basic-osb-service/transformation/TransformFindCustomerResponse/";

declare function xf:TransformFindCustomerResponse(**$retrieveCustomerByCriteriaResponse1 as element(ns0:RetrieveCustomerByCriteriaResponse**))
    as element(ns3:FindCustomerResponse) {
        <ns3:FindCustomerResponse>
            <Customer>
                <ns2:ID>{ xs:long($retrieveCustomerByCriteriaResponse1/customers/id) }</ns2:ID>
                <ns2:FirstName>{ data($retrieveCustomerByCriteriaResponse1/customers/firstname) }</ns2:FirstName>
                <ns2:LastName>{ data($retrieveCustomerByCriteriaResponse1/customers/lastname) }</ns2:LastName>
                <ns2:EmailAddress>{ data($retrieveCustomerByCriteriaResponse1/customers/emailAddress) }</ns2:EmailAddress>
                <ns2:Addresses>
                    {
                        let $address := $retrieveCustomerByCriteriaResponse1/customers/address
                        return
                            <ns2:Address>
                                <ns2:Street>{ data($address/street) }</ns2:Street>
                                <ns2:PostalCode>{ data($address/zipcode) }</ns2:PostalCode>
                                <ns2:City>{ data($address/city) }</ns2:City>
                            </ns2:Address>
                    }
                </ns2:Addresses>
                <ns2:Rating>{ data($retrieveCustomerByCriteriaResponse1/customers/rating) }</ns2:Rating>
                <ns2:Gender>{ data($retrieveCustomerByCriteriaResponse1/customers/gender) }</ns2:Gender>
            </Customer>
        </ns3:FindCustomerResponse>
};

declare variable $retrieveCustomerByCriteriaResponse1 as element(ns0:RetrieveCustomerByCriteriaResponse) external;

xf:TransformFindCustomerResponse($retrieveCustomerByCriteriaResponse1)

Can someone please explain what this code does?
What is the input parameter to this function ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:04:35+00:00Added an answer on June 9, 2026 at 2:04 pm

    The input of this function is an element(), which is basically a XML snippet. Based on the values used within the function it should probably have a structure like this:

    <ns0:RetrieveCustomerByCriteriaResponse>
      <ns0:customers>
        <ns0:id>1234</ns0:id>
        <ns0:firstname>John</ns0:firstname>
        <ns0:lastname>Smith</ns0:lastname>
        <ns0:emailAddress>you@gmail.com</ns0:emailAddress>
        <ns0:address>
          <ns0:street>Main Street</ns0:street>
          <ns0:zipcode>12345</ns0:zipcode>
          <ns0:city>New York</ns0:city>
        </ns0:address>
        <ns0:rating>5</ns0:rating>
        <ns0:gender>male</ns0:gender>
      </ns0:customer>
    </ns0:RetrieveCustomerByCriteriaResponse>
    

    Please note, that XML is semi-structured, so there could be information missing from the input snippet (e.g. no email address). of course it could also contain many more information which is simply not used here.
    What the script actually does is some simple XPath expression. For example

    xs:long($retrieveCustomerByCriteriaResponse1/customers/id) }
    

    traverses first to the customer child and then to the id child. The xs:long is a type casting to a long value. What you will get back is something like this (based on the above input):

    <ns3:FindCustomerResponse>
      <Customers>
        <ns2:ID>1234</ns2:ID>
        <ns2:FirstName>John</ns2:FirstName>
        <ns2:LastName>Smith</ns2:LastName>
        <ns2:EmailAddress>you@gmail.com</ns2:EmailAddress>
        <ns2:Addresses>
          <ns2:Address>
            <ns2:Street>Main Street</ns2:Street>
            <ns2:PostalCode>12345</ns2:PostalCode>
            <ns2:City>New York</ns2:City>
          </ns2:Address>
        </ns2:Addresses>
        <ns2:Rating>5</ns2:Rating>
        <ns2:Gender>male</ns2:Gender>
      </Customer>
    </ns3:FindCustomerResponse>
    

    What I don’t know (and I would actually be very interested to know…) ist what these two asterisk ** in the function declaration mean. I have never seen such a syntax before. Normally, you use the asterisk just for a wildcard for the namespace or as quantifier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my .NEt projects I'm used to the tool called ReSharper but my current
I used wsimport command line tool for creating classses but I want to do
I'm very new to YUI. And I used this tool to generate some css
How is this tool used? Not the debugger, I mean Tools > Attach to
I used McCoy tool to Install my install.rdf file and sign my update.rdf file.
I used a tool a few months ago that scanned a specified website and
Has anybody used OProfile tool on android...If you are able to profile please provide
Does anybody know what tool used while podcasts were recorded here: http://www.asp.net/mvc/application-development/ For example
I have used valgrinds massif tool to monitor memory usage in the past. Does
I have used the Validate tool in xcode and validated my application. The validation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.