How to iterate through each node in REPLACE stage/XSLT transform/OSB

I need to iterate through a xml document in a 'REPLACE' stage in a OSB message flow and have each <courseTemplate> transformed into a new xml document. The XSLT transform works correctly using the XSLT Resource Tester so I know the stylesheet works.
ex: input data:
<enterprise>
<courseTemplate><sourcedId>100001-01</sourcedId><label><language>en-US</language><text>100001-01</text></label><title><language>en-US</language><text>Lower Division General Credit</text></title><catalogDescription><shortDescription>Lower Division General Credit</shortDescription><longDescription>Lower Division General Credit</longDescription></catalogDescription><courseNumber><language>en-US</language><text>XFCR 2999SA</text></courseNumber><status>Active</status><dataSource>CS</dataSource><extension><extensionField><fieldName>Mode</fieldName><fieldType>String</fieldType><fieldValue>C</fieldValue></extensionField></extension></courseTemplate>
<courseTemplate><sourcedId>100001-02</sourcedId><label><language>en-US</language><text>100001-02</text></label><title><language>en-US</language><text>Lower Division General Credit</text></title><catalogDescription><shortDescription>Lower Division General Credit</shortDescription><longDescription>Lower Division General Credit</longDescription></catalogDescription><courseNumber><language>en-US</language><text>XFCR 2999TC</text></courseNumber><status>Active</status><dataSource>CS</dataSource><extension><extensionField><fieldName>Mode</fieldName><fieldType>String</fieldType><fieldValue>C</fieldValue></extensionField></extension></courseTemplate>
</enterprise>
1) the output data should look like:
<enterprise      xsi:noNamespaceSchemaLocation="import_xml4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <group      recstatus="2">
     <sourcedid>
     <id>100001-01</id>
     </sourcedid>
     <grouptype>
     <typevalue      level="4">Course Template</typevalue>
     </grouptype>
     <description>
     <short>100001-01</short>
     <long>Lower Division General Credit</long>
     </description>
     <relationship      relation="1">
     <sourcedid>
     <id>Uh</id>
     </sourcedid>
     <label/>
     </relationship>
     <extension>
     <path/>
     </extension>
     </group>
     <group      recstatus="2">
     <sourcedid>
     <id>100001-02</id>
     </sourcedid>
     <grouptype>
     <typevalue      level="4">Course Template</typevalue>
     </grouptype>
     <description>
     <short>100001-02</short>
     <long>Lower Division General Credit</long>
     </description>
     <relationship      relation="1">
     <sourcedid>
     <id>Uh</id>
     </sourcedid>
     <label/>
     </relationship>
     <extension>
     <path/>
     </extension>
     </group>
</enterprise>
2) what is happening is the first node is being repeated:
<enterprise      xsi:noNamespaceSchemaLocation="import_xml4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <group      recstatus="2">
     <sourcedid>
     <id>100001-01</id>
     </sourcedid>
     <grouptype>
     <typevalue      level="4">Course Template</typevalue>
     </grouptype>
     <description>
     <short>100001-01</short>
     <long>Lower Division General Credit</long>
     </description>
     <relationship      relation="1">
     <sourcedid>
     <id>Uh</id>
     </sourcedid>
     <label/>
     </relationship>
     <extension>
     <path/>
     </extension>
     </group>
     <group      recstatus="2">
     <sourcedid>
     <id>100001-01</id>
     </sourcedid>
     <grouptype>
     <typevalue      level="4">Course Template</typevalue>
     </grouptype>
     <description>
     <short>100001-01</short>
     <long>Lower Division General Credit</long>
     </description>
     <relationship      relation="1">
     <sourcedid>
     <id>Uh</id>
     </sourcedid>
     <label/>
     </relationship>
     <extension>
     <path/>
     </extension>
     </group>
</enterprise>
3) here is what I am using in the replace stage:
XPath Expression Editor      : Request Pipeline - replace
//enterprise/courseTemplate
//enterprise/courseTemplate
in variable: body with Xslt: SAIP_OSB_Requester/CourseTemplateSAIP_XSLT
Input Document: $body
Variable Names And Bindings: saipCourseTemplatesParam - $body
4) can you see what I need to change?
Edited by: user11960867 on Jul 5, 2011 10:58 AM

