Follow up on XPATH HashMap problem

Hi,
I got some great help before on this & am hoping for a little direction. I have a class that calculates the tax from an xml like below:
<Taxes>
     <Tax TaxCode='code1' Amount='101.00'/>
     <Tax TaxCode='code2' Amount='102.00'/>
     <Tax TaxCode='code3' Amount='103.00'/>
     <Tax TaxCode='code4' Amount='104.00'/>
     <Tax TaxCode='code5' Amount='105.00'/>
</Taxes>Now, my method below, gets the last 3 values and sums them and applies the code "XT" to it & returns a HashMap that looks like:
{code1 = 101.00, code = 102. 00, XT = 312.00}.
public static HashMap getTaxAmounts(String xml) throws Exception {
          HashMap taxes = new HashMap();
          DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        domFactory.setNamespaceAware(true); // never forget this!
        DocumentBuilder builder = domFactory.newDocumentBuilder();
        Document doc = builder.parse(xml);
        XPathFactory factory = XPathFactory.newInstance();
        XPath xpath = factory.newXPath();
        XPathExpression expr = xpath.compile("//Tax/@TaxCode");
        Object result = expr.evaluate(doc, XPathConstants.NODESET);
        NodeList nodes = (NodeList) result;
        XPathExpression expr1 = xpath.compile("//Tax/@Amount");
        Object result1 = expr1.evaluate(doc, XPathConstants.NODESET);
        NodeList nodes1 = (NodeList) result1;
        for ( int i = 0; i < nodes1.getLength() && (i<2); i++) {
               taxes.put( nodes.item(i).getNodeValue(), nodes1.item(i).getNodeValue());
                if( nodes1.getLength() >= 3){
                    float total = 0.00f;
                    for ( int i = 2; i < nodes1.getLength(); i++) {
                            total += Float.parseFloat(nodes1.item(i).getNodeValue());
                    String xt = nodes.item(2).getNodeValue();
                    xt = "XT";
                    taxes.put( xt, total);
       return taxes;     
/code]
all that's fine - but now I have to replace the tags in the original XML file so that they look like:<Taxes>
<Tax TaxCode='code1' Amount='101.00'/>
<Tax TaxCode='code2' Amount='102.00'/>
<Tax TaxCode='XT' Amount='312.00'/>
</Taxes>
any odeas how I would this???

Hi, John. I can address one of your questions here.
However, the picture was slightly cropped at the top and it also had 2 very small borders on the left and right, being printed in landscape.
A standard digital camera image is proportioned 4:3 (1.33:1). That doesn't match the 6:4 ratio of your paper's dimensions (1.5:1), so unless you opt either to distort the image or crop it, it can't be an exact fit on the paper.
In the toolbar at the top of iPhoto's Edit view is a pull-down menu above the word "Constrain". You use that menu to specify standard proportions for printing the image. Select "4x6 (Postcard)", and you will see superimposed on the picture a rectangle that has those proportions. What's inside the rectangle looks normal, signifying that it will be printed; what's outside the rectangle is pale and muted, because it will be cropped away when you print. Place your cursor anywhere inside the rectangle, hold the mouse button down and drag, to move the rectangle and change what's included within the print boundary.
The fact that your printed picture was both cropped and slightly reduced in size (creating the small left and right borders) suggests to me that your printer may not be capable of borderless printing, or that there is a setting for borderless prints you're overlooking somewhere. Since the contents of both the Print and Page Setup dialog boxes are governed by the printer's own driver software, and there's no "borderless" setting anywhere within iPhoto, I think you'll need to review the printer's documentation and/or online help files carefully to see whether you're overlooking something in one of those dialog boxes.

Similar Messages

  • I have an old iPhone 3Gs with software version 4.3.5,  I am trying to use it again, and it works fine, but I have not been able to update the software.  Every time I try, I get the following message: "there was a problem downloading the software for the i

    I have an old iPhone 3Gs with software version 4.3.5,  I am trying to use it again, and it works fine, but I have not been able to update the software.  Every time I try, I get the following message:
    "there was a problem downloading the software for the iPhone, the network connection could not be established".  This happens even though I have a working internet connection.
    Besides that, all the other functions work properly, even synchronize apps and library.
    Will I be able to update the software?

    look around the forum tons of people repport that they can't update
    makes you suspect that apples update servers can't meet the depand of too many users
    trying to update at once

  • HT1926 when trying to setup itunes on my pc i get the following message: there is a problem with this Windows installer package. A program required for this install to complete could not be run. How could I solve this problem?

    when trying to setup itunes on my pc i get the following message: there is a problem with this Windows installer package. A program required for this install to complete could not be run. How could I solve this problem?

    Repair your Apple software update.
    Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
    If you don't find ASU, go to Control Panel:
    START/CONTROL PANEL/Programs n Features/highlight ASU and click REPAIR,

  • Good afternoon.I have a computer with W Vista 8, Windows office home and business 2013. I recently tried to install Photoshop Elements by CD with serial number but on the desktop appears the following message: error 1 (configuration problem) try to uninst

    What's error 1 in adobe photoshop elements configuration? I have a computer with W Vista 8, Windows office home and business 2013. I recently tried to install Photoshop Elements by CD with serial number but on the desktop appears the following message: error 1 (configuration problem) try to uninstall and reinstall. I have done this but the message continues to appear

    You haven't mentioned which version of PSE. If it is PSE 13, that requires a minimum of windows 7.

  • Using Firefox 4 & Windows 7. Everytime I start Firefox from a shortcut to a website it comes up with the following error 'there was a problem sending the command to the program'. The requested website does load after this. with no problems.

    Using Firefox 4 & Windows 7. Everytime I start Firefox from a shortcut to a website it comes up with the following error 'there was a problem sending the command to the program'. The requested website does load after this. with no problems.
    If a shortcut is used while Firefox is already open the error does not occur.

    As reported in earlier replies, the annoyance disappeared after I upgraded to Roboform 7.5.6, from 7.5.4.
    Regards, Steve

  • Java 7 update 51 cause the following error: java.util.HashMap cannot be cast to java.awt.RenderingHints

    Since I installed Java 7 update 51 accessing the EMC VNX Unisphere Console cause the following error: java.util.HashMap cannot be cast to java.awt.RenderingHints.
    I rolled back to Apple Java 1.6 -005 now I am getting the following error: plug-in failure.
    I think this is cused by the fact that the EMC console application has been written for java 7 and not java 6. Has anybody faced and solved the "java.util.HashMap cannot be cast to java.awt.RenderingHints." error ?

    Hi Yaakov,
    The error is thrown from the  eclipselink.jar:2.5.1 which is a JPA provider .
    Is the above jar bundled in the Oracle Product you are working upon or was this downloaded from external site ?
    If the jar is bundled with the Oracle Product, go ahead a log a SR with Oracle Support with Toplink product group to drill down on the issue, as the issue is happening internally or thrown by the Eclipselink implementation and we've no control....
    Hope it helps!!
    Thanks,
    Vijaya

  • I went to update my itunes and I get the following message:  there is a problem with this windows installer package, a program required for this install to complete could not be run.  I uninstalled the old itune and reinstalled the new one and i get the s

    I went to upgrade itunes and when it finally downloaded, i got the following message:  There is a problem with this windows installer. A program required for this install to complete could not be run.
    I was advised to unistall the old itune, which i did and then loaded the latest itune 10.5 i think.  It dowloaded fine to a point and before finishing, it came up with the same message.
    Is the problem with the itune installer or my windows installer on my laptop?

    Repair your Apple software update.
    Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
    If you don't find ASU, go to Control Panel:
    START/CONTROL PANEL/Programs n Features/highlight ASU and click REPAIR,

  • When I connect my nano to my computer I receive the following message: There is a problem with this drive. Scan the drive now and fix it. My computer recognizes the ipod but the play lists saved in my itunes library are not the playlists that are on my na

    When I connect my nano to my computer I receive the following message: There is a problem with this drive. Scan the drive now and fix it.
    In addition, when I connect my nano, my computer does recognize but the library and playlists in my Itunes is not the same as the library/playlists on my ipod (on this ipod). If I purchase new songs from itunes, they go to the library on the computer but I cant get them to the ipod playlist.

    bump, I have same issue. thanks, MM

  • When opening Bridge (CS6) I get the following message: "Bridge encountered a problem and is unable to read the cache. Please try purging the central cache in Cache Preferences to correct the situation" I tried and after selecting purge cache it does not a

    When opening Bridge (CS6) I get the following message: "Bridge encountered a problem and is unable to read the cache. Please try purging the central cache in Cache Preferences to correct the situation" I tried and after selecting purge cache it does not allow me to select OK. Also Bridge keeps saying "Building Criteria" with the spinning wheel and nothing happens. I tried uninstalling and reinstalling to no avail. Please help:)

    Maybe a Preferences reset can help:
    Numerous program settings are stored in the Adobe Bridge preferences file, including display, Adobe Photo Downloader, performance, and file-handling options.
    Restoring preferences returns settings to their defaults and can often correct unusual application behavior.
    Press and hold the Ctrl key (Windows) or the Option key (Mac OS) while starting Adobe Bridge.  
    In the Reset Settings dialog box, select one or more of the following options:  
      Reset Preferences 
    Returns preferences to their factory defaults. Some labels and ratings may be lost. Adobe Bridge creates a new preferences file when it starts.
    Purge Entire Thumbnail Cache
    Purging the thumbnail cache can help if Adobe Bridge is not displaying thumbnails properly. Adobe Bridge re-creates the thumbnail cache when it starts.
    Reset Standard Workspaces
    Returns Adobe predefined workspaces to their factory default configurations.
    Click OK, or click Cancel to open Adobe Bridge without resetting preferences.   

  • When installing itunes 10 uding windows xp I get the following error: "There is a problem with this Windows Installerpackage. A program run as part of the setup did not finish as expected. Contact your sipport personnel or package vendor." - any ideas?

    When downloading itunes 10 in windows xp, I get the following error "There is a problem with this Windoes Installer package. Aprogram run as part of the setup did not finish as expected. Contact your support personnel or package vendor." - any ideas on how to proceed?

    using MSICUU2.exe didn't help me.  But,  the new replacement app did:
      http://support.microsoft.com/mats/Program_Install_and_Uninstall
    I fixed my problem like this:
    Here's the deal - 
    1.  can you install itunes via the APPLE SOFTWARE updater?
    I couldn't  so I downloaded ITUNES and tried to install it that way.   Hence  I got the same error hang as you.  Nothing worked,  (Multiple attempts at uninstall reinstall,  stopping of Services,  Reg cleaners  etc..)
    2.  If answer is NO to #1 you must fixe the APPLE SOFTWARE UPDATE Program. 
    OK  so I couldn't find a Download for this.   But:  if you have WINRAR,  open the ITUNES.EXE and extract the APPLESOFTWAREUPDATE.MSI file.  Execute the APPLESOFTWAREUPDATE.MSI separately.   And you will not be able to install it and have a similar issue as per your Itunes install.   This of course leads you to believe that the Itunes.exe  install is also installing all of these components including the applesoftwareupdate silently.   It must BOMB at that portion of the install and you are done. 
    3.  Your goal now is to get the applesoftwareupdate installed.   How do you do this.  Well -  here is what I did.
      a.  downloaded and RUN a PC  Installer FIX it tool from Microsoft.  This is a replacement for the older MSI fixer they used to use.
      http://support.microsoft.com/mats/Program_Install_and_Uninstall
    b. It will list programs to attempt to fix.
      choose  AppleSoftwareUpdate.msi
    c. Once it is done,  then reinstall apple program updater using
    AppleSoftwareUpdate.msi
    Finally it should install since the Microsoft tool appraently fixed corrupted installation files in your registry for this application.
    (Please note:  that I also disabled any apple related services such as BONJOUR or IPOD DEvice RUN:  services.msc to get there -  although this man not be necesarry.)
    Hence Launch this APPLE UPDATE SOFTWARE (Click the ICON in your Start menu)  it should list ITUNES
    select ITUNES from here and it will update.
    KEY HERE is to ONLY UPDATE APPLE Stuff via the APPLE SOFTWARE UPDATE program.  If that program is not working fix it.  Then Bingo.
    I am sorry to see folks having this problem for weeks.  
    APPLE,   Spread the word.  PC's can get corruption in the registry on your product should the update be stopped or computer shut off during an update.  etc...   Please improve your software updater program to check for invalid registry upon launching the app.  This will prevent people thinking it is an APPLE issue.  It appears to be a problem on your PC's registry settings for the APPLE Software update.
    Bruno Ricci

  • Error Message "The following printhead(s) has a problem" Officejet Pro 7590

    My Officejet 7590 shows a "The following printhead(s) has a problem" error message. Technical support recommends to clean the printheads contacts. I have done that and did not solve the problem. This has been now for few weeks and I cannot use the printer. In the meantime, several faxes came in and I cannot download the information neithe print.
    Plaese let me know where to return the product. or how to find another solution.
    Sick-Of-HP

    I have tried cleaning and replacing the printhead but nothing works I even tried turning it off hoping to reset the machine. I don't understand why you developed a machine that has so many problems and has no way to reset the blasted thing. As a consumer we should be able to buy a device that has a way to reset it. I haven't had this new machine very long and now I am considering going back to my old HP's. Help me fix this!

  • Receiver determination - Xpath expression problem with count

    I am working with a scenario where I pick up records from a JDBC connection and if the number of records I pick up is less than a certain number I want to call a webservice.  If it is greater than the number I want to write out a file to be processed by a different process on the receiving end.  I have created the receiver determination condition with the following conditions:
    (/p1:MT_HOG_Data/row[count(row) > 3] EX)
    (/p1:MT_HOG_Data/row[count(row) <= 3] EX)
    The integration is always processing the second condition no matter how many records come in.  I have tried with and without the multiline option.  Can anyone help with this?
    I have searched through the forum and checked the following links without any resolution:
    http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/ab/13bf7191e73a4fb3560e767a2525fd/frameset.htm
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    I can't find any examples where a count of records is checked in the expression editor.  Thanks in advance for any help.

    You can not use the EX operator in that case, because that is used only for node existence checks, not for value checks.
    Do you have a row number in your structure ? Then you could write the xpath expression with that counter tag and value
    Example: you want to send to receiver A if count > 3, else to B:
    you set  /rowNumber EQUAL 4 for sender A
    and /rowNumber NOT EQUAL 4 for sender B
    The condition is applied to the whole document. If one of the node/values are true for that condition, then the whole condition is set to true.
    Problem with that is that the second condition also will be true because nodes for that condition will be found
    better would be to have a rowcount tag in the structure. If that is not possible, you can use the "Enhanced Receiver determination" where you can define a mapping which determines the receivers. There you can do anything complicated you want.
    CSY

  • Pipeline validation xpath resolution problem

    I have a problem with something that seems like it should be a relatively straightforward requirement. I have a set of third-party schemas from a standards organization (CDISC). I need to build a solution that accepts documents conforming to these schemas,
    validates them and distributes them to subscribers. Specifically, I am trying to process messages conforming to the newly-released ODM 1.3.2. I previously built a solution that receives and validates ODM 1.3.1 messages, but CDISC added unique constraints to
    ODM 1.3.2 and re-referenced the targeted namespace with a prefix at the document level. To test the new schemas, I built a simple solution with the ODM schemas and a receive pipeline with an xml disassembler set to validate. The solution compiles and deploys
    without problems, but when I try to process a valid ODM 1.3.2 sample file, I get the following fault message:
    There was a failure executing the receive pipeline: "ODMTest.ReceivePipeline1, ODMTest132, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c5aa898d2acb2194" Source: "XML disassembler" Receive Port: "rcvFile" URI: "D:\Temp\in\*.xml"
    Reason: The prefix 'odm' in XPath cannot be resolved. 
    The problem looks like the issue discussed in the Adventures Inside the Message Box blog article entitled: "Adding a unique constraint to your BizTalk schemas to prevent duplicate values in elements/attributes (Part 2)" (Sorry, MSDN is not letting
    me link the article). The problem is that I cannot resolve the issue in the way the author suggests, since I am not the owner of the schema- CDISC is. I have zipped the sample project and will make it available to anyone who contacts me (apparently, I can't
    yet link content in this forum). Does anyone know a way around this problem?

    Yshmael,
    On BizTalk Administration Console, copy and paste following
    ODMTest132.ODM1_3_2_foundation+ODM|ODMTest132.ODM1_3_2_foundation+Address|ODMTest132.ODM1_3_2_foundation+AdminData|ODMTest132.ODM1_3_2_foundation+Alias|ODMTest132.ODM1_3_2_foundation+Annotation|ODMTest132.ODM1_3_2_foundation+Annotations|ODMTest132.ODM1_3_2_foundation+ArchiveLayout|ODMTest132.ODM1_3_2_foundation+ArchiveLayoutRef|ODMTest132.ODM1_3_2_foundation+Association|ODMTest132.ODM1_3_2_foundation+AuditRecord|ODMTest132.ODM1_3_2_foundation+AuditRecords|ODMTest132.ODM1_3_2_foundation+BasicDefinitions|ODMTest132.ODM1_3_2_foundation+Certificate|ODMTest132.ODM1_3_2_foundation+CheckValue|ODMTest132.ODM1_3_2_foundation+City|ODMTest132.ODM1_3_2_foundation+ClinicalData|ODMTest132.ODM1_3_2_foundation+CodeList|ODMTest132.ODM1_3_2_foundation+CodeListItem|ODMTest132.ODM1_3_2_foundation+CodeListRef|ODMTest132.ODM1_3_2_foundation+Comment|ODMTest132.ODM1_3_2_foundation+ConditionDef|ODMTest132.ODM1_3_2_foundation+Country|ODMTest132.ODM1_3_2_foundation+CryptoBindingManifest|ODMTest132.ODM1_3_2_foundation+DateTimeStamp|ODMTest132.ODM1_3_2_foundation+Decode|ODMTest132.ODM1_3_2_foundation+Description|ODMTest132.ODM1_3_2_foundation+DisplayName|ODMTest132.ODM1_3_2_foundation+Email|ODMTest132.ODM1_3_2_foundation+EnumeratedItem|ODMTest132.ODM1_3_2_foundation+ErrorMessage|ODMTest132.ODM1_3_2_foundation+ExternalCodeList|ODMTest132.ODM1_3_2_foundation+ExternalQuestion|ODMTest132.ODM1_3_2_foundation+Fax|ODMTest132.ODM1_3_2_foundation+FirstName|ODMTest132.ODM1_3_2_foundation+Flag|ODMTest132.ODM1_3_2_foundation+FlagType|ODMTest132.ODM1_3_2_foundation+FlagValue|ODMTest132.ODM1_3_2_foundation+FormalExpression|ODMTest132.ODM1_3_2_foundation+FormData|ODMTest132.ODM1_3_2_foundation+FormDef|ODMTest132.ODM1_3_2_foundation+FormRef|ODMTest132.ODM1_3_2_foundation+FullName|ODMTest132.ODM1_3_2_foundation+GlobalVariables|ODMTest132.ODM1_3_2_foundation+ImputationMethod|ODMTest132.ODM1_3_2_foundation+Include|ODMTest132.ODM1_3_2_foundation+InvestigatorRef|ODMTest132.ODM1_3_2_foundation+ItemData|ODMTest132.ODM1_3_2_foundation+ItemDataAny|ODMTest132.ODM1_3_2_foundation+ItemDataBase64Binary|ODMTest132.ODM1_3_2_foundation+ItemDataBase64Float|ODMTest132.ODM1_3_2_foundation+ItemDataBoolean|ODMTest132.ODM1_3_2_foundation+ItemDataDate|ODMTest132.ODM1_3_2_foundation+ItemDataDatetime|ODMTest132.ODM1_3_2_foundation+ItemDataDouble|ODMTest132.ODM1_3_2_foundation+ItemDataDurationDatetime|ODMTest132.ODM1_3_2_foundation+ItemDataFloat|ODMTest132.ODM1_3_2_foundation+ItemDataHexBinary|ODMTest132.ODM1_3_2_foundation+ItemDataHexFloat|ODMTest132.ODM1_3_2_foundation+ItemDataIncompleteDate|ODMTest132.ODM1_3_2_foundation+ItemDataIncompleteDatetime|ODMTest132.ODM1_3_2_foundation+ItemDataIncompleteTime|ODMTest132.ODM1_3_2_foundation+ItemDataInteger|ODMTest132.ODM1_3_2_foundation+ItemDataIntervalDatetime|ODMTest132.ODM1_3_2_foundation+ItemDataPartialDate|ODMTest132.ODM1_3_2_foundation+ItemDataPartialDatetime|ODMTest132.ODM1_3_2_foundation+ItemDataPartialTime|ODMTest132.ODM1_3_2_foundation+ItemDataString|ODMTest132.ODM1_3_2_foundation+ItemDataTime|ODMTest132.ODM1_3_2_foundation+ItemDataURI|ODMTest132.ODM1_3_2_foundation+ItemDef|ODMTest132.ODM1_3_2_foundation+ItemGroupData|ODMTest132.ODM1_3_2_foundation+ItemGroupDef|ODMTest132.ODM1_3_2_foundation+ItemGroupRef|ODMTest132.ODM1_3_2_foundation+ItemRef|ODMTest132.ODM1_3_2_foundation+KeySet|ODMTest132.ODM1_3_2_foundation+LastName|ODMTest132.ODM1_3_2_foundation+LegalReason|ODMTest132.ODM1_3_2_foundation+Location|ODMTest132.ODM1_3_2_foundation+LocationRef|ODMTest132.ODM1_3_2_foundation+LoginName|ODMTest132.ODM1_3_2_foundation+Meaning|ODMTest132.ODM1_3_2_foundation+MeasurementUnit|ODMTest132.ODM1_3_2_foundation+MeasurementUnitRef|ODMTest132.ODM1_3_2_foundation+MetaDataVersion|ODMTest132.ODM1_3_2_foundation+MetaDataVersionRef|ODMTest132.ODM1_3_2_foundation+MethodDef|ODMTest132.ODM1_3_2_foundation+Organization|ODMTest132.ODM1_3_2_foundation+OtherText|ODMTest132.ODM1_3_2_foundation+Pager|ODMTest132.ODM1_3_2_foundation+Phone|ODMTest132.ODM1_3_2_foundation+Picture|ODMTest132.ODM1_3_2_foundation+PostalCode|ODMTest132.ODM1_3_2_foundation+Presentation|ODMTest132.ODM1_3_2_foundation+Protocol|ODMTest132.ODM1_3_2_foundation+ProtocolName|ODMTest132.ODM1_3_2_foundation+Question|ODMTest132.ODM1_3_2_foundation+RangeCheck|ODMTest132.ODM1_3_2_foundation+ReasonForChange|ODMTest132.ODM1_3_2_foundation+ReferenceData|ODMTest132.ODM1_3_2_foundation+Role|ODMTest132.ODM1_3_2_foundation+Signature|ODMTest132.ODM1_3_2_foundation+SignatureDef|ODMTest132.ODM1_3_2_foundation+SignatureRef|ODMTest132.ODM1_3_2_foundation+Signatures|ODMTest132.ODM1_3_2_foundation+SiteRef|ODMTest132.ODM1_3_2_foundation+SourceID|ODMTest132.ODM1_3_2_foundation+StateProv|ODMTest132.ODM1_3_2_foundation+StreetName|ODMTest132.ODM1_3_2_foundation+Study|ODMTest132.ODM1_3_2_foundation+StudyDescription|ODMTest132.ODM1_3_2_foundation+StudyEventData|ODMTest132.ODM1_3_2_foundation+StudyEventDef|ODMTest132.ODM1_3_2_foundation+StudyEventRef|ODMTest132.ODM1_3_2_foundation+StudyName|ODMTest132.ODM1_3_2_foundation+SubjectData|ODMTest132.ODM1_3_2_foundation+Symbol|ODMTest132.ODM1_3_2_foundation+TranslatedText|ODMTest132.ODM1_3_2_foundation+User|ODMTest132.ODM1_3_2_foundation+UserRef
    to the text box shown in the image. Delete any previous text in the text box
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

  • XPath Expression Problem

    Hi again,
    still a newb and stillsomequestions, but hope dies at last :)
    I want to extract values from a xml file which is stored in a table.
    i have the following code:
    COLUMN div DEFAULT
    SELECT extract(value(x), '//DIV/@ ID = ''FXAC93006ENC.0001.01.00''/text()').getStringVal() AS div
    FROM versuch2 x;
    With this code ive got the following Error Message: ORA:31012: Not supported XPath Statement.
    I tried this XPath statement in SlyXML and got a boolean:true result, so i think its not a xpath problem.
    Isthere a syntax problem?
    Thx for help!

    The correct syntax for fetching attributes is different from what you did.
    Not sure which syntax is the standard, but the Oracle Version seems more intuitive (too me). Why? Because an attribute is on the same hierachy level of the xml tag and therefore should not be queried with an additional /.
    SQL> with versuch2 as (select xmltype('<doc><div id="FXAC93006ENC.0001.01.00">Test</div></doc>') xmlcol from dual)
      2  SELECT extract(xmlcol, '//div[@id="FXAC93006ENC.0001.01.00"]/ text()').getStringVal() AS div
      3  FROM versuch2 x;
    DIV
    Test
    SQL>
    SQL> btw: W3C XPath Syntax stuff: http://www.w3.org/TR/xpath#predicates
    Message was edited by:
    Sven W.

  • Xpath Namespace problem

    Hi,
    I'm facing a problem while reading an xpath element which has namespace attached.
    The xml document is as follows
    <ns0:_root  xmlns:ns0="http://www.oracle.bt.bp.osm/GPRLN">
    <ns0:Port_and_Routing_Details_g>
    <ns0:Action_Code>
    <ns0:Code1>Add</ns0:Code1>
    <ns0:Code2>Delete</ns0:Code2>
    <ns0:Code3>Update</ns0:Code3>
    </ns0:Action_Code>
    </ns0:Port_and_Routing_Details_g>
    <ns0:Extended_Quantity>1</ns0:Extended_Quantity>
    <ns0:Status>Pending</ns0:Status>
    <ns0:Description/>
    </ns0:_root> In the above xml document i want to capture the text node of <ns0:Code3>Update</ns0:Code3> i.e. I want to get Update as a result.
    I'm using the following java program to to get the value by using xpath but not succeeded.
    public class XMLParsing {
         public static void main(String[] args)
             try {
                       DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
             domFactory.setNamespaceAware(true);
             DocumentBuilder builder = domFactory.newDocumentBuilder();
             Document doc = builder.parse("E:\\sample.xml");
             XPathFactory factory = XPathFactory.newInstance();
             XPath xpath = factory.newXPath();
              XPathExpression fax = xpath.compile("//ns0:Port_and_Routing_Details_g/ns0:Action_Code/ns0:Code3/text()");
                        Object result = fax.evaluate(doc, XPathConstants.NODESET);
              NodeList nodes = (NodeList) result;
              int len = nodes.getLength();
              System.out.println(len);
              for (int i=0; i<len;i++){
                   System.out.println(nodes.item(i).getNodeValue());
             catch (ParserConfigurationException e) {
              e.printStackTrace();
              catch(SAXException e){
                   e.printStackTrace();
              catch(IOException e) {
                   e.printStackTrace();
              catch(XPathExpressionException e){
                   e.printStackTrace();
      }Anybody please help me on this issue
    Thanks

    Hi,
    put bolded code in your program.
    It will resolve your problem
    public class XMLParsing {
         public static void main(String[] args)
         try {
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
         domFactory.setNamespaceAware(true);
         DocumentBuilder builder = domFactory.newDocumentBuilder();
         Document doc = builder.parse("E:\\sample.xml");
    *NamespaceContext ctx = new NamespaceContext() {*
    *public String getNamespaceURI(String prefix) {*
    String uri;
    if (prefix.equals("ns0"))
    uri = "http://www.oracle.bt.bp.osm/GPRLN";
    else if (prefix.equals("ns2"))
    uri = "http://www.davber.com/sales-format";
    else
    uri = null;
    return uri;
    *public Iterator getPrefixes(String val) {*
    *     return null;*
    *// Dummy implemenation - not used!*
    *public String getPrefix(String uri) {*
    return null;
         XPathFactory factory = XPathFactory.newInstance();
         XPath xpath = factory.newXPath();
    xpath.setNamespaceContext(ctx);
         XPathExpression fax = xpath.compile("//ns0:Port_and_Routing_Details_g/ns0:Action_Code/ns0:Code3/text()");
    Object result = fax.evaluate(doc, XPathConstants.NODESET);
              NodeList nodes = (NodeList) result;
              int len = nodes.getLength();
              System.out.println(len);
              for (int i=0; i<len;i++){
                   System.out.println(nodes.item(i).getNodeValue());
         catch (ParserConfigurationException e) {
              e.printStackTrace();
              catch(SAXException e){
                   e.printStackTrace();
              catch(IOException e) {
                   e.printStackTrace();
              catch(XPathExpressionException e){
                   e.printStackTrace();
    }

Maybe you are looking for

  • Business Catalyst connector not working in DW CC 2014.1 despite an update yesterday 30/10/2014

    Hi there, I upgraded my DW CC 2014.1 via CC yesterday. Today I am trying to work on a new BC site I am developing. When I go to Site, Manage Sites, and then select Import Business Catalyst Site I get the following message: Business Catalyst support i

  • Comcast might possibly be the dumbest company I've ever dealt with.

    After telling me for over a month that my address was serviceable and me purchasing a 130$ cable/modem (that I now can't return), I was told by Comcast that my house was unserviceable and that if I wanted to have their services I would have to pay 73

  • Export Media to H.264 Blu-Ray 720p 30fps?

    I have video I've shot on a point and shoot camera which shoots video at 720p (1280x720) at 30fps.   I'm able to import it into Premier CS4, edit, etc.   Then when I go to export the media to Media Encoder I'm looking for the preset to match this inp

  • Download the CC version of LR or continue with my standalone version?

    I already have the standalone version of LR 5. Decided to join CC when the new photography deal came out. I downloaded Photoshop, but wondered if there was an advantage to downloading LR since I already have it. Is the CC version different/better? Or

  • Creating a navigation JComboBox

    I have searched High and low for a simple set of steps on how to add a jcombobox to an ADF form to do record navigation. I have opened the data controls and selected the field I want to use as the combobox, selected combobox from the drag and drop as