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) {}

Similar Messages

  • Iterate through XML find the missing element and prepare report

    Hi',
    I am reading a XML and if the ID is missing in that XML, then I have to make a report which can be send by mail
    by telling that these are the name for which ID is not present.
    I am able to iterate through the records and check if the ID is not present and pick the names for that,
    What I am not getting is how to put these names in a proper format.
    Like if I copy then each time the variable will be overwritten, if I use a append then a full new XML gets created.
    Please tell me how I can make a proper report.
    Thanks
    Yatan
    <Records>
    <Employee>
    <name>Yatan</name>
    <ID></ID>
    <Age>28</Age>
    </Employee>
    <Employee>
    <name>Yagya</name>
    <ID>101</ID>
    <Age>27</Age>
    </Employee><Employee>
    <name>Yugansh</name>
    <ID></ID>
    <Age>24</Age>
    </Employee>
    </Records>

    What about you do a XSLT transformation to get the email content in HTML format... That would avoid you to iterate through your XML...
    The template would be like this:
    <xsl:template match="/">
            <h2>These are the employees without ID</h2>
            <xsl:for-each select="/Records/Employee[ID = '']">
                <xsl:value-of select="name"/>
                <BR/>
            </xsl:for-each>
    </xsl:template>This is just a sample, syntax was not verified, but I think you'll get the idea...
    Please let me know if this was helpful...
    Cheers,
    Vlad

  • Iterate through XML tags of file (CS5)

    Hello!
    I'd like to iterate through an XML file, but I am not sure how to do this, since the import is mostly done automatically.
    This is how I load and import the file:
    var f = new File('~/Desktop/test.xml');
    app.activeDocument.importXML(f);  
    But how can I now iterate through its tags using JavaScript?

    Hallo,
    Thank you for the resource!
    However, I was not able to implement any of the example because of an error "__processRuleSet is not a function".
    My code is:
    //Setup.jsx
    mainSetup();
    function mainSetup(){
         var myDocument = app.documents.add();
         myDocument.xmlImportPreferences.allowTransform = false;
         myDocument.xmlImportPreferences.ignoreWhitespace = true;
         var myFilePath = '~/Desktop/test.xml';
         myDocument.importXML(File(myFilePath));
         var myBounds = myGetBounds(myDocument, myDocument.pages.item(0));
         myDocument.xmlElements.item(0).placeIntoFrame(myDocument.pages.item(0), myBounds);
         function myGetBounds(myDocument, myPage){
             var myWidth = myDocument.documentPreferences.pageWidth;
             var myHeight = myDocument.documentPreferences.pageHeight;
             var myX1 = myPage.marginPreferences.left;
             var myY1 = myPage.marginPreferences.top;
             var myX2 = myWidth - myPage.marginPreferences.right;
             var myY2 = myHeight - myPage.marginPreferences.bottom;
             return [myY1, myX1, myY2, myX2];
    // Test, Add return character after every XML Element
    mainTest();
    function mainTest(){
         if (app.documents.length != 0){
             var myDocument = app.documents.item(0);
             //This rule set contains a single rule.
             var myRuleSet = new Array (new AddReturns);
             with(myDocument){
                 var elements = xmlElements;
                 __processRuleSet(elements.item(0), myRuleSet);
         else{
             alert("No open document");
             //Adds a return character at the end of every XML element.
             function AddReturns(){
                 this.name = "AddReturns";
                 //XPath will match on every XML element in the XML structure.
                 this.xpath = "//*";
                 // Define the apply function.
                 this.apply = function(myElement, myRuleProcessor){
                     with(myElement){
                         //Add a return character after the end of the XML element
                         //(this means that the return does not become part of the
                         //XML element data, but becomes text data associated with the
                         //parent XML element).
                         insertTextAsContent("\r", XMLElementPosition.afterElement);
                         //To add the return at the end of the element, use:
                         //insertTextAsContent("\r", XMLElementPosition.afterElement);
                 return true;// Succeeded
             } //End of apply function
    Do you have any ideas?
    Kind regards,
    mannyk

  • Iterate through UI elements in a view

    Hi,
    I would like to iterate through the UI elements in a view, to read their 'id' values, and populate an arraylist. Could you please suggest how to accomplish this ?
    Thanks !

    Hi,
    If ur requirement is just to get the ID's Noufal 's solution should be sufficient.
    IWDTransparentContainer t = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDUIElement a[] = t.getChildren();
    for(int i =0;i<a.length;i++){
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(a<i>.getId());
    IWDUIElement i1 = (IWDUIElement)view.getElement(a<i>.getId());
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(""+i1.getClass());
    If all the elements are created in design time you will know the element IDs and types. So further processing for manipulation of the UI properites will be easy.
    But if elements are added dynamically you will be able to get their ID s and the class type. But i wonder if u will be able to proceed further.
    Regards
    Bharathwaj

  • Iterate through tray elements

    Hello everybody,
    is there a way to iterate through the elments which are in a specific tray ui element?
    For instance I have a tray element which contains two inputfields. I know I am able to acces these elements by adressing them in wdModifiyView method with the view.getElement method, but in my scenario I don't know the names of these elements. This is the reason why i will iterate through this tray elment.
    Best regards
    Joachim

    Hi,
    you can use the instanceOf operator and do this.
    IWDTray t= //ur tray element
      IWDUIElement []t1 = t.getChildren();
           for(int x=0;x<t1.length; x++)
                if(t1[x] instanceof IWDTextView) {
                   IWDTextView new_name = (IWDTextView) t1[x];
    Regards
    Ayyapparaj

  • ComboBox - iterate through dropdown elements?

    I need to subdivide a large list of elements in a comboBox into smaller groups in Flash. Is there anyway to loop throught the elements and set te background color of each element to a value in the dataProvider object?
    I can run through the loop using myPoS_combobox.dropdown
    var ddList = myPoS_combobox.dropdown
    for(var propertyName in ddList) {
         trace(ddList[propertyName])
    But I can't seem to get to the individual elements, much less change their properties.
    THANKS!

    I can do that, but what I need to do is change individual cell background colors. Here is my data provider:
    private var PoS_label_array:Array = new Array(
                        {label:"SN\tsubject noun", data:"SN", myColor:ShurleyColors.shurleyBlue},
                        {label:"CSN\tcomp subject noun", data:"CSN", myColor:ShurleyColors.shurleyBlue},
                        {label:"OP\tobject of the preposition noun", data:"OP", myColor:ShurleyColors.shurleyBlue},
                        {label:"COP\tcomp object of the preposition noun", data:"COP", myColor:ShurleyColors.shurleyBlue},
                        {label:"DO\tdirect object noun", data:"DO", myColor:ShurleyColors.shurleyBlue},
                        {label:"CDO\tcomp direct object noun", data:"CDO", myColor:ShurleyColors.shurleyBlue},
                        {label:"IO\tindirect object noun", data:"IO", myColor:ShurleyColors.shurleyBlue},
                        {label:"CIO\tcomp indirect object noun", data:"CIO", myColor:ShurleyColors.shurleyBlue},
                        {label:"PrN\tpredicate noun", data:"PrN", myColor:ShurleyColors.shurleyBlue},
                        {label:"CPrN\tcomp predicate noun", data:"CPrN", myColor:ShurleyColors.shurleyBlue},
                        {label:"OCN\tobject compliment noun", data:"OCN", myColor:ShurleyColors.shurleyBlue},
                        {label:"COCN\tcomp object compliment noun", data:"COCN", myColor:ShurleyColors.shurleyBlue},
                        /* PRONOUNS */
                        {label:"SP\tsubject pronoun", data:"SP", myColor:ShurleyColors.shurleyPurple},
                        {label:"CSP\tcomp subject pronoun", data:"CSP", myColor:ShurleyColors.shurleyPurple},
                        {label:"OPP\tobject of the prep pronoun", data:"OPP", myColor:ShurleyColors.shurleyPurple},
                        {label:"DO\tdirect object pronoun", data:"DO", myColor:ShurleyColors.shurleyPurple},
                        {label:"IO\tindirect object pronoun", data:"IO", myColor:ShurleyColors.shurleyPurple},
                        {label:"OCP\tobject compliment pronoun", data:"OCP", myColor:ShurleyColors.shurleyPurple},
                        /* VERBS */
                        {label:"V\tverb", data:"V", myColor:ShurleyColors.shurleyRed},
                        {label:"CV\tcomp verb", data:"CV", myColor:ShurleyColors.shurleyRed},
                        {label:"V-t\tverb transitive", data:"V-t", myColor:ShurleyColors.shurleyRed},
                        {label:"CV-t\tcomp verb transitive", data:"CV-t", myColor:ShurleyColors.shurleyRed},
                        {label:"CV\tcompound verb", data:"CV", myColor:ShurleyColors.shurleyRed},
                        {label:"LV\tlinking verb", data:"LV", myColor:ShurleyColors.shurleyRed},
                        /* DESCRIPTIVE */
                        {label:"Adv\tadverb", data:"Adv", myColor:ShurleyColors.shurleyPink},
                        {label:"Adj\tadjective", data:"Adj", myColor:ShurleyColors.shurleyGreen},
                        {label:"CAdj\tcomp adjective", data:"CAdj", myColor:ShurleyColors.shurleyGreen},
                        {label:"PNA\tpos noun adjective", data:"PNA", myColor:ShurleyColors.shurleyGreen},
                        {label:"PPA\tpos pro adjective", data:"PPA", myColor:ShurleyColors.shurleyGreen},
                        {label:"A\tarticle adjective", data:"A", myColor:ShurleyColors.shurleyGreen},
                        {label:"OCA\tobject compliment adjective", data:"OCA", myColor:ShurleyColors.shurleyGreen},
                        {label:"COCA\tcomp object compliment adjective", data:"COCA", myColor:ShurleyColors.shurleyGreen},
                        {label:"PA\tpredicate adjective", data:"PA", myColor:ShurleyColors.shurleyGreen},
                        {label:"CPA\tcomp predicate adjective", data:"CPA", myColor:ShurleyColors.shurleyGreen},
                        {label:"P\tpreposiiton", data:"P", myColor:ShurleyColors.shurleyOrange},
                        {label:"C\tconjunction", data:"C", myColor:ShurleyColors.shurleyDarkGray},
                        {label:"I\tinterjection", data:"I", myColor:ShurleyColors.shurleyLightGray}
    What I want to do is se the cells of the dropdown to the myColor property in the data provider.

  • DOM xml white space in xml element

    Hi there
    Can anyone please help me out with a issue I'm having with altering an xml, and then storing it.
    The thing is, that when I delete all elements under a parent to insert something new there's a big gap when looking at the xml. Like this
    orginal xml fil(as an example):
    <batch>
    <somethingtag> <- Im removing these
    </somethingtag>
    <somethingtag> <- Im removing these
    </somethingtag>
    <somethingtag> <- Im removing these
    </somethingtag>
    <somethingtag> <- Im removing these
    </somethingtag>
    <somethingtag> <- Im removing these
    </somethingtag>
    </batch>
    with code:
              for(int i = 0; i < antallStartTagger ;i++)
                   //System.out.println("Slettet invoicetag nr: " + i);
                   Element startTag = (Element) nodeEn.item(0);                              // Forrige er slettet, s� neste f�rste hele tiden
                   startTag.getParentNode().removeChild(startTag);               
    don't bother the name. The result is:
    <batch>
    <- still space
    </batch>
    and when I insert a new element, it put itself at the far bottom, like this:
    <batch>
    <newtag>
    </newtag>
    <newtag>
    </newtag>
    </batch>
    And for saving the file STILL with gaps I use the Transformer class:
    File xmlOutputFile = new File(filename......);
         FileOutputStream fos = null;
         Transformer transformer = null;
                   fos = new FileOutputStream(xmlOutputFile);
                   // Use a Transformer for output
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
         transformer = transformerFactory.newTransformer();
              DOMSource source = new DOMSource(documentSkjellett);
              StreamResult result = new StreamResult(fos);
              // transform source into result will do save
         transformer.transform(source, result);
         ediLog.append(" -> [" + ediFil + "] lagret");
              catch (FileNotFoundException e)
              {System.out.println("##FEIL## : FileNotFoundException i lagreXMLFil: " + e.getMessage() + " " + e);}
              catch (TransformerConfigurationException e)
              {System.out.println("##FEIL## : TransformerConfigurationException i lagreXMLFil: " + e.getMessage() + " " + e);}
              catch (TransformerException e)
              {System.out.println("##FEIL## : TransformerException i lagreXMLFil: " + e.getMessage() + " " + e);}
    Can anyone advice?
    Paul

    It's because <batch> has two types of children: elements and text nodes.
    Assuming that the text is just whitespace, and you don't care about any text occurring between nodes, first call document.normalize() to aggregate all that text into one big node, then seek out and destroy it.
    Alternately, if you know that there shouldn't be any text directly under <batch>, simply iterate through its child nodes and remove any that are instanceof Text.

  • How to read xml elements in Bpel

    Hi,
    I had created an empty Bpel Process and configured file adapter to a directory, In my text file i have 3 records with four columns, each column seperated by ',' and each record seperated by "EOL(end of line)", Below is the xsd file generated by the native format xsd builder, taken a recieve activity to recieve the contents of file from file adapter.
    So all the data which is in the file will be there in recieve activity.
    FileContents
    55555,rgfdgsd,gfdgfdg,23
    66666,retretret,trtertg,21
    77777,rtrttreter,trtter,23
    My Question is
    I want to compare whether value of C1 = '55555' and if the value is equal to 55555 then that record with c1=55555 has to be inserted into database
    How to compare the value of c1 through bpel functions.
    with java i have to use the logic similar to this by using Xpath
    getElement by tagname(c1);- it will give all the elements with tagname c1, three records are there with tagname c1 (c1=55555,c1=66666,c1=77777), we have to iterate through the elemnts and check whether the value iof c1='55555' and get the whole parent block which contains values of c1,c2,c3,c4 and insert that to database
    What variables we have to use to get the Similar logic in bpel
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    targetNamespace="http://TargetNamespace.com/FileAdapter"
    xmlns:tns="http://TargetNamespace.com/FileAdapter"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified" nxsd:encoding="ASCII" nxsd:stream="chars" nxsd:version="NXSD">
    <xsd:element name="Associates">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Associate" minOccurs="1" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="C1" type="xsd:double" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;">
    </xsd:element>
    <xsd:element name="C2" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;">
    </xsd:element>
    <xsd:element name="C3" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;">
    </xsd:element>
    <xsd:element name="C4" type="xsd:double" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    Please Look into this and suggest me the solution.
    Regards

    Hello,
    Create a transform between the out variable of you receive activity and in variable of your db adatpter.
    The use an IF in you tranformation file.
    Sample code
    <xsl:template match="/">
    <ns0:TestRahulCollection>
    <xsl:for-each select="/tns:Root-Element/tns:element">
    *<xsl:if test="xp20:matches(tns:C1,'55555')">*
    <ns0:TestRahul>
    <ns0:a1>
    <xsl:value-of select="tns:C1"/>
    </ns0:a1>
    <ns0:a2>
    <xsl:value-of select="tns:C2"/>
    </ns0:a2>
    <ns0:a3>
    <xsl:value-of select="tns:C3"/>
    </ns0:a3>
    <ns0:a4>
    <xsl:value-of select="tns:C4"/>
    </ns0:a4>
    </ns0:TestRahul>
    </xsl:if>
    </xsl:for-each>
    </ns0:TestRahulCollection>
    </xsl:template>
    Thanks
    Rahul

  • 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

  • [CS3 JS WIN] Get XML Element of paragraph?

    Im trying to get the xml element of a selected paragraph.<br />ie:<br /><br /><item><br /><text><br /><code> This is some code </code>   <--this is selected in indesign<br /></text><br /></item><br /><br />When I try to use associatedXMLElements[0].xmlElements - it returns all different elements(item,text,code,etc) how do I get it to return the immediate XML Element?

    Well what I'm doing is selecting a textframe and then looping through the paragraphs, passing them to the procXML function which is when I try to get the xml element.
    The forums ate my structure:
    [item]
    [text]
    [code]This is some code[/code]
    [/text]
    [/item]

  • Create XML Element Tag BasedOn Found Character Style

    Hi,
    Good Day!
    Basically I want to search only for character styles that contains "ntb-", that is why it is hard coded in my searchString variable.
    Although I was able to create XML tag based on selected character style, but it will always add/insert at the end of the parent XML element.
    Can anyone could help me how insert/add that element at the insertion point where the text is found?
    Thanks,
    --elmer
    var myDoc = app.documents[0];
    myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.POINTS;
    myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.POINTS;
    var charStyles = myDoc.allCharacterStyles;
    var foundStyles = Array();
    var searchString = String();
        searchString = 'ntb-';
    var tempName = String();
    var tempName1 = String();
    for(var i = 1; charStyles.length > i; i++){
       tempName = charStyles[i].name;
       tempName1 = tempName.toLowerCase();
       if(tempName1.indexOf (searchString.toLowerCase()) != -1){
           foundStyles.push (tempName);
    var myDialog = app.dialogs.add({name: "Convert Footnote Character Styles to XML Tags",canCancel:true});
    with (myDialog) {
        with (dialogColumns.add().borderPanels.add()) {
            with (dialogColumns.add()) {
                staticTexts.add({staticLabel: "Character style to search : "});        }
            with (dialogColumns.add()) {
                selCharStyle = dropdowns.add({stringList: foundStyles, selectedIndex: 0, minWidth: 175});
    var dialogShown = myDialog.show();
    while (dialogShown) {
        if (selCharStyle.selectedIndex == 0) {
            alert("Must have at least a character style to search!");
            dialogShown = myDialog.show();
            continue;
        } else {
            insertXMLTags(selCharStyle.stringList[selCharStyle.selectedIndex], selCharStyle.selectedIndex, "0");
            break;
    myDialog.destroy();
    alert("Finished!");
    exit();
    function insertXMLTags(cStyle, cStyleIndex, ip) {
        var myFinds = searchStyle(cStyle, cStyleIndex);
        for (i=myFinds.length - 1; i>=0; i--) {
            var myIP = myFinds[i].texts.item(0).insertionPoints.item(0);
            var myParentXML = myIP.associatedXMLElements[0];
            var myChiidXML = myParentXML.xmlElements.add ( cStyle );
            myChiidXML.contents =  myFinds[i].contents;
            //set the selection
            app.selection = myFinds[i].texts.item(0);
            //remove the selected text
            myFinds[i].texts.item(0).remove();
            Utility Functions         
    function searchStyle(cStyle, cStyleIndex){
        var myFinds;
        // if script version is for Indesign CS2
        if (app.scriptPreferences.version < 5){                                 
            app.findPreferences = NothingEnum.nothing;
            app.changePreferences = NothingEnum.nothing;
            myFinds = myDoc.search(undefined, undefined, undefined, undefined,
            {appliedParagraphStyle: pStyle, appliedCharacterStyle: cStyle});
        // else, for CS3 and CS4
        }else{                                 
            //Clear any existing find/change settings
            app.findTextPreferences = NothingEnum.nothing;
            app.changeTextPreferences = NothingEnum.nothing;
            // set character or paragraph style to search
            if (cStyleIndex != 0){ 
                app.findTextPreferences.appliedCharacterStyle = cStyle;
            //Set the find options.
            app.findChangeTextOptions.caseSensitive = false;
            app.findChangeTextOptions.includeFootnotes = true;
            app.findChangeTextOptions.includeHiddenLayers = false;
            app.findChangeTextOptions.includeLockedLayersForFind = false;
            app.findChangeTextOptions.includeLockedStoriesForFind = false;
            app.findChangeTextOptions.includeMasterPages = false;
            app.findChangeTextOptions.wholeWord = false;                             
            myFinds = myDoc.findText();
        return myFinds;

    Here is a way you can find any field.
    Download the current template.
    Open it in word and go to the line that you are interested in.
    The blanket PO# will be a field. Right click on it and go to properties. You will see the xml element there.
    Hope this answers your question,
    Sandeep Gandhi

  • How to map more than one xml element with some Paragraph in a Text Frame

    Hi friends,
    I am new in InDesign Java Scripting and I have to place or map, more than one xml elements of different parents, into one textbox. Is it possible through JavaScript? Can anyone help me in this because I have no idea how it should work and it urgently required.
    Thanks in Advance

    I had answered to you already in your first post: the short answer is that it's not possible on the same text box unless you assign a common ancestor of these two "parents" item. That's not a question of scripting, it's the way Indesign handle the XML with the layout. Import a xml in Indesign and drop tags to page item. What you can do manually is quite representative of what can be done through scripting.
    If you assign this anscestor to the text frame, you have to expect that all text child items will be displayed in the text frame (including the text of all the child of the two "parents" and all the other parents/childs that could be under the common ancestor). Having a XML that is designed for Indesign usage is pretty much inevitable if you are doing anything "serious".

  • Best way to iterate through multiple variables?

    I need to iterate through three different variables (arrays), and was wondering what the best way to do this would be? I am more familiar with C than I am with LabVIEW at this point, but am getting up to speed on LabVIEW pretty quickly. Normally in C, I would just create three nested loops, but I am wondering if this is the best method in LabVIEW or not. I could use a state machine I think, which would give me some flexibility in re-arranging the order of iteration or adding or subtracting variables easier than working with nested loops I think...anyway, I'm open to suggestions.

    R.Gibson wrote:
    I need to iterate through three different variables (arrays), and was wondering what the best way to do this would be?
    Arrays are not "variables". can you be a bit more specific.
    R.Gibson wrote:
    I could use a state machine I think, which would give me some flexibility in re-arranging the order of iteration or adding or subtracting variables easier than working with nested loops.
     Why does the order matter? Rearranging in what way? If you do autoindexing, it will just iterate over all elements until it runs out of elements.
    ... And again, what do you mean by "variables"?
    It would help if you could show us a VI containing some typical input data in controls (make current value default, save) and explain what kind of output you expect.
    LabVIEW Champion . Do more with less code and in less time .

  • Iterate through all documents

    Hi,
    We have a container which contains *1 million* documents, each of which has size 5K. Container type is wholedocument. We need to iterate through all document regualrly using container.getAllDocuments(containerTxn, DBXML_LAZY_DOCS | DBXML_NO_INDEX_NODES). For each document, we will perform a xpath query in xml document in memory.
    The problem here is about whether we should use transaction. If transaction is used, getAllDocuments will report "Lock table is out of available lock entries" error when it scan about 9383 ducuments. Here are lock setting:
    envp->set_lk_max_lockers(6000);
    envp->set_lk_max_locks(6000);
    envp->set_lk_max_objects(8000);
    We have 1 million documents, it is impossible to set lock object to 1 million.
    My questions:
    (1) Is this normal? If so, why performing a dbxml query on the container doesn't cause such an error. I believe dbxml query has to iterate all of documents too.
    (2) Is it possible to use a seek position for getAllDocuments? Thus we can commit transaction every iterating 1000 documents, and then continue the iteration from the last seek position.
    (3) if we don't use transaction to call getAllDocuments, what possible problems will happen? Other threads are using transaction to read/update the documents.
    Thanks.
    -Yuan

    Yuan,
    The quickest thing to try is to add the flag DB_READ_COMMITTED to getAllDocuments(). That may reduce the number of locks you need. While you may not be able to set the various lock parameters to 1 million, you should set them much larger than you have now (e.g. 50k - 100k) for this sort of operation.
    Not using transactions at all can lead to inconsistent data mostly related to index consistency with document content. Depending on the nature of your updates it may be safe. You could get stray exceptions but nothing should crash. E.g. if you are only adding/removing documents you are probably safe without transactions; although you might iterate to a document that's been removed so you'll see an exception which would have to be ignored. I'm not 100% certain this will work well but if you can test it in a high-update environment and see no issues that will tell you. The read side will not interfere with the updates.
    As for "seeking" if you look under the covers getAllDocuments() is really just a wrapper for an index lookup on the name index. The XmlIndexLookup API is quite flexible in terms of returning ranges. If you want to look into returning ranges of documents, do this:
    1. look at the code in XmlContainer.cpp in the function "getDocs()". It uses XmlIndexLookup to perform the operation.
    2. look at the XmlIndexLookup API to figure out how to turn the lookup into a range lookup vs looking up ALL items in the index
    Using XmlIndexLookup and tracking the name of your last-used document you can easily ask for all documents "higher" than that one. Further, if you know how your documents are named lexicographically you can give it a maximum as well if you wanted, but given that you can set your XmlQueryContext to be lazy you can simply iterate N times to get the next N documents without paying a penalty retrieving any documents you don't need.
    For the sort of thing you are doing I highly recommend using XmlIndexLookup directly (with or without transactions) to get the flexibility you need. XmlContainer::getAllDocuments() is merely a "convenience" layer on that class.
    Regards,
    George

  • 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

Maybe you are looking for

  • Modify Calendar Dialog in OIM 9.1.0

    Hi everyone, When I do a request for role assigning in OIM 10g, I see a Calendar Dialog. This calendar dialog is a general calendar dialog. But I want to modify this calendar or I want to create a new calendar dialog. Because I want to do a calendar

  • CODEC used in video file

    Hi , I want to know how to determine the codec used in particular file . Kindly guide me in proper direction thank you regards Karthick G

  • Why does my ipod touch keep pausing itself?

    While listening to my first generation ipod touch, it will just pause itself. Whether using headphones, auxillary jack, or skull candy speakers which connect through the charging port on the ipod. REALLY ANNOYING!

  • How can I set Firefox to open a new page each time it starts

    I need to be able to start automatically a new page when Firefox start. I have my home page setup but I'd like to start a new url in a new window each time Firefox is started. Thanks

  • Deploying .jar with Oracle JDBC thin driver

    I was just experimenting with a Java application that uses an Oracle JDBC driver. It runs fine in JDeveloper. However, when I deploy it to a .jar and run it from a Windows XP Command Prompt I get: Microsoft Windows XP [Version 5.1.2600] (C) Copyright