Lexical Parsing exception using JXQI for function in XQuery

How to parse Xquery containing new declared namespace, functions and then use the same function to operate upon Xquery along with it.....
When i try to execute that XQuery using JXQI library, i get lexical parsing exception.......
i m quite new to XQuery and that too its implementation in java, so i would b grateful for the help in advance !!

Hi,
Could you post the XQuery, and a sample XML document (if necessary)?
Thanks.

Similar Messages

  • What is the best method to parse a java file for function names

    st="class";
    while (StreamTokenizer.TT_EOF != tokenizer.nextToken ())
       if (StreamTokenizer.TT_WORD == tokenizer.ttype)
        if (tokenizer.sval.toLowerCase().equals(st.toLowerCase())){
        System.out.print (tokenizer.nextToken() + " "); //prints the class name on the console
        fileOut.print (tokenizer.sval + " "); //prints the class name to a file
    }The above program searches a .java file for classes. I want to modify it so that it searches for function names as well. After several hours of figuring out various ways to do it with StreamTokenizer, I still havnt found a way. There seems to be no way to go back, i.e. no previousToken method, in StreamTokenizer.
    Is it possible to do search for using StreamTokenizer, and are there easier ways of doing it?

    Simple string tokenizing isn't an effective way to do this. You probably want something like ANTLR.

  • Using type for function in sql

    CREATE OR REPLACE
    type InListType_number as table
    of number
    CREATE OR REPLACE function in_list( p_patseq in number ) return InListType_number
    as
    l_number number default p_patseq ;
    l_data InListType_number := InListType_number();
    begin
    loop
    exit when l_number is null;
    end loop;
    return l_data;
    end;
    SELECT p.pat_seq, p.diagnosis_type, ct.code_value || ' ' || p.alt_description as diagnosis_desc
    FROM patient_diagnosis p,
         (select * from code_set , code_set_type
         where code_set.code_set_type_seq =code_set_type.code_set_type_seq) ct
    WHERE p.enterprise_seq = (select enterprise_seq from org_lookup where organization_seq = 0 and rownum = 1)
    and p.diagnosis_code_seq = ct.code_set_seq(+)
    and (p.diagnosis_type LIKE 'A%' OR p.diagnosis_type LIKE 'W%')
    and p.PAT_SEQ IN (select /*+ CARDINALITY (t ) */* from table( cast( in_list (list of pat_seq here like 12345,12344,345666,etc over 1000 counts of pat_seqs)
    as InListType_number ) ) t)
    this gives me
    ORA-00939: too many arguments for function
    can someone advise? thanks

    Well IN_LIST takes a single parameter of type NUMBER and you are passing in
    12345,12344,345666which is patently multiple numbers. I think what you want to do is pass in a string ' 12345,12344,345666' and have a function TO_LIST() that parses the string and spits out numbers. Fortunately for you John Spencer has posted Re: Splitting the values in one column.
    Cheers, APC

  • Using variables for function arguments AS2

      Hello,
    I am trying to create a function in AS2.
    After creating the function, I want to use values stored in variables for the function arguments rather than manually typing static values for carrying out the function calculation. Also, I want to use the function to assign a new value to the existing variable.
    I have asked a similar question 2 days ago here and got the answer (thank you), but now I got one more question - How can I create the function to assign a value to the variable while that variable itself is also a function argument?
    For example, I have 6 numeric variables:
    var CoinA:Number = 10;
    var CoinB:Number = 20;
    var CoinC:Number;
    var CoinD:Number = 30;
    var CoinE:Number = 40;
    var CoinF:Number;
    Then I tried to create a function to assign values to variables CoinC and CoinF:
    function CalculationA(FirstCoin, SecondCoin, ThirdCoin):Void {
         FirstCoin = SecondCoin + ThirdCoin;
    CalculationA(CoinC, CoinA, CoinB);
    CalculationA(CoinF, CoinE, CoinF);
    The above code didn't really assign the values 30 and 70 to the variables CoinC and CoinF but instead, values of CoinC and CoinF are undefined.
    Please give me the correct code if there's a correct way of doing this.
    Thank you,

    Here is one way of doing it, by passing a string value of the variable name instead of the actual variable name....
    var CoinA:Number = 10;
    var CoinB:Number = 20;
    var CoinC:Number;
    var CoinD:Number = 30;
    var CoinE:Number = 40;
    var CoinF:Number;
    function CalculationA(FirstCoin, SecondCoin, ThirdCoin):Void {
         this[FirstCoin] = SecondCoin + ThirdCoin;
    CalculationA("CoinC", CoinA, CoinB);
    CalculationA("CoinF", CoinD, CoinE);
    (Note that in your second function call I changed the coins since CoinF (ThirdCoin) is undefined at that point.)

  • Parsing xml using the .text() function in as3

    I am accessing an xml document in actionscript, I know flash can see the xml as I am tracing it but when I add the .text() funtion to my trace to strip out the tags by trace doesn't see anything.
    this works...
    function LoadXML(e:Event):void {
    xmlData = new XML(e.target.data);
    ParseXML(xmlData);
    function ParseXML(thexmlInput:XML):void {
    trace("XML Output");
    trace("------------------------");
    trace(thexmlInput.wrapper.page);
    this doesn't...
    function LoadXML(e:Event):void {
    xmlData = new XML(e.target.data);
    ParseXML(xmlData);
    function ParseXML(thexmlInput:XML):void {
    trace("XML Output");
    trace("------------------------");
    trace(thexmlInput.wrapper.page.text());

    The text() function returns an XMLList object, not a string literal.
    To trace out the return of XML.text() - you need to loop through the object.
    var xmlText:XMLList = myXML.text();
    for each (var i:String in xmlText){
         trace(i);
    Or you could use the toString() method instead.
    trace(myXML.toString());
    (The reason your first code works is because toString is automatically applied to trace statements, unless you specify something different)

  • Is there a way to access all the items in the tools section without seeing all the options? That is to say can one use keyboard for functions? My tools menu doesn't scroll down, only goes from left to right for one page and no more options.

    I can't seem to view web pages. I noticed when I clicked on the tools menu I don't get the usual drop down menu of choices. I get a horizontal listing of options with a white background. I suspect the issue may be somewhere in some settings of my tool bar or the way the system displays web pages.

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).<br />
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]<br />
    <br />
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.<br />
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.<br />
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Experiences using CBTA for test of SAP UI5

    Hi All,
    We are looking into using CBTA for functional testing of SAP UI5 application.
    Are there any one who would share some experiences regarding this?
    Tanks in advance
    /Søren Amdi Bach

    Hi Stefan,
    while the JARs in the UI5 Eclipse plug-ins contain the same files and it would be possible, but a bit cumbersome to extract and combine them, you are of course right that the SCN trial is severely lagging behind.
    Unfortunately getting the SCN updated is a relatively complicated process which is not completely in our hands, so we recently focused on getting the OpenUI5 releases (which we control) reliably done. I let a colleague know who will try to do it this week (no promise). The version will then be 1.18.11.
    Regards
    Andreas

  • How can I use JavaScript extention functions with Xalan for transforming XML with XSL

    While transforming standart XML and XSL files to HTML with this servlet:
    package mypackage1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.URL;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import org.mozilla.javascript;
    public class Servlet2 extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    try
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileReader("c:/aaa.xml"));
    Source xslSource = new StreamSource(new FileReader("c:/bbb.xsl"));
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform (xmlSource, new StreamResult(out));
    catch (Exception e)
    e.printStackTrace();
    everything is going ok,
    but when try to use javascript function in XSL file, for example like in this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt" xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">
    <lxslt:component prefix="my-ext"
    functions="getdate">
    <lxslt:script lang="javascript">
    function getdate() {
    var d = new Date();
    return d.toUTCString();
    </lxslt:script>
    </lxslt:component>
    <xsl:template match="/">
    <p><xsl:copy-of select="my-ext:getdate()"/></p>
    </xsl:template>
    </xsl:stylesheet>
    recieve error-message:
    XSL-1000: (Fatal Error) Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.).
    What kind of namespace I should specify?

    Hello, Paul.
    I'm sure you may not use JavaScript as a language for creating XSLT extention functions with Oracle XDK Parser. This is since parser might have JavaScript interpreter to work with JavaScript, but it has not.
    If you need to build any XSLT extention functions you must build them as Java class' static methods.
    After that, you define the usage of the class by mean of namespace declaration as:
    xmlns:your-ns="http://www.oracle.com/XSL/Transform/java/yourpackage.Yourclass"
    (Prefix "http://www.oracle.com/XSL/Transform/java/" may differs if you use non-Oracle XML parser)
    and use class' static method in XSLT:
    <xsl:value-of select="your-ns.staticMethodName(paramsIfAny)"/>
    In your case you may wish to use standard Date class:
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    <xsl:value-of select="date:toString(date:new)"/>

  • In which condition Table valued function should prefer over SP except use in joins?

    Hi, 
    My requirements is:
    Entity framework needs to call DB object (TVF or SP), which will provide some data to them and they'll work on it at app level.
    DB object would be simple, one result set, it will join 5 tables and get around 30 columns to them. it would be parameterized query so can't use view.
    Now my question is what DB object would be best to use, table valued function or store procedure. and why?
    I google on it, I find some interesting links (example http://technet.microsoft.com/en-us/library/ms187650(v=sql.105).aspx)
    they mentioned conditions to convert SP to TVF but not mentioned the reason, why I should convert?
    Both have same cache plans strategy. SP has so many advantages over TVF, but I don't see any technical advantage of TVF over SP except it can be use in joins or so. 
    so In short my question is, why I can't use SP in all cases, why I would use TVF?, and which Table valued or multi-valued?
    would appreciate your time and response.

    According to a few recent blogs you should be able to use TVP or stored procedure with EF 6.1.2 with ease. In our application we haven't switched yet to 6.1.2 (we're using 6.0.0) and there is no support for stored procedures or functions so we use StoreQuery.
    I am wondering if you can share your experience of using EF with SP or TVP (and document the steps).
    I am also wondering as how exactly it's working behind the scenes and where the full query is taking place. Say, in our case we may want to add some extra conditions after retrieving a set using, say, SP. Would the final query execute on the client (e.g.
    SP executed on the server, result returned and then extra conditions executed on the "client")?
    As I said, right now we're using StoreQuery which means that our extra conditions must be case - sensitive as opposed to SQL Server case insensitive. So, if someone already tried that scenario and can tell me how exactly it works, I would appreciate it.
    Another question about EF - I defined a property as  
     [Column(TypeName = "varchar")]
            public string PhoneNumber { get; set; } // area code + phone
    and in the LINQ query as 
    var query = db.Accounts.Select(a => new AccountsList
    AcctName = a.AcctName,
    Contact = a.Contact,
    FullName = a.FullName,
    AreaCode = a.AreaCode,
    Phone = a.Phone,
    Hidden = a.Hide,
    Hide = a.Hide,
    PhoneNumber = a.AreaCode.Trim() + a.Phone.Trim(),
    AcctTypeId = a.AcctTypeId
    and I see that it's translated into CASE AreaCode IS NULL THEN N'' ELSE RTRIM(LTRIM(areaCode)) END + ... 
    My question is - why EF does it if there is no mentioning at all in the class as how NULL is supposed to be treated. Is it a bug?
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Incompatible object argument for function call exception

    I am hoping someone has seen this issue before.
    Running CF 7.0.1.116466 with JRun 4.
    I have a 3rd party search engine application running on a
    separate server. I interface with the engine via their Java API. I
    am able to use the search engine when executing using a home grown
    Java application. It also worked with CF 6. However, when I try to
    implement the same cold in CF, it fails with the exception attached
    below. I am able to successfully create the objects. The error
    occurs when the objects attempt to connect with the engine.
    I have also attached the code that is causing the errors.
    "seObj" creates an interface with the search engine. It is
    constructed with the server address as a parameter. It does not
    attempt to contact the engine when it is first constructed.
    "dsObj" allows access to specific content in the engine. This
    is where the connection to the engine is attempted and the error
    occurs.
    Any assistance would be greatly appreciated.
    12/13 10:26:12 error (class: org/jacorb/orb/Delegate, method:
    getReference signature:
    (Lorg/jacorb/poa/POA;)Lorg/omg/CORBA/portable/ObjectImpl;)
    Incompatible object argument for function call
    java.lang.VerifyError: (class: org/jacorb/orb/Delegate,
    method: getReference signature:
    (Lorg/jacorb/poa/POA;)Lorg/omg/CORBA/portable/ObjectImpl;)
    Incompatible object argument for function call
    at org.jacorb.orb.ORB._getObject(Unknown Source)
    at org.jacorb.orb.ORB.string_to_object(Unknown Source)
    at com.engenium.semetric.Engine.initRef(Engine.java:731)
    at com.engenium.semetric.Engine.getDocSet(Engine.java:81)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at
    coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:74)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:1634)
    at cfinsert2ecfm673131553.runPage(C:\Documents and
    Settings\Jameso\My Documents\workspace\SemetricCF7\insert.cfm:12)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at
    coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at
    coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at
    coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)
    at
    coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
    at
    coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
    at
    coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
    at
    coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
    at
    coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at
    coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at
    coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at
    coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
    at coldfusion.CfmServlet.service(CfmServlet.java:107)
    at
    coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
    at
    jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at
    jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
    at
    jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

    Hi, Thanks.
    But the problem is still there.
    If I put
    public class SimpleThread extends Thread
    No problem, but if I put
    public class SimpleThread implements Runnable
    I got java.lang.VerifyError: (class: TestNotify, method: main signature: ([Ljava/lang/String;)V) Incompatible object argument for function call
    Exception in thread "main"
    Regards,
    Youbin
    Please refer to the following code:
    public class SimpleThread implements Runnable {
        private boolean isWaited = false;
        public void run() {
            synchronized(this) {
                while (true) {
                    System.out.println("Hi ------------");
                    try {
                        Thread.sleep(5000);
                        System.out.println("Start wait()");
                        isWaited=true;
                        wait();
                        isWaited=false;
    catch (Exception e) { }
    public class TestNotify {
    public static void main(String[] args) {
    SimpleThread simpleThread = new SimpleThread();
    simpleThread.start();
    try {
    Thread.sleep(10);
    } catch (Exception e) { }
    while (simpleThread.getIsWaited()) {
    synchronized(simpleThread) {
    System.out.println("Start notify()");
    simpleThread.notify();
    System.out.println("Arrived");
    int i=0;
    while (!simpleThread.getIsWaited()) {
    i++;
    System.out.println("Arrived="+i);
    synchronized(simpleThread) {
    System.out.println("Start notify() again");
    simpleThread.notify();
    System.out.println("Arrived again");

  • TS1398 I have an iPad mini, because of my work network firewalls I am not able to use the airprint function to print. I was told you can direct connect to a printer. I am not sure how as I have not seen any cables for a lightning connection to a printer c

    I have an iPad mini, I am connected to my work wireless connection. My printer also is on the same wireless network, however I am not able to print to my airprint enabled printer through this wireless connection. Is there a way to direct connect to the printer via a cable ?
    I am missing something here on the connection. I am thinking possibly a firewall here at work will not allow me to use the airprint function. Help ?

    There is no support for wired printing.
    It is probably a firewall issue, possibly where all inbound communications are blocked. Since you're at work, I'd call your work IT department and find out from them what you can/can't do.

  • I have been putting in a URL and yahoo snags it parses it to several words then gives me a search page... I use Google for search andf I want to go to the specific URL I entered... How do I block Yahoo from doing this crap?

    I use google for my search engine. I do not have any reference to Yahoo in my plugins or extensions on Firefox. Every time I enter a specific URL in the Firefox box, Yahoo comes up, has the full URL I entered to go directly to. It has the URL in the Yahoo search entry field and it parses the name to several words that make up the entire URL. Asks me if I only want the name I entered and lists every site that contains the words it parses... Yahoo is really screw up if it hijacks the browser. How do I prevent them from doing this...

    Hi,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • How to Use the language function for assignment and validation

    Hi All,
    If anyone can explain me in details with example ,how to use the language function for assignments and validations?
    Thanks
    Arnab

    Hi Arnab,
    The expression is checked only for the current MDM session.
    If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
    Try connecting to the DM with the XYZ language.
    It should go to the if part rather than else.
    Hope it helps.
    Thanks,
    Minaz

  • HT204161 I want to use iCloud for every thing else except for Messages. I do not want to send an iMessage and receive it on both my iPhone and Mac.

    I want to use iCloud for every thing else except for Messages. I do not want to send an iMessage and receive it on both my iPhone and Mac.
    How do I do that?

    Howdy kingtonz,
    If I understand you correctly, you want to limit to limit your use of the Messages application to non-iCloud sources such as text messaging through your phone carrier, is that right?
    You can turn off the use of iMessages in Settings > Messages > iMessage. See this help article -
    Messages settings - iPhone
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • I sent in my iPhone 6 for repair. I used restore on the loaner phone I was given, and the contacts, texts, reminders, and Safari pages all showed up. My phone is back, and when I used the restore function again, those items are missing.

    I sent in my iPhone 6 for repair. I used restore on the loaner phone I was given, and the contacts, texts, reminders, and Safari pages all showed up. My phone is back, and when I used the restore function again, those items are missing. I do not use iCloud because I have no wifi at home, limited data available for regularly backing up, and I have a 64GB phone and don't wish to pay to upgrade from the 5GB iCloud storage. Am I doing something wrong? It worked so seamlessly on my loaner phone that I am completely stumped as to why it will not restore those items to my original phone again.

    The iphone is designed to be synced to your computer or cloud service.  Your contacts should be in whatever program/service you have chosen to sync.
    If you have failed to do this, then they are likely gone.

Maybe you are looking for

  • ITunes 8.1.1 no longer launches on iPhone connection

    Prior to my upgrade to iTunes 8.1.1 I could connect my iPhone for sync and charging and iTunes would launch automatically. Since the upgrade I have to launch iTunes manually. I have checked both settings which control this: 1) iPhone>Summary>"Automat

  • How to run powershell in adminsitrator mode using invoke-command

    Hi, I'm trying to run the below script from the remote machine I'm getting the output as below and the msnpatch.exe is not getting executed on the remote machine(testserver). When I run the same command on the testserver, a new powershell session is

  • MacBook Pro 1,1. OS X 10.6.8 Trying to connect an Edirol FA-101 via FireWire, Macbook not recognizing device.

    Hello, I'm trying to connect an Edirol FA-101 to my MacBook Pro. I'm running Snow Leopard 10.6.8. Other fireWire devices and drives work on the port, but the Edirol is not showing up in Audio MIDI setup or anywhere. I've tried both DC power and Bus p

  • Run 10.6.2 and 10.5x at same time

    I have run into several compatability problems with 10.6.2 ie., Roxio easy vhs to dvd and HP Scanjet G4050 scanner, and considered reverting to 10.5x but have read of the other problems doing this. I was wondering if it would be possible to run 10.5

  • Compact flash- iPod transfer?

    Is there a device that will let me transfer photos from my camera's memory card (Canon 350, compact flash) to my iPod "in the field"? Purpose built hard disks for this have a slot to insert the memory card. Is there some sort of adapter so I can use