Here is the stylesheet I am using. I wonder if it is wrong if I am working with each current node:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output method="xml" indent="yes" />
<xsl:variable name="saipCourseTemplates" />
<xsl:param name="saipCourseTemplatesParam" />
     <xsl:template match="/enterprise">
          <enterprise xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="import_xml4.xsd">
               <xsl:apply-templates select="courseTemplate" />
          </enterprise>
     </xsl:template>
     <xsl:template match="courseTemplate">
          <group recstatus="2">
               <sourcedid>
                    <id>
                         <xsl:value-of select="sourcedId" />
                    </id>
               </sourcedid>
               <grouptype>
                    <typevalue level="4">Course Template</typevalue>
               </grouptype>
               <description>
                    <short>
                         <xsl:value-of select="sourcedId" />
                    </short>
                    <long>
                    <xsl:value-of select="catalogDescription/longDescription" disable-output-escaping="no" />
                    </long>
               </description>
               <relationship relation="1">
               <sourcedid>
               <id>Testing</id>
               </sourcedid>
               <label></label>
               </relationship>
               <extension>
               <path></path>
               </extension>
          </group>
     </xsl:template>
</xsl:stylesheet>

Similar Messages

  • How to iterate through files in a directory in real time?

    I have a program where users can write RPN equations into txt files so that the number and type of equations are completely customizable at run time.  I need to be able to iterate through .txt files in an Equations folder to load the equations into memory.  How can I do this in real time?
    I know I could make the files eq 1.txt through eq 2.txt and iterate through until one doesn't exist, but my standard method has been to name the filename the same as the equation name.  Either way works.
    Thank you.
    Michael Chadwell
    Department of Engine and Vehicle R&D
    Southwest Research Institute

    Hi Michael,
    You could also use the GetFirstFile and GetNextFile functions that come built into CVI. These functions should allow you to iterate through the files in a directory.
    GetFirstFile: http://zone.ni.com/reference/en-XX/help/370051Y-01/cvi/libref/cvigetfirstfile/
    GetNextFile: http://zone.ni.com/reference/en-XX/help/370051Y-01/cvi/libref/cvigetnextfile/
    Hope this helps,
    Kevin

  • How to iterate through multiple records read from a file adapter?

    I am reading multiple records from a file using SyncRead file adapter.
    I want to iterate through the records to perform some action on every record. How to do this?
    I found few threads related to this..but did not get the solution.
    Please note that I am using Jdev 10.1.3.4
    Thanks

    For count expression, I am getting following error:
    <Faulthttp://schemas.oracle.com/bpel/extensionhttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>null:subLanguageExecutionFault</faultcode>
    <faultstring>business exception</faultstring>
    <faultactor>cx-fault-actor</faultactor>
    <detail>
    <code>XPathExecutionError</code>
    <summary>XPath expression failed to execute. Error while processing xpath expression, the expression is "ora:countNodes(bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection'))", the reason is FOTY0001: type error. Please verify the xpath query. </summary>
    </detail>
    </Fault>
    I hard-coded count, in order to proceed. Then I got following error
    <Faulthttp://schemas.oracle.com/bpel/extensionhttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>null:bindingFault</faultcode>
    <faultstring>business exception</faultstring>
    <faultactor>cx-fault-actor</faultactor>
    <detail>
    <code>null</code>
    <summary>file:/C:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_BPELProcess4_1.0_dc4a703c46a242f69d6cea305b2df3a3.tmp/WriteDA.wsdl [ WriteDA_ptt::insert(VbEmpCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: Mapping Not Found Exception. The mapping [C1] for descriptor [class bpel___localhost_default_BPELProcess4_1_0__MD5_ad2539e1386433a9e059bcc969732f11_.WriteDA.VbEmp] could not be found. The input xml record had an element [VbEmp/C1]. ; nested exception is: ORABPEL-11627 Mapping Not Found Exception. The mapping [C1] for descriptor [class bpel___localhost_default_BPELProcess4_1_0__MD5_ad2539e1386433a9e059bcc969732f11_.WriteDA.VbEmp] could not be found. The input xml record had an element [VbEmp/C1]. Make sure that the input xml is valid relative to the xsd and that the mapping exists in the Mappings.xml. If an old version of the descriptor without this mapping has been loaded by the database adapter, you may need to bounce the app server. If the same descriptor is described in two separate Mappings.xml files, make sure both versions include this attribute/mapping. </summary>
    <detail>null</detail>
    </detail>
    </Fault>
    The bpel code is as follows (I can share entire BPEL project..But not sure how to attach to the thread :( )
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Wed Feb 03 18:00:26 IST 2010
    Author: administrator
    Purpose: Synchronous BPEL Process
    -->
    <process name="BPELProcess4"
    targetNamespace="http://xmlns.oracle.com/BPELProcess4"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:ns4="http://TargetNamespace.com/InboundService"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:client="http://xmlns.oracle.com/BPELProcess4"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/ReadFA/"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:ns3="http://xmlns.oracle.com/pcbpel/adapter/db/top/WriteDA"
    xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/db/WriteDA/"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <!--
    PARTNERLINKS
    List of services participating in this BPEL process
    -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:BPELProcess4"
    myRole="BPELProcess4Provider"/>
    <partnerLink name="WriteDA" partnerRole="WriteDA_role"
    partnerLinkType="ns2:WriteDA_plt"/>
    <partnerLink name="ReadFA" partnerRole="SynchRead_role"
    partnerLinkType="ns1:SynchRead_plt"/>
    </partnerLinks>
    <!--
    VARIABLES
    List of messages and XML documents used within this BPEL process
    -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <!-- Reference to the message that will be returned to the requester-->
    <variable name="inputVariable"
    messageType="client:BPELProcess4RequestMessage"/>
    <variable name="outputVariable"
    messageType="client:BPELProcess4ResponseMessage"/>
    <variable name="Invoke_2_insert_InputVariable"
    messageType="ns2:VbEmpCollection_msg"/>
    <variable name="Invoke_3_SynchRead_InputVariable"
    messageType="ns1:Empty_msg"/>
    <variable name="Invoke_3_SynchRead_OutputVariable"
    messageType="ns1:EmpCollection_msg"/>
    <variable name="Invoke_3_SynchRead_InputVariable_1"
    messageType="ns1:Empty_msg"/>
    <variable name="Count" type="xsd:integer"/>
    <variable name="iterater" type="xsd:integer"/>
    </variables>
    <!--
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    -->
    <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess4.wsdl) -->
    <receive name="receiveInput" partnerLink="client"
    portType="client:BPELProcess4" operation="process"
    variable="inputVariable" createInstance="yes"/>
    <!-- Generate reply to synchronous request -->
    <invoke name="Invoke_3" partnerLink="ReadFA" portType="ns1:SynchRead_ptt"
    operation="SynchRead"
    outputVariable="Invoke_3_SynchRead_OutputVariable"
    inputVariable="Invoke_3_SynchRead_InputVariable_1"/>
    <assign name="Assign_1">
    <copy>
    <from expression="1"/>
    <to variable="iterater"/>
    </copy>
    <copy>
    <from expression="1"/>
    <to variable="Count"/>
    </copy>
    </assign>
    <while name="While_1"
    condition="bpws:getVariableData('iterater') &lt;= bpws:getVariableData('Count')">
    <sequence name="Sequence_2">
    <switch name="Switch_1">
    <case condition="bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection/ns4:Emp/ns4:C4') = &quot;Pune&quot;">
    <sequence name="Sequence_1">
    <assign name="Assign_3">
    <copy>
    <from expression="bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection/ns4:Emp')[bpws:getVariableData('iterater')]"/>
    <to variable="Invoke_2_insert_InputVariable"
    part="VbEmpCollection"
    query="/ns3:VbEmpCollection/ns3:VbEmp"/>
    </copy>
    </assign>
    <invoke name="Invoke_2" partnerLink="WriteDA"
    portType="ns2:WriteDA_ptt" operation="insert"
    inputVariable="Invoke_2_insert_InputVariable"/>
    </sequence>
    </case>
    <otherwise>
    <sequence name="Sequence_3">
    <empty name="Empty_1"/>
    <assign name="Transform_1">
    <bpelx:annotation>
    <bpelx:pattern>transformation</bpelx:pattern>
    </bpelx:annotation>
    <copy>
    <from expression="ora:processXSLT('Transformation_3.xsl',bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection'))"/>
    <to variable="Invoke_2_insert_InputVariable"
    part="VbEmpCollection"/>
    </copy>
    </assign>
    </sequence>
    </otherwise>
    </switch>
    <assign name="Assign_2">
    <copy>
    <from expression="bpws:getVariableData('iterater') + 1"/>
    <to variable="iterater"/>
    </copy>
    </assign>
    </sequence>
    </while>
    <reply name="replyOutput" partnerLink="client"
    portType="client:BPELProcess4" operation="process"
    variable="outputVariable"/>
    </sequence>
    </process>
    From the process flow, I can see that the array element expression works and the first employee record is correctly assigned to the Invoke_2_Input_Variable.
    However Invoke_2 is erroring out.
    Thanks
    Edited by: user8645981 on Feb 5, 2010 2:44 AM

  • Can anyone tell me how to iterate through a cmponent tree in JSF

    HI,
    I am new to JSF.Can any one help me in iterating through a component tree.
    For eaxmple , i have a JSF page.When i send a request for the first time for a page ,
    it will build the component tree.So i want to iterate through that component tree.
    Actullay my requirement is that in my page, i will have a datatable and some command buttons.
    when i select a row in a datatable,it should be highlighted.But again onpage load, highlighting is missing.
    So i want to save the id of the element, which i selected in the table in the request object.
    Pls help me out....

    The view root is available by FacesContext#getViewRoot(). Its getChildren() returns a List<UIComponent>. For every UIComponent you can get the children by UIComponent#getChildren() which on its turn also returns a List<UIComponent>. You can easily write a recursive method for that.

  • How to Iterate through a BAPI table

    Hi i am calling a BAPI with the Adaptive RFC and want to store the returning information in a tree.
    For getting e.g the field URL in the current node named C_T_Nodes i can use :
    String URL =  wdContext.currentC_T_NodesElement().getUrl();
    Is that correct ?
    but that is just one entry. how can i loop through the whole list?
    Thanks, Kai

    Might this work ?
              int tableSize = wdContext.nodeReportList().size();
              String valueTable[][] = new String[tableSize][6];
              for(int i=0;i<tableSize;i++)
    valueTable<i>[0] = wdContext.nodeC_T_Nodes().getC_T_NodesElementAt(i).get<Column1>;
    valueTable<i>[1] = wdContext.nodeC_T_Nodes().getC_T_NodesElementAt(i).get<Column2>;     

  • How to iterate through a treemap in alphabetical order

    This is with a servlet. I will have a button for next and previous. When next is pressed, I go to the next record in alphabetical order.
    I know how to use a comparator and set it up. I also know how to use an iterator with 'hasNext' function. The problem is that the servlet(or jsp, etc...) will display this to the web. Then a doPost will get called and I have to go to the 'next' or previous record from the last time the form was called.
    I don't care about concurrency yet(let me get this part down first). How do i 'track' where I was last and then go to the next record. Or is there an easier way that a treemap. I don't care about performance.

    I'm assuming you want to sort on keys, not values, since that's what SortedMaps do.
    Let's say you're using elements of class C as the keys in the map. Either have C implement Comparable, or create a Comparator that compares to C instances.
    Whether you go the Comparable or Comparator route, the body of the compare or compareTo method will be almost the same. You'll just compare whatever fields are relevant on this/obj (Comparable) or obj1/obj2 (Comparator).
    The only other difference is it's more important for Comparable's compareTo to be compatible with equals, which means you have to override equals and hashCode. You don't have to do so for Comparator, but it can make some subtle issues a bit cleaner.
    Then you could do something like the following: for (Iterator iter = <something>.iterator(); iter.hasNext();) {
        <SomeClass>sc = iter.next();
        // process this element
    } where <something> can be keySet() or entrySet(). Maybe even values(). I think values() will give the sorted order for a SortedMap, but not 100% sure.Check the docs. <SomeClass> will either be the class or the keys (for keySet()), Map.Entry (for entrySet()) or the class of the values (for values()).
    You might want to check out this tutorial, if you haven't already.
    http://java.sun.com/docs/books/tutorial/collections/

  • How to know whether a node contains a point after transformation?

    I have tried the contains function but i can't make it after transformation such as changing the scaleX,rotate or any other things.

    Answer by example:
    var scene: Scene;
    var rect: Rectangle;
    Stage
      title: "Forum Test"
      scene: scene = Scene
        width: 500
        height: 500
        fill: Color.LAVENDER
        content:
          rect = Rectangle
            x: 100
            y: 100
            width: 200
            height: 100
            arcWidth: 50
            arcHeight: 50
            fill: Color.web('#00BB00')
            stroke: Color.GREEN
            strokeWidth: 5
            onMousePressed: function (evt: MouseEvent): Void
              if (evt.primaryButtonDown)
                evt.node.rotate += 15.0;
                evt.node.scaleX *= 1.1;
              else
                evt.node.rotate -= 15.0;
                evt.node.scaleX /= 1.1;
          Rectangle
            width: 500
            height: 500
            fill: Color.TRANSPARENT
            onMouseMoved: function (evt: MouseEvent): Void
              var pt = rect.sceneToLocal(evt.x, evt.y);
              if (rect.contains(pt))
                rect.stroke = Color.RED
              else
                rect.stroke = Color.GREEN
    }

  • How do you iterate through a string?

    Hi! How do I loop through a string of characters. My program needs to iterate through a string in order to do some calculations. Here is an example:
    <item>1</item>
    <description>This is an example.</description>
    How I iterate through description one character at a time.
    Thanks for your help!

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
    <xsl:template name="add-X">
    <xsl:param name="string" select="." />
    <xsl:if test="$string">
    <xsl:text>X</xsl:text>
    <xsl:value-of select="substring($string, 1,1)"/>
    <xsl:call-template name="add-X">
    <xsl:with-param name="string"
    select="substring($string, 2)" />
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    Create an file named TEST.xsl with the above code.
    <aaaa>ABCDE</aaaa>
    Create an file named TEST.XML with the above code.
    Create an RTF template with form field valus as
    <?import: file:///C:\Desktop\Sample RTF\TEST.xsl?>
    Note : here you have to point the xsl path where your TEST.xsl is located.
    Then create another form field with value
    <xsl:call-template name="add-X"> <xsl:value-of select="." /> </xsl:call-template>
    When you merge the xml and RTF , you will find the no of "X" equivalent to length of the string in <aaaa> tag in xml

  • Iterate through xml elements vb cs2

    Does anyone know how to iterate through xml elements without xml rules (unfortunately I have to do this project with cs2). I've heard it's hard and slow to iterate through each element in cs2.

    Here is a script I find useful. It recursively iterates over indesign xml structure and invokes a function on each node.
    HTH,
    =========================================================
    function invokeFunctionOnNode(parentNode, func) {
    var pNode = parentNode;
    //Call on Parent Node
    func(pNode);
    var elementCount = 0;
    try{
    elementCount = pNode.xmlElements.length;
    }catch(ex){}
    if (elementCount > 0) {
    var ctr = 0;
    for (var elem = 0 ; elem < elementCount; elem++) {
    var currentNode = pNode.xmlElements.item(elem);
    func(currentNode);
    try {
    if (currentNode.xmlElements.length > 0) {
    invokeFunctionOnNode(currentNode, func) ;
    } catch(ex) {}

  • Iterate through the child Objects in a components

    I have a custom component named myComp that has three TextInputs. And in the main application there is a button that adds this component dynamically to the VBox named myVBox, I would like to know how to iterate through the added components and show the text inside each of the TextInputs in an Alret box. I am pretty new to flex and I couldn't find any examples for it.
    Thanks,

    Sample code,
    Custom Component
    MyComp1.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml">
         <mx:TextInput id="txt1" width="100" />
         <mx:TextInput id="txt2" width="100" />
         <mx:TextInput id="txt3" width="100" />
    </mx:HBox>
    Application
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
         xmlns:mx="http://www.adobe.com/2006/mxml"
         layout="absolute"
         creationComplete="init()">
         <mx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import com.MyComp1;
                   private function addComponent(event: MouseEvent): void {
                        var myComp1: MyComp1 = new MyComp1();
                        myVBox.addChild(myComp1);
                   private function getText(event: MouseEvent): void {
                        var alertMsg: String = "";
                        for (var i: int = 0; i < myVBox.getChildren().length; i++) {
                             if (myVBox.getChildAt(i) is MyComp1) {
                                  var myComp: MyComp1 = myVBox.getChildAt(i) as MyComp1;
                                  alertMsg += myComp.txt1.text + "\t" +
                                                 myComp.txt2.text + "\t" +
                                                 myComp.txt3.text + " \n"
                        Alert.show(alertMsg);
              ]]>
         </mx:Script>
         <mx:VBox width="100%" height="100%">
              <mx:Button label="Add Comp" click="addComponent(event)" />
              <mx:Button label="Get Value" click="getText(event)" />
              <mx:VBox id="myVBox" width="100%" height="95%">
              </mx:VBox>
         </mx:VBox>
    </mx:Application>
    Hope this helps you

  • XPath expression for each node name

    <DATABASE>
       <TITLE>
          <LANGUAGES>SGML<LANGUAGES>
       <TITLE>
    </DATABASE>Is there a direct way of retrieving xpath expression for each node name other than iterating through each node and identifying the parent node.
    Ex:
    DATABASE
    DATABASE/TITLE
    DATABASE/TITLE/LANGUAGES

    If you set an element ID using the DOM parser you can then look it up using the ID.
    private void setElementIDNode(String tag, String IDAttribute){
            NodeList nodes = doc.getElementsByTagNameNS(docNS, tag);
            for (int i = 0; i < nodes.getLength(); i++){
                Element node = (Element)nodes.item(i);
                node.setIdAttribute(IDAttribute, true);
    Element e  = doc.getElementById(elementID);But at some point you still have to iterate through the document. I believe XML Pull Parsers are a little different but I don't have experience with them.

  • TreeModel - Iterate through child records using row EL

    Hi all,
    Jdev Version: Studio Edition Version 11.1.1.7.0
    I have a search page where I need to display the search results of Header and on one of the columns need to display a concatenated list of children.
    Header is a Task and children are Assignees of the task. I am looking to achieve this by using a normal table bound to a tree binding inside which the 'Assignee' view link is added as a child. So the binding is ready. I attempt to use the af:table using the treeModel which also seems to be working fine.
    Now I am stuck on how to iterate through the assignees for each task using EL - #{row.???}
    Jsff  Code snippet
              <af:table value="#{bindings.Task1.treeModel}" var="row"
                          rows="#{bindings.Task1.rangeSize}"
                          summary="#{ResourcesGenBundle['Header.SearchResults']}"
                          varStatus="tableMetadata"
                          selectionListener="#{backingBeanScope.TaskSearchBean.selectHandler}"
                  width="100%" columnStretching="column:resId1c5" autoHeightRows="15">
                    <af:column id="c3" headerText="Assignees">
                        <af:iterator id="i1" rows="2" var="assigRow"
                                 value="#{row.Task11.collectionModel}">                 
                            <af:outputText value="#{assigRow.UserName}" id="ot2"/>
                            <af:spacer width="10" height="10" id="s2"/>
                        </af:iterator>
                    </af:column>
                </af:table>
    Page Def Snippet
        <tree IterBinding="Task1Iterator" id="Task1">
          <nodeDefinition DefName="sample.common.publicModel.components.view.TaskVO"
                          Name="Task10">
            <AttrNames>
              <Item Value="TaskId"/>
              <Item Value="Subject"/>
              <Item Value="Description"/>
              <Item Value="PastDue"/>
            </AttrNames>
            <Accessors>
              <Item Value="TaskUser"/>
            </Accessors>
          </nodeDefinition>
          <nodeDefinition DefName="sample.common.publicModel.components.view.TaskUserVO"
                          Name="Task11">
            <AttrNames>
              <Item Value="ListName"/>
              <Item Value="PersonId"/>
              <Item Value="UserRole"/>
            </AttrNames>
          </nodeDefinition>
        </tree>
    Thanks,
    Srini

    Trying out with
    <af:iterator id="i1" rows="2" var="assigRow"  value="#{row.children}">
    Will keep the thread posted on my progress. Meanwhile, any suggestions welcome .
    Another way I could think of achieving this is to not use a UI iterator and instead get the value for my outputText using a bean method where I could get the present row of the tree and get the children and concatenate the Assignee names and return. But UI iterator should be a better way to do this if possible. So still exploring.

  • Iterate through string column of data that is a varchar2 (2000)

    Hi,
    My question is how to iterate through the data by selecting the first 120 bytes of the column writing that to a UTL_FILE, then selecting the next 120 bytes to write that to the UTL_FILE as well until there is no more data. I am having a problem getting the second 120 and so on. The column of data is just text.
    Thanks any help is greatly appreciated.

    I'm sure there is a shorter or more elegant solution, but this is from a quick function I wrote a while back that might give you an example-
    -- Declare variables
            v_msg VARCHAR2(2000) := 'whatever your message is';
            v_pos NUMBER := 1;
            v_len NUMBER := 0;
            v_max_len NUMBER := 120;  
            v_yourstring VARCHAR2(150);
    -- Iterate in the body of your procedure
               v_len := length(v_msg);
                WHILE v_len > 0
                LOOP
                    v_yourstring :=  (substr(v_msg, v_pos, v_max_len));
                    -- do whatever you need to do with first 120 characters
                    v_pos := v_pos + v_max_len; 
                    v_len := v_len - v_max_len;                                             
                END LOOP;

  • Iterate through selected characters

    Hi guys and girls!
    Has anybody a code snippet to show me how to iterate through the selected text (not the frame!, not the words, only the selected chars) and make any change on the characterAttributes (size, color, etc.)?
    Deeper into it:
    In the property "app.activeDocument.selection" usually the selected objects are stored as an array. Now when I select characters in a textframe (or TextPath, whatever) there is a [Textrange] in it.
    I already tried some combinations like this snippet underneath but I still get errors, that selectedChars[i] is undefined.
    FYI: I'm on Illustrator CS4, Mac OS X, Javascript
    var selectedChars = app.activeDocument.selection.characters;
    for (i = 0; i < selectedChars.length; i++ ){                           
         selectedChars[i].characterAttributes.fillColor = myNewCMYKColor;
    I hope I have gathered all relevant information. If not, please do not kill me and just ask back
    So has anybody a smart hint for me?
    Thanks a lot in advance!

    Here's a Change Size script that I found in my collection that somebody posted severat years ago. I'm sorry I don't remember who it was to give proper credit.
    #target illustrator
    // change size of paragraph text
    //$.bp();
    ChangeSize();
    function ChangeSize()
        selectedItems = selection;
        // check to make sure something is selected.
        if (selectedItems.length == 0)
            alert("Nothing is selected");
            return;
        endIndex = selectedItems.length;
        for (index = 0; index < endIndex; index++)
            pageObject = selectedItems[index];
            pageItemType = pageObject.typename;
            if (pageItemType == "TextFrame")
                // get the paragraphs from the selection.
                theTextRange = pageObject.textRange;
                paraTextRange = theTextRange.paragraphs;           
                numParagraphs = paraTextRange.length;
                for (i = 0 ; i < numParagraphs ; i++)
                    aParagraph = paraTextRange[i];
                    charTextRange = aParagraph.characters;
                    charCount = charTextRange.length;
                    if (charCount > 1)
                        end = charCount;
                        fontSizeChanger = 14/end;
                        currentFontSize = 18;
                        for (j = 0 ; j < end; j++)
                            theChar = charTextRange[j];
                            theChar.size = currentFontSize;  
                            currentFontSize = currentFontSize - fontSizeChanger;
    and here's the output.
    You should be able to go from there.

  • Iterate through a treemap object

    how can 'iterate' through treemap object like you can with an ArrayLIst
    like:
    Iterator it = arraylist.iterator();

    Here is an example:
    TreeMap users = (TreeMap)session.getAttribute("users");
    Iterator i = users.entrySet().iterator();
    while (i.hasNext()) {
    Map.Entry e = (Map.Entry)i.next();
    if (e != null) {
    String key = (String)e.getKey();
    if (key != null && key.length() > 0) {
    String value = (String)e.getValue();
    } // end if key not null
    } // end if entry not null
    } // end while

Maybe you are looking for

  • DB Adapter  Polling

    Most times our bpel processes cannot update a database table (logically or otherwise) immediately after it is polled,rather it may have to deferred after until a few business validations are done and depending on whether these were successful or not

  • I updated to ios8, and now I can't talk and have it turn into text. Instead it records my voice. How can I make it go back.

    I Am not interested in recording my voice. the simple way I could just press the microphone key and talk was great. How can I go back to the old and convenie system?

  • Get Routing from Configuration VA01 / VA02 / VA03

    Hello together, we created a standard routing in transaction CA01 with dependencies to control which operation of the routing must be used in production order. I developed an application. It is started by a function out of the configuration processin

  • How to change html-css cursor style in Adobe Air?

    We all know how to change cursor style in  Html pages, of course using css such as, 'cursor: url("move.cur"),  move'. But when I use it in Adobe Air, it will not show the standard  cursor style in browser, but the special ones in Adobe. For example,

  • Where are my texts and pictures

    I just switched from verizon to tmobile. i backed up my vzw phone and when i restored it onto the tmobile phone 90 percent of pictures and all my texts were gone. ive waited a few hours on wifi and plugged in nothing else has loaded. also my apps and