Xpath 1

Given a response like this :
  <?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ConversionRateResponse xmlns="http://www.webserviceX.NET/">
  <ConversionRateResult>0.8331</ConversionRateResult>
  </ConversionRateResponse>
  </soap:Body>
  </soap:Envelope>How do I in Oracle 10.2.x.x get the ConversionRateResult out ?
This works fine in 11 g (xpath 2 I guess):
  select extractvalue(x_response,'//*:ConversionRateResult') into p_svar from dual;I have tried like this (and manuy combinations - obviously not the correct one)
namespaces := 'xmlns:soap="http://www.schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.webserviceX.NET/"';
select extractvalue(x_response,'/soap:Envelope/soap:Body/ConversionRateResponse/ConversionRateResult', namespaces) into p_svar from dual;
..Regards
Mette
PS I hate namespaces - and I think they do hate me too :-)

You have a mismatch between the two declared soap namespaces :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" ...
namespaces := 'xmlns:soap="http://www.schemas.xmlsoap.org/soap/envelope/" ...This should work better :
extractValue( x_response
            , '/soap:Envelope/soap:Body/ConversionRateResponse/ConversionRateResult'
            , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.webserviceX.NET/"' )

Similar Messages

  • XPath expression failed to execute.

    Hi Everybody ,
    I am working  AIA PIP 3.1 for JDE E1.I am facing some errors so that i can't proceed.
    See the log errors as below:
    javax.xml.ws.soap.SOAPFaultException: XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:processXSLT('xsl/Xform_BillOfMaterialsListABM_to_BillOfMaterialsListAXML.xsl',bpws:getVariableData('InitialLoadBillOfMaterialsListReqMsg','InitialLoadBillOfMaterialsList'),bpws:getVariableData('Parameters')). The XPath expression failed to execute; the reason was: oracle.fabric.common.xml.xpath.XPathFunctionException: javax.xml.transform.TransformerException: oramds:/deployed-composites/default/InitialLoadBillOfMaterialsListJDEE1toAgileImpl_rev1.0/xsl/Xform_BillOfMaterialsListABM_to_BillOfMaterialsListAXML.xsl<Line 18, Column 271>: XML-22044: (Error) Extension function error: Error invoking 'lookupXRef':'oracle.tip.xref.exception.RepositoryException: lookup could not find values in column name "AGILE_01" for table name "oramds:/apps/AIAMetaData/xref/ITEM_ITEMID.xref" using reference column name "JDEE1_01" and reference value "731882::M30" Please ensure lookup criteria has a match.'. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
    Please reply me ASAP,
    Waiting for your response.....
    Regards
    Jyoti Nayak

    Hi,
    Ya i checked the data for same table,but i didn't get any XREF related information in xref_data table.
    Did you mean that, data should already present under AIAFPINST_XREF.Probably xref is meant for storing dynamic value.
    Please check the above error and reply me soon.
    With Regards
    Jyoti Nayak

  • Problem retrieving a list of values with XPATH

    Hi,
    I am trying to get a list of all 'Fields' (under the SubscriptionList -> EconomicIndicator -> Code) which have 'Provider' =DJ.
    I am using the below xpath expression. But It is not working. I tried other variations but none of them return mulitple items.
    Can some one please tell me if Iam missing something.
                   XPathExpression xPathExpression= xpath.compile("/SubscriptionList/EconomicIndicator[*]/Code[Provider=DJ]/Fields");
                   NodeList result = (NodeList)xPathExpression.evaluate(doc, XPathConstants.NODESET);
              for (int i = 0; i < result.getLength(); i++) {
                   Element element = (Element)result.item(i);
              System.out.println(element.getNodeValue());
    <?xml version="1.0" encoding="UTF-8"?>
    <SubscriptionList>
    <DefaultEconomicIndicatorName>US ADP Employment Change</DefaultEconomicIndicatorName>
    <!--GE IFO - Business Climate-->
    <EconomicIndicator>
    <Name>GE IFO - Business Climate</Name>
    <Active>0</Active>
    <OutputFormat></OutputFormat>
    <OutputUnits>1</OutputUnits>
    <StartDate>2007-06-22T03:50:00</StartDate>
    <EndDate>2007-06-22T04:10:00</EndDate>
    <Code>
    <Provider>BB</Provider>
    <Service>Index</Service>
    <InstrumentCode>GRIFPBUS</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB1</Provider>
    <Service>Index</Service>
    <InstrumentCode>GRIFPBUS</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB2</Provider>
    <Service>Index</Service>
    <InstrumentCode>GRIFPBUS</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB3</Provider>
    <Service>Index</Service>
    <InstrumentCode>GRIFPBUS</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>RFA</Provider>
    <Service>IDN_SELECTFEED</Service>
    <InstrumentCode>DEBUSS=ECI</InstrumentCode>
    <FID>356</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>DJ</Provider>
    <Service></Service>
    <InstrumentCode>GM_IFO</InstrumentCode>
    <FID></FID>
    <Units>1</Units>
    <Fields>GM_IFO_BUSSENTIMENT_Cur</Fields>
    </Code>
    <Code>
    <Provider>DJS</Provider>
    <Service></Service>
    <InstrumentCode>GM_IFO</InstrumentCode>
    <FID></FID>
    <Units>1</Units>
    <Fields>GM_IFO_BUSSENTIMENT_Cur</Fields>
    </Code>
    </EconomicIndicator>
    <!--GE Producer Prices (MoM)-->
    <EconomicIndicator>
    <Name>GE Producer Prices (MoM)</Name>
    <Active>0</Active>
    <OutputFormat></OutputFormat>
    <OutputUnits>1</OutputUnits>
    <StartDate>2007-06-20T01:50:00</StartDate>
    <EndDate>2007-06-20T02:10:00</EndDate>
    <Code>
    <Provider>BB</Provider>
    <Service>Index</Service>
    <InstrumentCode>GRPFIMOM</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB1</Provider>
    <Service>Index</Service>
    <InstrumentCode>GRPFIMOM</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB2</Provider>
    <Service>Index</Service>
    <InstrumentCode>GRPFIMOM</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB3</Provider>
    <Service>Index</Service>
    <InstrumentCode>GRPFIMOM</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>RFA</Provider>
    <Service>IDN_SELECTFEED</Service>
    <InstrumentCode>DEPPI=ECI</InstrumentCode>
    <FID>356</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    </EconomicIndicator>
    <!--UK CBI Industrial Trend-->
    <EconomicIndicator>
    <Name>UK CBI Trends - Orders</Name>
    <Active>0</Active>
    <OutputFormat></OutputFormat>
    <OutputUnits>1</OutputUnits>
    <StartDate>2007-06-21T05:50:00</StartDate>
    <EndDate>2007-06-21T06:10:00</EndDate>
    <Code>
    <Provider>RFA</Provider>
    <Service>IDN_SELECTFEED</Service>
    <InstrumentCode>GBCBIO=ECI</InstrumentCode>
    <FID>356</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    </EconomicIndicator>
    <!--UK CBI Industrial Trend-->
    <EconomicIndicator>
    <Name>UK CBI Distributive - Trades</Name>
    <Active>0</Active>
    <OutputFormat></OutputFormat>
    <OutputUnits>1</OutputUnits>
    <StartDate>2007-06-21T05:50:00</StartDate>
    <EndDate>2007-06-21T06:10:00</EndDate>
    <Code>
    <Provider>RFA</Provider>
    <Service>IDN_SELECTFEED</Service>
    <InstrumentCode>GBCBIS=ECI</InstrumentCode>
    <FID>356</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    </EconomicIndicator>
    <!--US Unit Labor Costs-->
    <EconomicIndicator>
    <Name>US Unit Labor Costs</Name>
    <Active>0</Active>
    <OutputFormat></OutputFormat>
    <OutputUnits>1</OutputUnits>
    <StartDate>2007-09-06T08:20:00</StartDate>
    <EndDate>2007-09-06T08:40:00</EndDate>
    <Code>
    <Provider>BB</Provider>
    <Service>Index</Service>
    <InstrumentCode>COSTNFR%</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB1</Provider>
    <Service>Index</Service>
    <InstrumentCode>COSTNFR%</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB2</Provider>
    <Service>Index</Service>
    <InstrumentCode>COSTNFR%</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>BB3</Provider>
    <Service>Index</Service>
    <InstrumentCode>COSTNFR%</InstrumentCode>
    <FID>PX_LAST</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>RFA</Provider>
    <Service>IDN_SELECTFEED</Service>
    <InstrumentCode>USLCTS=ECI</InstrumentCode>
    <FID>356</FID>
    <Units>1</Units>
    <Fields></Fields>
    </Code>
    <Code>
    <Provider>DJ</Provider>
    <Service></Service>
    <InstrumentCode>US_PROD2_REV</InstrumentCode>
    <FID></FID>
    <Units>1</Units>
    <Fields>US_PROD2_REV_UNITLABORCOST_CurQChgPct</Fields>
    </Code>
    <Code>
    <Provider>DJS</Provider>
    <Service></Service>
    <InstrumentCode>US_PROD2_REV</InstrumentCode>
    <FID></FID>
    <Units>1</Units>
    <Fields>US_PROD2_REV_UNITLABORCOST_CurQChgPct</Fields>
    </Code>
    </EconomicIndicator>
    </SubscriptionList>

    Hi DrClap,
    I have a similar problem again. This time I am trying to extract a list of values from a xsd. Below is the code that I am using.
              try{
                   djxsd = new FileInputStream("djei-3.1.xsd");
                   XPathFactory factory = XPathFactory.newInstance();
                   XPath xpath = factory.newXPath();
                   SimpleNamespaceContext nsContext = new SimpleNamespaceContext();
                   xpath.setNamespaceContext(nsContext);
                   nsContext.addNamespace("xs", "http://www.w3.org/2001/XMLSchema");
                   nsContext.addNamespace("xsi","http://www.w3.org/2001/XMLSchema-instance");
                   +//String exp = "//xs:element/@name/text()";+               
    String exp = "/xs:schema/xs:group/xs:sequence/xs:element";
                   XPathExpression xPathExpression= xpath.compile(exp);
                   NodeList result = (NodeList)xPathExpression.evaluate(doc, XPathConstants.NODESET);
                   FileOutputStream outputfile = new FileOutputStream("log.txt");
              for (int i = 0; i < result.getLength(); i++) {
                   Element element = (Element)result.item(i);
                   String output = element.getTextContent().trim();
                   if(output.length() > 0)
                        outputfile.write(output.getBytes());
                        //System.out.println(output);
    Highlighted in Itlalics is the actual expression that I want to use. For some reason this is not working .. it returns nothing.
    The other expression works. Please let me know if there is anything wrong with the expression.
    THE XSD FILE
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified">
         <xs:element name="DJEconomicIndicator">
              <xs:complexType>
                   <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:group ref="allgroup"/>
                   </xs:sequence>
                   <xs:attributeGroup ref="TopGrp-Attributes"/>
              </xs:complexType>
         </xs:element>
         <xs:group name="allgroup">
              <xs:sequence>
                   <!-- ==================== CPI ========================== -->
                   <xs:element name="US_CPI_CurMonChgPct" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation> US Consumer Price Index </xs:documentation>
                             <xs:appinfo> CPI </xs:appinfo>
                        </xs:annotation>
                        <xs:complexType>
                             <xs:annotation>
                                  <xs:appinfo> MoM Pct Change (Current Period) </xs:appinfo>
                             </xs:annotation>
                             <xs:simpleContent>
                                  <xs:extension base="xs:double">
                                       <xs:attributeGroup ref="common-month"/>
                                       <xs:attributeGroup ref="common-attributes"/>
                                  </xs:extension>
                             </xs:simpleContent>
                        </xs:complexType>
                   </xs:element>
                   <xs:element name="US_CPI_ExpMonChgPct" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation> US Consumer Price Index </xs:documentation>
                             <xs:appinfo> CPI </xs:appinfo>
                        </xs:annotation>
                        <xs:complexType>
                             <xs:annotation>
                                  <xs:appinfo> Forecast MoM Pct Change (Current Period) </xs:appinfo>
                             </xs:annotation>
                             <xs:simpleContent>
                                  <xs:extension base="xs:double">
                                       <xs:attributeGroup ref="common-month"/>
                                       <xs:attributeGroup ref="common-attributes"/>
                                  </xs:extension>
                             </xs:simpleContent>
                        </xs:complexType>
                   </xs:element>
                   <!-- ==================CPI Unrounded==================== -->
                   <xs:element name="US_CPI_Unrounded_CurMonChgPct" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation> US Consumer Price Index </xs:documentation>
                             <xs:appinfo> CPI UnRounded</xs:appinfo>
                        </xs:annotation>
                        <xs:complexType>
                             <xs:annotation>
                                  <xs:appinfo> MoM Pct Change (Current Period) </xs:appinfo>
                             </xs:annotation>
                             <xs:simpleContent>
                                  <xs:extension base="xs:double">
                                       <xs:attributeGroup ref="common-month"/>
                                       <xs:attributeGroup ref="common-attributes"/>
                                  </xs:extension>
                             </xs:simpleContent>
                        </xs:complexType>
                   </xs:element>
                   <!-- ==================CPI Core Index==================== -->
                   <xs:element name="US_CPI_Core_CurMonChgPct" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation> US Consumer Price Index </xs:documentation>
                             <xs:appinfo> CPI Core </xs:appinfo>
                        </xs:annotation>
                        <xs:complexType>
                             <xs:annotation>
                                  <xs:appinfo> MoM Pct Change (Current Period) </xs:appinfo>
                             </xs:annotation>
                             <xs:simpleContent>
                                  <xs:extension base="xs:double">
                                       <xs:attributeGroup ref="common-month"/>
                                       <xs:attributeGroup ref="common-attributes"/>
                                  </xs:extension>
                             </xs:simpleContent>
                        </xs:complexType>
                   </xs:element>
                   <xs:element name="US_CPI_Core_ExpMonChgPct" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation> US Consumer Price Index </xs:documentation>
                             <xs:appinfo> CPI Core </xs:appinfo>
                        </xs:annotation>
                        <xs:complexType>
                             <xs:annotation>
                                  <xs:appinfo> Forecast MoM Pct Change (Current Period) </xs:appinfo>
                             </xs:annotation>
                             <xs:simpleContent>
                                  <xs:extension base="xs:double">
                                       <xs:attributeGroup ref="common-month"/>
                                       <xs:attributeGroup ref="common-attributes"/>
                                  </xs:extension>
                             </xs:simpleContent>
                        </xs:complexType>
                   </xs:element>

  • Appending Xpath Value to a variable in For Each loop

    So I am iterating thru an XML File collection inside a ForEach container. I have an XML Task within this loop of type Xpath.
    The Xpath expression on each file evaluates to a value which I want to append as I keep iterating.
    How do I go about doing this?? I tried something like User::CheckSum =+ User::CheckSum but it gives and error and I am not sure on which property should it be applied to.
    Please understand that it is not one file with multiple nodes but multiple XML files in my scenario.
    Any help is much appreciated
    SM

    I do not think the variable's value gets preserved between hops, anyways, it does not look like a valid approach.
    Use the XMLFile Source in the ForEach Loop and capture the needed value into a package variable that you can keep appending to say in a Script Task.
    Arthur My Blog

  • Syntax and format of a IF statement in formula XPath in a InfoPath field

    Good day
    I needed assistance with IF statement syntax in a InfoPath field formula.
    If Field_1 = null
    concat(substring-before(txtComponentNo1, "."), ".", substring-before(field17, "."), ".", substring-after(field17, "."))
    Else
    concat(substring-before(txtComponentNo1, "."), ".", substring-before(field17, "."), ".", substring-after(field17, ".")+1)
    or in Advance XPath
    If Field_1 = null
    concat(substring-before(../../../my:grpComponent_1/my:grpComponent1/my:txtComponentNo1, "."), ".", substring-before(../../my:field17, "."), ".", substring-after(../../my:field17, "."))
    Else
    concat(substring-before(../../../my:grpComponent_1/my:grpComponent1/my:txtComponentNo1, "."), ".", substring-before(../../my:field17, "."), ".", substring-after(../../my:field17, ".") + 1)
    Thanks

    Hi,
    Here is the good explanation of what you are looking for.
    http://blogs.msdn.com/b/infopath/archive/2006/11/27/conditional-default-values.aspx
    and please check this as well for basic understanding
    http://www.bizsupportonline.net/infopath2010/if-else-statements-conditions-rules-infopath-2010.htm
    Krishana Kumar http://www.mosstechnet-kk.com

  • Help with if statement in XPATH

    Hi,
    I´m using XPath to return a value for a conditional Branch in OSB, I understand that it is supposed to work with standard XPath so I post this question in this forum:
    What I want to do should be simple but have not worked for me, I want to do an IF statement and to return one value in the then part or another value in else.
    if the statement is acomplished I want tu return just a string and if it does not acomplish then in the else return a value from an Xpath expresion:
    here something similar of what I´m trying:
    if (./imp:iniciarCambio/cambios/bea:ListaDeCambios/bea:Cambio/bea:campoNombre/text() = "Name")
    then M6yBilling
    else ./imp:iniciarCambio/cambios/bea:companiaTipo/text()
    The part that is not working is where I want to return M6yBilling if the statement acomplishes, I have tried "M6yBilling" also 'M6yBilling' and fn:string(M6yBilling) but none is working at all.
    Any ideas?
    Kind Regards,
    Gerardo J

    analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
    CASE
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
    Incorporating either of these into your query should assist you in returning the desired results.

  • Xpath field details not getting displayed

    Hi all,
    I am working on a idoc to file scenario, where I want to refer the receiver to be determined based upon certain condition or values that get populated for a particular field (using receiver determination). But the problem is that when I click on the condition tab on receiver determination I get a warning "Problem loading schema description"
    with message as
    "Message interface does not exist in any software components installed on this business system"
    But since it is an Idoc at the source we dont have any msg interfaces, further if i neglect this warning message and go further, I am not getting the fields or details of the Idoc structure getting displayed in the xpath.
    But the same when I use for a file scenario(file as sender) I get the details of the context object if any.. Let me know how to resolve this..
    Thanks in advance
    Regards,
    Nithiyanandam

    Hi,
    Yes you coudl add the missing Software component as per below steps
    Even if you open Business system in Integration Directory, at last tab "Other Attributes" --> you will find the list of software components.
    Press the tab Third Party service to verify the list against SLD.
    If its not avaialbel in SLD
    1. Goto System Landscape Directory
    2. select Business Landscape and slect the apporpriate Business system and open it. (Click the name of BS)
    3. There you will get the list of Software components added in it.
    4. Verify the technical system name.
    5. Also verify if same technical system name is used after importing the software component in Integration Repository (IR).
    Goto IR -- > Explore the SCV -->Double click on name of software component version -->Check Interface Import as Import of RFC and have the same details  in Connection data as per technical system
    If everything is setup just refresh the SLD_CACH and import the scenario once again in Integration Directoy and process it.
    You will see the IDOC in Business system.
    Thanks
    Swarup
    Edited by: Swarup Sawant on Feb 4, 2008 8:00 AM

  • How to Get xml Attribute value from a given  xpath

    i'm building an xml from 3 columns a,b,c using 'SELECT EXTRACT (XMLELEMENT ("ROOT",.........)'
    and my xml looks something like this
    <ROOT>
    <categories>
    <catogory value="col a value" display="true"/>
    <catogory value="col b value" display="false"/>
    <catogory value="col c value" display="false"/>
    </categories>
    <DATAS>
    </DATA>
    </ROOT>
    now under the datas node i want to use xpath like this
    (case when '/root/categories/catogory/[@display="true"]' then '/root/categories/catogory/@value' else 0 end)
    so tat i get values under data node based on display attributes.... is it possible..
    if not is ther any alternative way of using xpath

    What version of Oracle (4 digits)?
    Are you trying to populate the Data node when you are building the XML originally via your SQL/XML statement or are you talking about modifying some existing XML to add more nodes to it based on data in the XML already?

  • Does SOA BPEL 11.1.7.0 support XPath 2.0 in XSLT mapping?

    Dear Oracle support,
    I am using SOA Suite 11.1.1.7.0 (local development) and 11.1.1.6.0 (in production, but will upgrade to 7). I came to the requirements need to do very complicated mapping using XSLT in BPEL. I would like to use some features of XPath 2.0.
    Does SOA 11.1.1.6.0 or 11.1.1.7.0 have supported XPath 2.0? If not yet, is there any plan to support in the future?
    Thank you in advance for your response,
    Alena Li

    Hi Alena Li,
    Firstly, this is not Oracle support, this is Oracle forums...
    https://wikis.oracle.com/display/Forums/Forums+FAQ
    SOA supports *some* features of XPath 2.0 in XSLT, the infrastructure also supports XSLT 2.0, but JDEV mapper does not...
    Check docs here...
    http://docs.oracle.com/cd/E28280_01/dev.1111/e10224/bp_appx_functs.htm#SOASE2127
    Cheers,
    Vlad

  • Is there any possibility to combine XPath with SAX in Java?

    HI Gentlemen,
    I have an XML instance to parse. One solution works with XPath and Document builder. However, the tree in memory is too big so that I can not build it in my storage (8 GB). Does anyone of you know a method where I use an XPath expression (Java) to select a node but with a better parser (e g SAX) which is not so space hungry? Direct access of nodes is obligatory.
    Thanks, kind regards from
    Miklos HERBOLY

    As SAX  parsers do not build a DOM structure and XPath requires a DOM structure to select elements from, XPath is not usable with SAX, but some analysers support setting the XPath expressions to analyse before invoking the SAX parser and provide the result for XPath expressions.
    Refer
    https://code.google.com/p/xpath4sax/

  • 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.

  • Is it possible to throw a BPELFault from a custom xpath function?

    I'm probably revealing my lack of java chops here, but I'd like to know if there's a way to throw a BPELFault from the "call" method within a custom xpath function.
    The interface for IXPathFunction seems to dictate that "call" throws only an XPathFunctionException and the bpel server doesn't handle this exception properly. It records the exception in the logs but then the process just dies.
    Right now I have this (simplified code):
    public Object call(IXPathContext context,
    List args) throws XPathFunctionException
    if (args.size() == 1)
    // do some stuff and return a value
    throw new XPathFunctionException( "hexToInt() requires one string argument." );
    What I want to have is something like this:
    public Object call(IXPathContext context,
    List args) throws BPELFault
    if (args.size() == 1)
    // do some stuff and return a value
    BPELFault fault = new BPELFault(
    new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2003/03/business-process/",
    "selectionFailure"));
    fault.setPart("code", "intToHex");
    fault.setPart("summary", "hexToInt() requires one string argument.");
    throw fault;
    If I do this, the compiler rejects it saying that "call" must throw XPathFunctionException. Is there a way to extend the IXPathFunction interface to allow it to throw a useful fault?
    Thanks!
    Sean

    Yeah, I'm using that patch (otherwise the process just crashes and you don't have a chance to catch the fault, even in a catchAll). Within the catchAll you can get the details from the error with something like this:
    <copy>
    <from expression="concat(ora:getFaultName(),'')"/>
    <to variable="processFault" part="payload" query="/ns4:summary"/>
    </copy>
    <copy>
    <from expression="concat(ora:getFaultAsString(),'')"/>
    <to variable="processFault" part="payload" query="/ns4:detail"/>
    </copy>

  • How can I call a stateful webservice from a user-defined XPath function?

    I'm calling a stateful webservice from a BPEL process using a PartnerLink which implements Custom Header Handler classes to handle the session state, storing the cookie as a property of the PartnerLink.
    I'd also like to call this same stateful webservice, in the same session, from a user-defined XPath function enabling me to call this from an XSL Transformation.
    Is this in any way possible? Can I access the cookie and attach it to the webservice call made by the user-defined XPath function?

    Actually, as long as the servlet returns valid javascript, you can indeed "call it" from the client. It will initiate a request and return the result to the browser.
    This example uses Perl, but it could be easily modified to go to a servlet instead.
    Note that it is only supported in DOM browsers (IE6+/NN6+/etc)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <html>
    <head>
    <title> Test server-side JS </title>
    </head>
    <body>
    <script type="text/javascript">
    function checkIt(variable, value)
    var newScript = "cgi-bin/validateJS.cgi?"+variable+"="+value;
    var body = document.getElementsByTagName('body').item(0)
    var scriptTag = document.getElementById('loadScript');
    if(scriptTag) body.removeChild(scriptTag);
    script = document.createElement('script');
    script.src = newScript;
         script.type = 'text/javascript';
         script.id = 'loadScript';
         body.appendChild(script)
    </script>
    <p>Test.</p>
    <form id="f1" action="">
    <input type="text" name="t1" id="t1" onChange="checkIt(this.name, this.value)">
    </body>
    </html>
    validateJS.cgi
    #!/opt/x11r6/bin/perl
    use CGI qw(:all);
    my @valArray = split(/=/,$ENV{QUERY_STRING});
    print "Content-type: text/javascript\n\n";
    # myPass is the password
    $myPass = "foobar";
    if ("$valArray[1]" eq "$myPass")
    print "alert(\"Success!!\")";
    else
    print "alert(\"Failure!!\")";

  • Getting the XPath from a Node

    Hey Folks, have a scenario where i need to link my data, i.e one node points to another node, e.g
    <data>
    <liability id="1">
    <value> 10000 </value>
    </liability>
    <asset id = "2">
    <value> 20000 </value>
    </asset>
    </data>
    so take the case above, i have a house which is an asset and i have a mortgage(liability) on that house, now i want to show that in my asset that there is a liability on this asset, so i need to come up with a way to link my asset to a liability, now easiest way in my thinking is just point to the XPath of the liability!! Now problem is this, at the data level that im working at, i know what data node im working on but i dont know its absolute path, in my case the above XML is just a snippet of what im dealing with, there is more hierarchical levels in my document!! Maybe im blind but i couldnt see from the API how to get the XPath of a node?? is there existing API which does this or will i have to go ahead and write something to come up with the XPath!! or does anyone have any other suggestions as to how i would do my link??
    The way i see my XML when finished is something like this
    <data>
    <liability id="1">
    <value> 10000 </value>
    </liability>
    <asset id = "2">
    <value> 20000 </value>
    <liability> /data/liability[@id='1'] </liability>
    </asset>
    </data>
    any thoughts are welcome,
    cheers,
    LL

    A better design would be to make your "id" attribute the key... looking back at your post, it seems that you have done that already. So your XML should just look something like this:<data>
    <liability id="1">
    <value> 10000 </value>
    </liability>
    <asset id = "2" liabilityid="1">
    <value> 20000 </value>
    </asset>
    </data>Then when your code needs to match the liability to the asset, you can easily build the XPath to find it. (Of course if there can be more than one liability per asset, you shouldn't use a liabilityid attribute as I did in the example.)
    PC&#178;

  • Error(64) : invalid xpath in JDeveloper 10.1.3.1 Developer

    Hi,
    I am migrating the BPEL Project which was desinged for the BPEL(10.1.2) to SOA Suite using the JDeveloper 10.1.3.1 Developer Preview version.
    The taken the project which is buildin and deploying correctly in the BPEL Desg&ser (10.1.2).
    But the same project is not compiling in the newer preview version.i got invalid xpath exception.
    my xpath is like
    bpws:getVariableData('inputVariable','payload','/client:commonProjectProcessRequest/client:input/ns1:listOfProducts')
    if i change like this xpath, woking fine...
    bpws:getVariableData('inputVariable','payload','/client:commonProjectProcessRequest/client:input')
    the element defined as string in wsdl.however am expecting in runtime process will recive an xml string as a value input element so the xpath will work fine..
    is the any facility turn of xpath validation while building bpel project in the jdev10.1.3.1. preview version.
    could you please any one give me solution ?
    Thanks
    bogi

    yes, i found an URL and I try to access this via browser, and the following message appears:
    Error instantiating web-application
    Error compiling :C:\My Documents\Java\Webservice\Service3\public_html: Syntax error in source or compilation failed in: E:\master\Oracle JDeveloper 10.1.3 Early Access\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\application-deployments\current-workspace-app\Webservice-Service3-webapp\galih\service\runtime\MyWebService1SoapHttp_Tie.java E:\master\Oracle JDeveloper 10.1.3 Early Access\jdev\system\oracle.j2ee.10.1.3.34.12\embedded-oc4j\application-deployments\current-workspace-app\Webservice-Service3-webapp\galih\service\runtime\GalihServiceService_SerializerRegistry.java:36: error #300: MyWebService1_getMessage_ResponseStruct__LiteralSerializer not found in class galih.service.runtime.GalihServiceService_SerializerRegistry
    CombinedSerializer serializer = new galih.service.runtime.MyWebService1_getMessage_ResponseStruct__LiteralSerializer(type, DONT_ENCODE_TYPE);
    ^
    1 error

  • Using the variable placeholder ? in an XPath expression

    I'm trying to using the variable operator (?) in an Oracle prepared statement used in a query where clause. Here is the query:
    select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
          from AUDITED_EVENT_XML_MIN e,
             XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
                    '/xae:auditable-event'
                    PASSING e.xml_event_content
                    COLUMNS
                    APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
                    VERSION          VARCHAR2(255) PATH 'xae:version',
                    EVENT_TYPE       VARCHAR2(255) PATH 'xae:event-type',
                    SENDING_SITE     VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
                    RECEIVING_SITE   VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
                    EVENT_ID         VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
                where existsNode(E.XML_EVENT_CONTENT, '/xae:auditable-event[xae:event-type=?]','xmlns:xae="http://gov/va/med/datasharing/audit/endpoint/audit"') = 1This code works when the ? is replaced with "aValue". I need to use the ? so that my Java client can pass a variable value into the query.
    Is this a supportable feature or am I doing something wrong?
    I didn't see any examples in the Oracle XML DB Developers Guide where there was a ? in an XPath expression.
    I also tried "?" with the same issue...
    Here is the version info:
    SQL*Plus: Release 11.1.0.6.0 - Production on Mon Sep 10 18:41:55 2012
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsAny assistance would be greatly appreciated.
    Thanks in advance...
    Edited by: flyeagle5683 on Sep 10, 2012 5:49 PM

    select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
          from AUDITED_EVENT_XML_MIN e,
             XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
                    '/xae:auditable-event'
                    PASSING e.xml_event_content
                    COLUMNS
                    APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
                    VERSION          VARCHAR2(255) PATH 'xae:version',
                    EVENT_TYPE       VARCHAR2(255) PATH 'xae:event-type',
                    SENDING_SITE     VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
                    RECEIVING_SITE   VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
                    EVENT_ID         VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
                where XMLEXISTS(
                           'declarre namespace xae ="http://gov/va/med/datasharing/audit/endpoint/audit"; (: :)
                            $XML/xae:auditable-event[xae:event-type=$VALUE]'
                            passing e.xml_event_content as "XML",
                                      :1 as "VALUE"
                ) or you can do
    select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
          from AUDITED_EVENT_XML_MIN e,
             XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
                    '/xae:auditable-event'
                    PASSING e.xml_event_content
                    COLUMNS
                    APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
                    VERSION          VARCHAR2(255) PATH 'xae:version',
                    EVENT_TYPE       VARCHAR2(255) PATH 'xae:event-type',
                    SENDING_SITE     VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
                    RECEIVING_SITE   VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
                    EVENT_ID         VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
          WHERE EVENT_TYPE = :1Edited by: mdrake on Sep 10, 2012 7:23 PM
    Edited by: mdrake on Sep 10, 2012 7:24 PM

Maybe you are looking for

  • POSTing to a website through HTML form

    Hello, I've been trying to write a program that accesses a website that requires you to login first. Here's the core of my code:      try{                BufferedReader in = new BufferedReader(new InputStreamReader(site.openStream()));               

  • Hp deskjet F380 all in one printer

    How do I install drives for my hp deskjet f380 printer?

  • Transfer Order printing issue

    Hi, log. executioners ) I've faced such an issue while printing TO via standard WM print functionality. TO was created for moving batches which has no SLED maintained in it's master and printed using form LVSTSOLO. SLED was missing in a document. I s

  • Work scheduling view and warehouse management view

    Can any one explain what is Work scheduling view and where it need to be extended fro raw material or Finished or Semi finished

  • How to Convert OST Data to PST Data

    Please sujest me ... I accidently deleted exchange ID for pop/smtp configure for exchange server  ( for access mail by Internet ) after configuration and remove ID of exchange server ( Local Exchange ) then i found files not found in outlook because