Evaluation of XML Namespace by using the java properties file

Hi all

In my java class, I get the XML as a string. I am convert this string to xml. So in order to evaluate the xpath expression, I'm able to evaluate the xpath expression by using the namespace prefix and the namespace url as key / value in my properties file. It has worked well.


But my project is that,

I can receive different xmls with different sets of namespaces. For each xml namespace prefix and url wil set. While I can keep track of a set of namespace prefix and url for each xml.

The problem here is that
XML_A is to have its own prefix - ns1 pointing to 'http://orders.com/purchase', ns2, pointing to "http://orders.com/invoice".

XML_B is to have its own prefix - ns1 pointing to 'http://sales.com/stock', ns2, pointing to "http://sales.com/item" - I mean same ns1 and ns2


Kindly tell me, it's possible in the file build.properties, to bring together the key pair / value. while I have not lead to any conflict, of having the URL of the different namespace
for the same key "ns1."

ns1 = http://orders.com/purchase


ns1 = http://sales.com/stock


I want the above two lines occur in the same file build.properties. Also, when using MapObj.get ("ns1") - (where MapObj will see the values of keys to the build.properties file.)
I want to differentiate the ns1 under certain conditions (xml_name in my case).

Here for the prefix, I have no other don't be concat something to make a difference like A_ns1 and B_ns2. This will create problems. So kindly help me by giving an alternative.



Thank you
Sabarisri. N

Hi Sabarisri,

First, there's a material typo in my previous post (hmap2 must be read hmap, all along). I who will edit later because it is annoyingly confusing. But leave it for now.

I think I was so explicit that I was able to convey the idea that ns1, ns2, etc., if there is more, used by the author of XML_A and XML_B are unimportant as long as you, as the consumer of them, are concerned. Apparently, I was not very successful.

Let me do it again.

Assume that XML_A contains the prefixes and namespace URIs like this. I even add one more by way of illustration which may overlap in the two documents.

xmlns:ns1 = "http://orders.com/suppliers".
xmlns:ns2 = "http://orders.com/stock".
xmlns: x = "http://orders.com/serial."

Then in XML_B, these.

xmlns:ns1 = "http://customers.com/contact".
xmlns:ns2 = "http://customers.com/billing".
xmlns:y = "http://orders.com/serial".

(ns1, ns2, x) and (ns1, ns2, y) are appearing as such when xml documents are served. x and there are still pointing to the same namespace (think of it as the namespace where the serial number of the orders they need later use to gather the two sets of data.) x and there is maybe not even the same same alphabet their semantics (namespace uri) are the same, the same namespace.

Put yourself in the situation of consuming them. You know you have to deal with totally 5 namespace uri. You build the dictionary: a HashMap or unique or other properties file. Under your control are the namespace prefixes. You can ignore absolutely what they use ns1,... x, y. Design you your own. That's all.

hmap.put("p","http://orders.com/suppliers");
hmap.put("q","http://customers.com/contact");
hmap.put("r","http://orders.com/serial");
hmap.put("s","http://orders.com/stock");
hmap.put("t","http://customers.com/billing");

One more time (p, q, r, s, t) are figurative, you name it what you please as long as they are in line with the production of the grammar of namespace prefix.

With the help of (p, q, r, s, t), you build your xpath query. The namespace context Manager can resolve correctly. You can't even say what namespace prefix must be used by querying the xml, A or B.

Hope that makes it clearer by the repetition by another speech.

Published by: tsuji 7 Sep 2011 08:13 (typos only)

Tags: Oracle Development

