Xpath expression to get depth child element

Hi
I wanted to find the depth element (sub isuer) in the hierarchy of 93699V issuer through xpath expression .
<?xml version="1.0" encoding="UTF-8"?>
<issuer id="93699V">/>
<subissuer id="06U99A">
<subissuer id="52729N">
<subissuer id="37932J">
<subissuer id="322995"/>
<subissuer id="35906P">
<subissuer id="001575"/> //child of issuer 93699V. since no further child
<subscriber id="771758"/> //child of issuer 93699V.since no further child
</subissuer>//end of 37932J
</subissuer>//end of 52729N
</subissuer> //end of 06U99A
</subissuer>
<subissuer id="06099K">
<subissuer id="06N99R"/>//child of issuer 93699V.since no further child
</subissuer>
<subissuer id="715680"/> ////child of issuer 93699V.since no further child
</issuer>
what is the xpath expression to find the depth child of 93699V.i .e o/p is as follows.Since now we have four depth element.
001575
771758
06N99R
715680
Please let me know the xpath expression to get depth sub issuer

Not sure if this helps, there is a section about creating loops in the Workbench ES2 Help at http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/000187.html#1032146. Another way would be to use a custom component as you suggest but you can do it in Workbench as well.
Hope that helps..
...Gil

Similar Messages

  • How get all child elements from XML

    Hi
    I have one xml i tried to parse that xml using dom parser and i need to get some child elements using java
    <Group>
    <NAME>ABC</NAME>
    <Age>24</AgeC>
    ---------some data here......
    <Group1>
    <group1Category>
    <NAME>ABCTest</NAME>
    <age>27</Age>
    ----Some data here
    <group1subcategory>
    <subcategory>
    <NAME>ABCDEF</NAME>
    <age>28</Age>
    my intention was
    get group name (here ABC) i need all other name value from group1category ,group1 subcategory but pblm that
    my xml contains any number of Group nodes...but only i want name contains ABC
    i wriiten code like this
    DocumentBuilderFactory factory = DocumentBuilderFactory
    .newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(xmlFile);
    NodeList nodeList = document.getElementsByTagName("*");
    for (int i = 0; i < nodeList.getLength(); i++)
    Element element = (Element) nodeList.item(i);
    what is next step i need to do..please help

    964749 wrote:
    Sorry for inconvenience caused..i only asked if any ideas i not ask any body to spent time for me...
    This is simple code developed using xpath..i not know how i proceed further
    public class Demo {
    public static void main(String[] args) {
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    try {
    DocumentBuilder builder = domFactory.newDocumentBuilder();
    Document dDoc = builder.parse("hello.xml");
    XPath xpath = XPathFactory.newInstance().newXPath();
    javax.xml.xpath.XPathExpression expr = xpath.compile("//Group/NAME");
    Object Name= expr.evaluate(dDoc, XPathConstants.STRING);
    System.out.println(Name);
    } catch (Exception e) {
    e.printStackTrace();
    i need get group name (here ABC) i need all other name value from group1category ,group1 subcategory but pblm that
    ..how i done in XPATH and also do manipulation of remining result...
    i also try with DOM like
    NodeList nodeList = document.getElementsByTagName("GROUP");
    for (int i = 0; i < nodeList.getLength(); i++)
    Element element = (Element) nodeList.item(i);
    if (element.getNodeName().matches("ECUC-MODULE-DEF"))
    String str=((Element) nodeList.item(i)).getElementsByTagName("NAME").item(0).getFirstChild().getNodeValue();
    if(str.equalsIgnoreCase("abc")){
    NodeList children = element.getChildNodes();
    for (int k = 0; k < children.getLength(); k++) {
    Node child = children.item(k);
    System.out.println("children"+children.getLength());
    if (child.getNodeType() != Node.TEXT_NODE) {
    if(child.getNodeName().equalsIgnoreCase("Group1"))
    how iterate for particular ABC name to group1 and subcategoryFew things
    1. Use code tags to format code
    2. Explain the problem statement clearly. Take time to formulate your question. Explain what you expect from your code and what you are getting along with any exceptions that are being thrown

  • Getting XML child elements

    Dear Indesign scripters,
    This script is making from all the XML tags ParagraphStyles.
    But it refuses to take the child elements. Do I have to use XPath expression? And how?
    function main() { 
      var xes, n, doc, ps, xe; 
      if ( !app.documents.length ) return; 
      doc = app.activeDocument;
      xes = doc.xmlElements[0].xmlElements; 
      n = xes.length; 
      while ( n-- ) { 
      xe = xes[n];
      st = doc.paragraphStyles.itemByName (xe.markupTag.name ); 
      !st.isValid && doc.paragraphStyles.add({name:xe.markupTag.name}); 
    main();
    The XML
    <Workbook> 
         <Element_A_01> 
              <Element_A_01></Element_A_01> 
         </Element_A_01> 
         <Element_B_02> 
              <Element_B_02></Element_B_02> 
         </Element_B_02> 
    </Workbook>
    Greetings from Holland

    The code creates two paragraph styles namely Element_A_01 and Element_B_02. These two are created for the immediate child nodes of the Workbook node. Now it seems that you are trying to create pstyles for all the nodes in the XML, which in your case would still be these two as Element_A_01 has a child node that is also named Element_A_01 and the same is the case for Element_B_02.
    If i get your point right then you need to create 4 pstyles if all the nodes have different names, but that is not working. For this you will have to recursively traverse each node that you get from the code xes[n].
    The code be something like this
    function main() {   
      var xes, n, doc, ps, xe;   
      if ( !app.documents.length ) return;   
      doc = app.activeDocument; 
      xes = doc.xmlElements[0].xmlElements; //This gives the immediate child nodes of the Workbook node, hence the length in the next statement is 2  
      n = xes.length;   
      while ( n-- ) {   
      xe = xes[n];   //Here you need to recursively traverse the node xe
      //The no of child elements of xe can be obtained as xe.xmlElements.length
      //First element can be obtained by xe.xmlElements[0]
    main();
    Hope this solves the issue

  • XPath expression for getting nodes based on date

    Hello,
    using javax.xml.xpath.XPath (Java 5) I want to get only nodes with dates (element pubDate) greater then some provided date. What is the expression for getting, say only first two <item> nodes? Is it at all possible?
    Example XML document:
    <?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0">
         <channel>
              <title>Channel title</title>
              <link>http://www.foo.bar</link>
              <description>Channel description</description>
              <item>
                   <title>title 1</title>
                   <link>http://foo.bar.org/1</link>
                   <author>author 1</author>
                   <pubDate>Thu, 15 Jun 2006 13:14:00 GMT</pubDate>
              </item>
              <item>
                   <title>title 2</title>
                   <link>http://foo.bar.org/2</link>
                   <author>author 2</author>
                   <pubDate>Thu, 15 Jun 2006 13:11:00 GMT</pubDate>
              </item>
              <item>
                   <title>title 3</title>
                   <link>http://foo.bar.org/3</link>
                   <author>author 3</author>
                   <pubDate>Thu, 14 Jun 2006 13:03:00 GMT</pubDate>
              </item>
              <item>
                   <title>title 4</title>
                   <link>http://foo.bar.org/4</link>
                   <author>author 4</author>
                   <pubDate>Thu, 13 Jun 2006 12:59:00 GMT</pubDate>
              </item>
         </channel>
    </rss>Thanks for any hints!

    I would simply assign value to a variable inside package and use the value in the expression. You can also add variable to configuration if you want to pass a value from outside. You can also add another variable to determine whether you need yesterday or
    specific date and set expression accordingly so that you expression will look like
    (DT_WSTR,30)([User::DateCategory] == "Specific Date"? @[User::Date]:(DT_WSTR, 4) DATEPART( "yyyy", DATEADD( "dd" , -1, GETDATE() ) ) + Right("0"+(DT_WSTR, 2)DATEPART( "mm", DATEADD( "dd" , -1, GETDATE() ) ),2) + Right("0"+(DT_WSTR, 2)DATEPART( "dd", DATEADD( "dd" , -1, GETDATE() ) ) ,2)) +"_*.TXT"
    DateCategory variable should be of type string
    and Date should of type date
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • XPATH expression to get Array node

    Hi
    I have a problem with an XPATH expression in BPEL. I want to get to a particular node in the following result set ..
    <return xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns3="http://com.quion.taken.services/ITakenService.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:Array" ns2:arrayType="ns3:com_quion_dto_taken_BouwnotaVoorraadDTO[2]">
    <item xsi:type="ns3:com_quion_dto_taken_BouwnotaVoorraadDTO">
    <begunstigde xsi:type="xsd:string">Sjoerd</begunstigde>
    <datum xsi:type="xsd:dateTime">2005-10-31T23:00:00.000Z</datum>
    <bedrag xsi:type="xsd:string">1000.0</bedrag>
    <geldLeningId xsi:type="xsd:string">4.0</geldLeningId>
    <rekeningnummer xsi:type="xsd:string">1234</rekeningnummer>
    <notaId xsi:type="xsd:string">1.0</notaId>
    </item>
    <item xsi:type="ns3:com_quion_dto_taken_BouwnotaVoorraadDTO">
    <begunstigde xsi:type="xsd:string">Laszlo</begunstigde>
    <datum xsi:type="xsd:dateTime">2005-10-31T23:00:00.000Z</datum>
    <bedrag xsi:type="xsd:string">1.0</bedrag>
    <geldLeningId xsi:type="xsd:string">4.0</geldLeningId>
    <rekeningnummer xsi:type="xsd:string">5678</rekeningnummer>
    <notaId xsi:type="xsd:string">2.0</notaId>
    </item>
    </return>
    The first thing is that my variable in BPEL does not show the ïtem"level", it shows for example 'return/notaId'.
    However I can get to the second node by keying in
    EXPRESSION 1:
    bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[1]/notaId')
    No I want to dynamically determine the particular node instance. I do this as follows [copied from the Array sample]:
    EXPRESSION 2:
    bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[', bpws:getVariableData('i'),']/notaId')
    BPEL throws the following error
    assignNotaId (faulted)
    [2005/11/09 09:49:36] Updated variable "invokeTaskManager_initiateTask_InputVariable" More...
    <invokeTaskManager_initiateTask_InputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    <task xmlns="http://services.oracle.com/bpel/task">
    <taskId />
    <title />
    <creationDate />
    <creator />
    <modifyDate />
    <modifier />
    <assignee>jstein</assignee>
    <status />
    <expired />
    <expirationDate />
    <duration />
    <priority />
    <template />
    <customKey />
    <conclusion />
    <attachment />
    </task>
    </part>
    </invokeTaskManager_initiateTask_InputVariable>
    [2005/11/09 09:49:36] Error in evaluate <from> expression at line "172". The result is empty for the XPath expression : "bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[', bpws:getVariableData('i'),']/notaId')".
    [2005/11/09 09:49:36] "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown. less
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <part name="summary">
    <summary>empty variable/expression result. xpath variable/expression expression "bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[', bpws:getVariableData('i'),']/notaId')" is empty at line 172, when attempting reading/copying it. Please make sure the variable/expression result "bpws:getVariableData('invokeGetBouwnotaVoorraadVoorLening_getBouwnotaVoorraadVoorLening_OutputVariable','return','/return/item[', bpws:getVariableData('i'),']/notaId')" is not empty.</summary>
    What is wrong with my expression 2?
    Thanks
    Jan Willem

    This Example works fine for arrays that are part of a WSDL message.
    But in 10.1.3.1 this does not work with a array that is part of an XSD declaration
    for Example XSD snippet
    <xsd:element name="itemList">
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element maxOccurs="unbounded" minOccurs="1" ref="tns:Item" />
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
    using the following in assign statement
    <copy>
    <from expression="concat('/ns9:itemList/ns9:Item[',string(bpws:getVariableData('index')),']')"/>
    <to variable="idxXpath"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('OutputItemList',bpws:getVariableData('idxXpath'))"/>
    <to variable="idx_item"/>
    </copy>
    gives a compiler error that is
    Error(176):
    [Error ORABPEL-10085]: invalid argument
    [Description]: in line 176 of "D:\OnlineShopping_1\bpel\OnlineShopping.bpel", the second argument "bpws:getVariableData("idxXpath")" for getVariableData is not a literal expression.
    [Potential fix]: Please correct the second argument, you might need to escape using single quote or " to make it literal.
    Can anyone site the reason for the same or a possible solution?
    Message was edited by:
    user607972

  • Nested XPath expressions

    Hello,
    I am using jsp to read an xml file, then build a table from the contents. My xml looks like this:
    <document>
         <first> Text of First tag
                 <second> Text of second tag
                      <inner> Text of inner tag</inner>
                      <inner> Text of inner tag</inner>
                 </second>
         </first>
         <first> Text of First tag
                 <second> Text of second tag
                     <inner> Text of inner tag</inner>
                     <inner> Text of inner tag</inner>
                 </second>
         </first>
    </document>I am using the standard tag library to iterate over the nodes of type <first>. My problem is that when I get to each <first> node, I want to iterate over each <inner> node, but I don't know how to reference them with XPath. Here is a snippet of my jsp:
            <c:import var="xml" url="test2.xml"/>
         <x:parse varDom="dom" xml="${xml}"/>
            <x:forEach var="First" select="$dom/document/first">     // iterates over each <first> tage
              <x:set var="Second"      select="string($First/second)" />     // only one second tag per first tag
              <x:forEach var="inner" select="$Second/inner" >          // now I want to loop over all the <inner> tags
                         // process inner tags here
              </x:forEach>
            </x:forEach>I can't figure out how to access the inner tags with xpath. I can access the "Second" variable, but when I try to go into the second loop, I can't get the text of the <inner> tag. Any suggestions?

    Good question. I looked at the documentation for the x:forEach element, and it says that it sets the context node to each element of the iteration. So, inside your x:forEach element you can assume that the context node is a first element from your document. The XPath expression to find your inner elements relative to that context node is "inner/second". So:<x:forEach var="inner" select="second/inner" >

  • XPath - How to get only second matching node?

    Hello,
    withs this XPath expression:
    //td[contains(@name, 'FirstColumn')]on this XML:
    <html>
         <table>
              <tr>
                   <td name="MyFirstColumnInRow">A11 - skip me!</td>
                   <td name="MySecondColumnInRow">A12</td>
              </tr>
              <tr>
                   <td name="MyFirstColumnInRow">A21 - find me!</td>
                   <td name="MySecondColumnInRow">A22</td>
              </tr>
              <tr>
                   <td name="MyFirstColumnInRow">A31 - skip me!</td>
                   <td name="MySecondColumnInRow">A32</td>
              </tr>
         </table>
    </html>I have got three matching nodes: A11, A21, A31 .
    How to expand this XPath expression to get only the second node: A21 ?
    I can't find appropriate solution.
    Thanks in advance.

    Why don't you get all the nodes and than you can do whatever you want? You can even get an iterator (here commented out) or write your rule in a loop.
        public static Document parseXmlIntoDOM(File xmlFile,boolean validating,boolean spaceAware) throws XMLException{
            Document document = null;
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setValidating(validating);  
            factory.setNamespaceAware(spaceAware);
            try {
               DocumentBuilder builder = factory.newDocumentBuilder();
               document = builder.parse(xmlFile);
            catch (SAXException sxe) {throw new XMLException("An error in parsing the input source",sxe);}
            catch (ParserConfigurationException pce) {throw new XMLException("An error in parsing the input source",pce);}
            catch (IOException ioe) {throw new XMLException("An error in parsing the input source",ioe);}
            return document;
        public static void main(String args[]){
            Document dom;
            try{
                File file = new File("C:\\Documents and Settings\\diego\\xml\\newXMLDocument.xml");       
                dom = parseXmlIntoDOM(file,false,true);
                XPath xpath = XPathFactory.newInstance().newXPath();
                String expression = "/html/table/tr/td";
                DTMNodeList tdNodes = (DTMNodeList)xpath.evaluate(expression, dom, XPathConstants.NODESET);
                //DTMIterator iterator=tdNodes.getDTMIterator();
                Node secondinstance = tdNodes.item(2);
                System.out.println(secondinstance.getTextContent());
                }catch(Exception e){
                    e.printStackTrace();
        }This works just fine for me and that is my output (in the standard):
    compile:
    run:
    A21 - find me!
    BUILD SUCCESSFUL (total time: 1 second)Sorry the code I wrote is awful, but working. P.S. is there a way for not using the "DTM" api?

  • Help need on XPath expression

    Hi All,
    I have xml file like
    - <aob:AOB-XML xmlns:aob="aob.kana.com" aob:file="\\training3\iq\data\system\knowledgebases\2404\2404.aob" aob:encoding="unicode">
    - <o:Folder xmlns:o="cbr 1.aob.kana.com" aob:objid="O172">
    <o:Title aob:lang="German">Problems</o:Title>
    <o:Author_Creation_Information o:Date_and_Time="2004-04-23T12:53:17+05:30" />
    <o:Author_Modification_Information o:Author="O221" o:Date_and_Time="2004-04-23T12:53:29+05:30" />
    - <o:Problem aob:objid="O187">
    <o:Title aob:lang="German">Software Problem</o:Title>
    <o:Author_Creation_Information o:Date_and_Time="2004-04-23T12:53:17+05:30" />
    <o:Author_Modification_Information o:Author="O221" o:Date_and_Time="2004-04-23T12:54:14+05:30" />
    <o:Contained_in_Folders o:Title="O172" />
    </o:Problem>
    - <o:Problem aob:objid="O230">
    <o:Title aob:lang="German">Database Problem</o:Title>
    <o:Author_Creation_Information o:Author="O221" o:Date_and_Time="2004-04-23T12:53:29+05:30" />
    <o:Author_Modification_Information o:Author="O221" o:Date_and_Time="2004-04-23T12:53:50+05:30" />
    <o:Contained_in_Folders o:Title="O172" />
    </o:Problem>
    </o:Folder>
    </aob:AOB-XML>
    from the xml I need to write the Xpath expression to get the o:Title based on o:Author.
    Thanks
    Babu H

    please consider this the actual xml file
    - <aob:AOB-XML xmlns:aob="aob.kana.com" aob:file="\\3\iq\data\system\knowledgebases\2404\2404.aob" aob:encoding="unicode">
    - <o:Folder xmlns:o="cbr 1.aob.kana.com" aob:objid="O172">
    <o:Title aob:lang="German">Problems</o:Title>
    <o:Author_Creation_Information o:Time="2004-04-23T12:53:17+05:30" />
    <o:Author_Modification_Information o:Author="O221" o:Time="2004-04-23T12:53:29+05:30" />
    - <o:Problem aob:objid="O187">
    <o:Title aob:lang="German">Software Problem</o:Title>
    <o:Author_Creation_Information o:Time="2004-04-23T12:53:17+05:30" />
    <o:Author_Modification_Information o:Author="O221" o:Time="2004-04-23T12:54:14+05:30" />
    <o:Contained_in_Folders o:Title="O172" />
    </o:Problem>
    - <o:Problem aob:objid="O230">
    <o:Title aob:lang="German">Database Problem</o:Title>
    <o:Author_Creation_Information o:Author="O221" o:Time="2004-04-23T12:53:29+05:30" />
    <o:Author_Modification_Information o:Author="O221" o:Time="2004-04-23T12:53:50+05:30" />
    <o:Contained_in_Folders o:Title="O172" />
    </o:Problem>
    </o:Folder>
    </aob:AOB-XML>

  • XPath expression for fetching element names & attributes

    Hi out there!
    I�m trying to get a result set out of a xml schema, using XPath. The problem is, that any expression gets just a whole node set back, as it seems. The result I�d like to get would be the following. Imagine I got a schema like this:
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:r="http://recipes.org"
    targetNamespace="http://recipes.org"
    elementFormDefault="qualified">
    <element name="recipe">
    <complexType>
    <sequence>
    <element name="title" type="string"/>
    <element ref="r:ingredient" minOccurs="0" maxOccurs="unbounded"/>
    <element ref="r:preparation"/>
    <element name="comment" minOccurs="0" type="string"/>
    <element name="nutrition">
    <complexType>
    <attribute name="protein" type="r:nonNegativeDecimal" use="required"/>
    <attribute name="carbohydrates" type="r:nonNegativeDecimal" use="required"/>
    <attribute name="fat" type="r:nonNegativeDecimal" use="required"/>
    <attribute name="calories" type="r:nonNegativeDecimal" use="required"/>
    <attribute name="alcohol" type="r:nonNegativeDecimal" use="optional"/>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    </schema>
    Now, when I`m refering to the element <attribute name="protein" type="r:nonNegativeDecimal" use="required"/>, I would like to get all ancestors of it, which is not a big issue at all, but i`d just like to get their names and attributes, if they have some. So the result should be something like:
    <element name="recipe">
    <complexType>
    <sequence>
    <element name="nutrition">
    <complexType>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    Any ideas anybody?
    Thanks in advance, Jens

    Well, I would use the org.apache.xpath.XPathAPI class and parse the input XML into a DOM document., and then utilize the single xpath expression //attribute[@name=protein]/ancestor::* to recover all ancestors (in a directal-tree-traversal order) of any node called "attribute" and with attr "name=protein" .
    Could it be?

  • OAGIS Get XPath Expression

    We are using the OAGis schema and a client is sending us data in an expression instead of in the actual schema location using the <Get> portion of the schema.
    <Get uniqueIndicator="true">
          <Expression expressionLanguage="XPath">//Credit/FirstName[.="John"]</Expression>
          <Expression expressionLanguage="XPath">//Credit/LastName[.="Smith"]</Expression>
    </Get>What is the best way in BPEL to evaluate this xpath expression to set the FirstName to John and LastName to Smith? We are currently using a transform to parse each expression using XSLT into our database schema. It's not very elegant because it uses an if statement to check the path then has to parse out between the quotes then passes the value to the new var/schema.
    It seems like there should be a way to evaluate the XPath and set the path to the noted string.
    Thanks,

    This Example works fine for arrays that are part of a WSDL message.
    But in 10.1.3.1 this does not work with a array that is part of an XSD declaration
    for Example XSD snippet
    <xsd:element name="itemList">
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element maxOccurs="unbounded" minOccurs="1" ref="tns:Item" />
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
    using the following in assign statement
    <copy>
    <from expression="concat('/ns9:itemList/ns9:Item[',string(bpws:getVariableData('index')),']')"/>
    <to variable="idxXpath"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('OutputItemList',bpws:getVariableData('idxXpath'))"/>
    <to variable="idx_item"/>
    </copy>
    gives a compiler error that is
    Error(176):
    [Error ORABPEL-10085]: invalid argument
    [Description]: in line 176 of "D:\OnlineShopping_1\bpel\OnlineShopping.bpel", the second argument "bpws:getVariableData("idxXpath")" for getVariableData is not a literal expression.
    [Potential fix]: Please correct the second argument, you might need to escape using single quote or " to make it literal.
    Can anyone site the reason for the same or a possible solution?
    Message was edited by:
    user607972

  • OWSM - Signing element using XPATH Expression

    Hi,
    We have a requirement to sign an element within outgoing body of xml message. We are trying to use the policy pipeline to sign.
    Signed Content: XPATH
    sign XPATH Expression: referencing the element required to be signed.
    We get the error: WS-Security process failure:There are no parts of the message to sign
    The error message indicates that the XPATH query is not correct. Does anyone know of a source of documentation for this where we can get examples. Tried google, forums...etc with no success. Any help would be really appreciated.
    Thanks

    Hi,
    Managed to sort it, found the following link.
    http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b31008/toc.htm
    Thanks

  • Cannot get attributes from different child elements...

    Hi,
    I have an Xpath expression which happily gives me all the 'element' elements when I put in the the step variable(1, 2 or 3), see below....
    "/remove[@step < "+step+"]/element"
    <remove step="1">
         <element path="epg.schedule.programme.longName" />
         <element path="epg.schedule.scope" />
    </remove>
    <remove step="2">
         <element path="epg.schedule.programme.mediaDescription" />
    </remove>
    <remove step="3">
         <element path="epg.schedule.programme.genre" />
         <element path="epg.schedule.programme.memberOf" />
         <element path="epg.schedule.programme" />
    </remove>
    But when I ask for each elements attribute 'path' it only every returns the paths for step 1...
    "/remove[@step="+step+"]/element/@path"
    Any ideas greatly appreciated.
    Thanks.
    Paul.

    If the xpath expression
    "/remove[@step["+step+"]/element/@path"is selected with a selectSingleNode method the first <element/> in the <remove/> element gets selected.
    If the xpath expression is selected with with selectNodes method a node list of elements is returned.
    To select an element specify the xpath expression:
    "/remove[@step[3]/element[1]/@path"seelcts the path attribute for the first element in the third remove element

  • How to get child elements of element in xml?

    public class Test {
         public static void main(String[] args) {
              Document doc = null;
              System.out.println("!!!");
              try {
                   // TODO if path is 'c:' then make it 'c:/'
                   doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("test.xml");
              } catch (Exception e) {
                   System.out.println("exception");
              Element root = doc.getDocumentElement();
              NodeList dsList = root.getElementsByTagName("GenericDataSource");
              Element e = (Element)dsList.item(0);
             NodeList nl = e.getChildNodes();
             System.out.println(nl.getLength());
             Node n  = nl.item(0);
             Element ee = (Element)n;
    }i want to get child elements. but its throwing exception on typecasting. can u tell me why?

    thanks for the info.
    i got 2 solutions
    SOLUTION 1:
    public class Test {
         public static void main(String[] args) throws Exception {
              Document doc = null;
              System.out.println("!!!");
              try {
                   // TODO if path is 'c:' then make it 'c:/'
                   doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("test.xml");
              } catch (Exception e) {
                   System.out.println("exception");
              Element root = doc.getDocumentElement();
              NodeList dsList = root.getElementsByTagName("GenericDataSource");
              Element e = (Element)dsList.item(0);
             NodeList nl = e.getChildNodes();
             int count = 0;
             System.out.println(nl.getLength());
             for(int i=0;i<nl.getLength();i++){
                      Node n  = nl.item(i);
                     //System.out.println(n.getClass().getName()); 
                     //System.out.println((Element)n);
                     if(n instanceof Element){ // this checks for node type
                          count++;
                          System.out.println("Element "+(Element)n);
    SOLUTION 2: :
    XPath xpath  = XPathFactory.newInstance().newXPath();
             InputSource inputSource = new InputSource("test.xml");
             NodeList nodes = (NodeList) xpath.evaluate("//GenericDataSource/*", inputSource, XPathConstants.NODESET);
             System.out.println(nodes.getLength());
             System.out.println((Element)nodes.item(9));

  • Child element of target node in message mapping getting suppressed

    Hello All,
                      I am having  mapping where i am trying  to generate the target node based on some condition of the source structure ,this is working fine ,I am able to generate the target node once the condition gets satisfied ,but the problem is one of the  child elements of the same node is not getting populated,its getting suppressed,i have some condition for the same
    I checked  the  queues its showing value as
    SUPPRESS
    Value
    Value ( in grey )
    But still element is not getting generated..
    I have added a condition used at the node function and apart from other condition of element..
    If some body have the solution for the same,please help me out
    Thanks in advance
    Rajesh

    Hi Rajesh,
    The Error is mostly cause of that the node and your child are in same context.
    You got to remember that the parent node creates the context, and then the child element puts the value in it.
    Try putting your child element to a higher context then mapwithdefault for your supress and then removecontext.
    This Issue, you got to work it out with the node functions,
    I had the same kind of issue in my mapping, it was rectified with the help of node functions as mapwithdefault, removecontext.
    Further unless one sees the mapping of your issue it is a bit difficult to imagine it and answer it.
    For more clarifications please give the full hierarchy, and the condition. As of now try with the node functions.
    Thanks
    Ashmi

  • XPath expression to element with xsl: namespace

    Hi,
    I have a problem selecting a node in an XSL document. What I'm trying to do is to load an XSL file and change the 'select' attribute of <xsl:for-each select='//whatever'>
    I tried it something like this:
    Node articleSelect = XPathAPI.selectSingleNode(xslDOM, "//for-each");
    articleSelect.getAttributes().getNamedItem("select").setNodeValue("//article[@ArticleNr='" + articleNumber + "']");However, articleSelect is always null so the second line throws an exception. I also tried "//xsl:for-each" and "//xsl:for-each[@select='//whatever']" and whatnot as the XPath expression, but still no luck... :(
    Any thoughts or ideas will be greatly appreciated :)
    Greetings,
    Erik

    Erik, your code is working fine but you must ensure that the document builder used to create xslDOM has nameSpaceAware = true!
    May I suggest this rewriting - not necessary - but more clear I think:
    Element articleSelect = (Element) XPathAPI.selectSingleNode(xslDOM, "//xsl:for-each");
    articleSelect.setAttribute("select", "//article[@ArticleNr='" + articleNumber + "']");

Maybe you are looking for

  • FCP Project Files are Listed as Documents.

    Hey everyone, I did a long render last overnight on my MacBook Pro (2007 Generation) and then brought the files to a school computer (MacPro OS 10.6.4) and now the FCP project files are simply 'documents' and cannot be opened with FCP. Am I doomed?

  • UWL - open item in new window

    Hi guys! If I click any UWL item I want it to be opened in new window and not in the main portal window. How to achieve this? Thanx for answer! Olian

  • File Input Adapter - Dynamic Mode

    Hi, I want to use dynamicFile and dynamicPath together for file input adapter but I am getting error when I write both of them in DynamicMode parameter. Is it possible somehow? Let me explain my scneario. A server is generating logs and I need to rea

  • What is the best metadata field for picture TITLE?

    Hi -- as stated: what is the best metadata field to use to hold the title of a picture? I've been using the IPTC field "Title", but: - I think this is actually used for a person's job title, not the title of a picture, and - I can't get it to show up

  • Setting label text

    Can anybody tell me what is wrong with this code. The following error message is shown at the compile time. local variable l is accessed from within inner class; needs to be declared final How can I fix it. import javax.swing.*; import java.awt.event