Similar Questions

  • I get a message: to use the 'java' command line tool, you must install a JDK.  I tried 10 times to install without success.  Help, please.

    I get a message: to use the 'java' command line tool, you must install a JDK.  I tried 10 times to install without success.  Help, please.

    You probably have some of the older than the needs/desires software legacy Java installed.

    Please see these sons of community message:

    After the installation of El Capitan, I get the message: to use the 'java' command line tool, you must install a JDK

    Just found this last Java does not work with El Capitan

    This is the Apple link to the legacy version of Java 6.

    Download Java for OS X 2015-001

    First of all, I would like to try to identify what application generated the next message and update (delete) this request as the case may be. If you need to run Java then, as the Apple Support page says it's certainly preferable that your installation of Java entirely up-to-date with the Oracle's Java course. If you can get without Java, you should install it not - like the Flash, it should not be installed unless you have no choice.

  • Use the java connector for the connector database?

    Hello

    I'm running on IOM 11gr2ps2 and need to use the database connector.  We installed the .net connector server to operate with the connector AD.

    The Oracle of https://docs.oracle.com/cd/E22999_01/doc.111/e20277.pdf documentation gives us an option to either install a java connector server to work with the database connector or install the IOM database connector without using a java connector server.

    The documentation says "execution of a connector on the connector server.

    allows to transmit queries put in service and reconciliation through the firewall in a

    as defined by the connector server.

    As I already have a connector server .net for AD, I would lean towards the installation of the java connector server.  In this way architecture remains consistent.

    Please, share your ideas.

    Thank you

    Khanh

    Table of database connector uses the Java Connector server, or it can be deployed directly in the container of the IOM.  If you have problems jar or different library due to database formats, you can use the connector server to isolate libraries and do not have to figure out how to make IOM in collaboration with several libraries.  It can also take some of the load on your server to IOM for the transformation.  I suggest to use the server connector for the isolation of the newspaper as well.

    -Kevin

  • Can I use the Java edition?

    Hello
    I don't know if I have to use the Java or the 'normal' edition of the berkeley db.

    My application is developed in Java, but I don't use JTA, JCA or JMX.
    Is there an advantage to be taken using the Java edition?

    Thank you

    There are many minor differences, for example, I was a little bit better write performance, DB uses somewhat less memory, DB has a SQL interface and I does not. But overall, the two products are very similar, so for most of the questions you might ask, the answer is going to be "in respect of the same".

    If you want to choose the best product for your application, you will need to define very specific criteria that are most important to you. If you care more about make every ounce of performance on a specific part of the material, using a specific amount of memory, for a specific application (access model), then you will need to pass a test and make a comparison.

    -mark

  • Post in print, using the burst control file

    Hi all

    We use the break control file to print and send. Email option works very well. But when it comes to printing, printing "PDF file not printed. 128 MB of memory is necessary to allow a direct PDF printing"in printing.

    We use CUPS and this is the way that we use for printing.

    IPP://localhost:631/printers/YG_MAIN

    When we try to run the same program manually, giving the name of the printer and the number of copies at 1, then we are able to see the pdf output. Other reports are normal bi publisher also works well, w.r.t. this printer. We face this problem when we run xml program, with the option of printing bursting.

    Suggestions please...

    ---------------------------------------------------------------
    Here's the full breakdown control file,


    <? XML version = "1.0" encoding = "UTF-8"? >
    < xapi:requestset xmlns:xapi = "http://xmlns.oracle.com/oxp/xapi" >
    < xapi:globalData location = 'stream' >
    < / xapi:globalData >
    < select xapi:request = ' / XX_IMB/LIST_G_PAT/G_PAT ">
    < xapi:delivery >
    < xapi:email id = "123" server = "XXXXXX.com" port = "25" from = "[email protected]" > "
    < xapi:message id = "123" to attachment = "${DESTINATION}" = "true" content-type = "text/html" subject = "Test email" > please find the attachment < / xapi:message >
    < / xapi:email >
    < xapi:print id = "print1" printer = copies "ipp://localhost:631 / printers / ${DESTINATION}" = "1" / >
    < / xapi:delivery >
    < xapi:document - output type = 'pdf' flow '123' = >
    < xapi:template type = "xsl - fo" location = 'xdo://XXCUS. XX_MAIN.en.us"filter=".//G_PAT[DESTINATION_TYPE='Email"]" > "
    < / xapi:template >
    < / xapi:document >
    < xapi:document - output type = 'pdf' flow 'print1' = >
    < xapi:template type = "xsl - fo" location = 'xdo://XXCUS. XX_MAIN.en.us"filter=".//G_PAT[DESTINATION_TYPE='Print"]" > "
    < / xapi:template >
    < / xapi:document >
    < / xapi:request >
    < / xapi:requestset >

    BI Publisher burst of CUPS printer uses no PASTA, out don't is converted from PDF to Postscript, it does when it is executed via simultaneous Manager.
    You can put an entry in the next $XDO_TOP/resource/xdodelivery.cfg (replace with your printer):



    ipp://mycupsserver.mydomain:631/printers/MYPRINTER
    /usr/local/bin/pdf2ps -paper A4 {infile} {outfile}

    Kind regards
    Gareth

  • I can not package for the project when I used the blackberry resource files

    I can't package the project when I used the blackberry resource files.

    Packaging HelloWorl project
    C:\eclipse\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components\bin\rapc.exe-quiet codename=deliverables\Standard\5.0.0\HelloWorl deliverables\Standard\5.0.0\HelloWorl.rapc-sourceroot=C:\workspace\HelloWorl\.locale_interfaces; C:\workspace\HelloWorl\src; C:\workspace\HelloWorl\res-import=C:\eclipse\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components\lib\net_rim_api.jar C:\workspace\HelloWorl\bin
    Cannot open the C:\workspace\HelloWorl\bin/com.helloresL.crb/ dir
    Error! : error: auditor failed: C:\eclipse\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components\bin\preverify.exe d C:\DOCUME...
    Packaging project HelloWorl failed (taken in 0,219 seconds)

    I have fixed my problems, I was using a unicode language in windows, so I changed the language for non-unicode format.

  • Using the external js file in the custom workflow

    Hello

    I use 11.1.1.8 and jdev 11.1.1.7 spaces

    While referring to (http://js.xyz.com/js/abc.js) external js file in my integrated jsff in weblogic page, there is no problem, js works perfect , but when I deploy my workflow a workflow customized to webcenter spaces page cannot access this file js url.

    I have to give this operation any grant? How?  I found something external applications like this, but there wasn't a connection information. My field of js file didn't need approval.

    Thank you.

    Jsff file, I use the js as file

    < af:resource type = "javascript".

    source ="http://js.xyz.com/js/abc.js" / > ".

    Thanks for everyone, location external links js in the page of the portal model has solved my problem.

  • Retrieve by using the backup control file

    Hello

    I was reading a book called Pro Oracle Database Administration by Darl Kuhn. There, under the theme of "The valuation of the loss of all control files", noted that all data files and control files are restored from a backup, because if we do not restore the data files the RCS in control files would be lower than the data in these scenarios files. Since online redo logs and archived newspapers is applied to the data files to roll forward in a current consistent state and does not roll forward to a control file.

    It is then mentioned to use 'recover the database by using the backup control file' then apply the logs (archive and redo if necessary).

    However I personally tested this script in a test environment and to bring all the backup control file could issue the same command as above and recover the database.

    My question is I know again and archives are applied only to the data files. So how does the control file are synchronized back when we do not restore the backup data files.

    Thank you

    If we do not restore the data files, the RCS in control files would be lower than the data files. Since online redo logs and archived newspapers is applied to the data files to roll forward in a current consistent state and does not roll forward to a control file.

    It would be incorrect you have determined. You can only restore the control files. You can manually create a control file and always do the restore.

    My question is I know again and archives are applied only to the data files. So how does the control file are synchronized back when we do not restore the backup data files.

    The control file is updated as well.

    See you soon,.
    Brian

  • How to use the gfsecurity.properties?

    Hi, I have the following problem. I need include the field of security, security-* properties different than the gemfire.properties, I was reading that there is a gfsecurity.properties, but I do not know how to set that up.

    And if do not know if this feature is available only in the Gemfire 7.0.
    Is this true?

    The "SSL Sample application" section that I linked in the post above shows how to specify the security properties file, using the -J-DgemfireSecurityPropertyFile, for example:

    Cacheserver start-J-DgemfirePropertyFile=D:\gfeserver\gemfire.properties-J-DgemfireSecurityPropertyFile=D:\gfeserver\gfsecurity.properties

  • I can't find a newer version of adobe flash player for ubuntu 14.04, I tried to use the apt version but it wouldn't work and I don't know how to use the tar.gz files and install, I think the current version to .deb

    I can't find a newer version of adobe flash player for ubuntu 14.04, I tried to use the apt version but it wouldn't work and I don't know how to use the tar.gz files and install, I think the current version to .deb

    Hi LF12,.

    The latest version of Flash Player for Linux is 11.2.202.400.  The current versions of Flash Player are displayed here http://www.adobe.com/software/flash/about/. The versions on the page are updated with each new version.

    --

    Maria

  • Using the same properties in a title to another title

    I am trying to create a video with numbers to count from one to four. I want to use the same properties of the title '1' to save time. How can I do this?

    I don't have a CS 4 installed on any machine, but here's a quick glance at the Studio of Production PrPro CS 2:

    It must be the same in PrPro CS 4, although the bottom of the panels is a gray over dark.

    Let us know if you have trouble finding this icon.

    Good luck

    Hunt

  • Location of the environment properties file

    Hi all

    I am a beginner and I have a question about the property file...

    What would be the best location for the environment.properties file? We are looking at two places field House and House of bea, which one would be the best option.

    Add entries in the environment.properties file, we need to restart the field or just redeploy application would pickup the changes?
    .
    Thank you
    Win

    Hello

    ** is the best place to put your properties files. No need to restart your server after you change these files if your application reads the files properties as mentioned below.

    It is also another good Option to add the property file situation including the Filename in the setDomainEnv.sh script CLASSPATH property. (but in this case it may restart the server if you want to change something in the file properties)

    I tested it and it works with charm...
    After you have placed any property inside the "root of the field" file (example :) directory can be read without restarting the server... I tried the following after placing "a.properties" within the root of the domain... Even I changed the values in the file property 2 to 3 times and each time it is reflected in my JSP as *(No need to restart the Servers) *.

    * "a.Properties" *.
    City = New York (SpiderMan City)
    country = America

    * "index.jsp". *
    <%@ page import="java.util.*" %>


    Hey it's Wroking



    < %="">< br="">InputStream is = new FileInputStream (". / a.properties"); < br=""> Properties prop = new Properties (); < br=""> prop.load (East); < br=""> out.println ("City:"+ prop.getProperty ("City") "); < br=""> out.println ("country:"+ prop.getProperty ("country") "); < br=""> %>


    .
    .
    Thank you
    Jay SenSharma
    http://WebLogic-wonders.com/WebLogic (WebLogic wonders are here)

  • Get the error: SCAC-50012 when using the Java activity

    Hello

    I use Jdeveloper 11.1.1.4.0. I use a Java integration activity in my BPEL and when I compile the project, I got an error -error: SCAC-50012


    The code I use in activity integration of Java is


    ______________________________________________________________________________________________

    java.lang.String TraceLogMessage = null;
    java.lang.Boolean tracelogenabled;
    java.lang.String title (java.lang.String) = getVariableData ("Title");
    java.lang.String instanceID = (java.lang.String) getVariableData ("InstanceID");
    java.lang.String serviceName = (java.lang.String) getVariableData ("ServiceName");

    tracelogenabled = oracle.apps.aia.core.eh.logging.AIALogger.isTraceLoggingEnabled ("INFO", "http://xmlns.oracle.com/ExecuteSalesOrderFulfillmentDeviceUpdateEBF");
    setVariableData ("TraceLogEnabled", tracelogenabled);

    If (tracelogenabled.booleanValue ())
    {


    TraceLogMessage = "Start" + serviceName + "Instance:" instanceID + title;

    oracle.apps.aia.core.eh.logging.AIALogger.logTraceMessage ("INFO", null, TraceLogMessage);

    }

    ______________________________________________________________________________________________

    I imported the following bpel but there is no chance...


    < bpelx:exec import="java.util.logging.Logger"/ >
    < bpelx:exec import="java.util.logging.Level"/ >
    < bpelx:exec import="oracle.fabric.logging.LogFormatter"/ >
    < bpelx:exec import="org.w3c.dom.*"/ >
    < bpelx:exec import="oracle.xml.parser.v2.XMLElement"/ >
    < bpelx:exec import="java.util.*"/ >
    < bpelx:exec import="java.lang.*"/ >
    < bpelx:exec import="java.math.*"/ >
    < bpelx:exec import="java.io.*"/ >
    < bpelx:exec import="oracle.soa.common.util.Base64Decoder"/ >


    Please help me with this...

    Thank you and best regards,
    Suman

    Hello

    Have you checked the scac log files in your project JDev SCA-INF/classes directory? There could be vital information in these tell you what the problem is.

    Concerning

    Lars

  • Using the java applet on Windows

    I view assessment and I can't figure out how to get the Java applet to run when you use a Windows based PC.  My main thing is that when a user is on the road and they need access to their work stations do not have to install the Client from the view on a random machine.  I can't seemt to understand.  A little help would be very convenient.  Thank you

    Hello

    the Java components are used when you connect from a Linux or Mac device. When you use a PC running Windows with the view Potral, an ActiveX component will push the client to view endpoint and the user there is need of administrator rights to install it.

    What you could do is, ThinApp Client View and give your users on a USB key.

    Thank you

    Christoph

  • Using the Java Collections API in language PBL

    Hello
    You can use the collections api in a PBL language. Can someone provide an example of the same thing?

    Thank you.

    Hello

    Here is an example that you can make use of the api of Collections (Java).

    arrayList as ArrayList = ArrayList()

    Add arrayList using arg1 = "A".
    Add arrayList using arg1 = 'B '.
    Add arrayList using arg1 = 'C '.
    Add arrayList using arg1 = "D".
    Add arrayList using arg1 = 'E '.
    Collections.swap (arg1: arrayList, arg2: 0, arg3: 4)
    Collections.sort(Arg1: ArrayList)

    I hope this help you.

    Sidonie

Maybe you are looking for