Add unflatteded array of arrays of XML element?

Hello everyone, once again

I'm reading in an old XML file to get the data from it and write the data to an XML file which is almost identical, but has another control for each section. To change this VI I work still must add the ENUM "Welding/potting" (the control that was added to each section) array of arrays that is noticed.

Basically, it's just a problem of flow data, just trying to get the corresponding data types. Im trying to add the ENUM ' Welding/table to draw' to all the tables to match the output (to the right of the VI) suggestions necessary?

Thanks to you all!

Solved, indexed with a loop For, then Unbundled and was able to add normally

Tags: NI Software

Similar Questions

  • How can I multiply all values of an array of 4 elements, with all its opposite values, resulting in an array with all 16 products?

    I'm quite new to LabVIEW (v.8.0) and I'm trying to understand the best way to have a table of 4 elements multiplied by its inverse values, resulting in an array of 16 elements

    Values of table 1 = 1, 2, 3, 4

    Values of table 1 reverse = 0.5, 0.33, 0.25, 1

    Resulting table = (0.33 0.25, 0.5, 1, 2, 1, 0.66, 0.5, 0.75, 1, 1.5, 3, 1.32, 4, 2, 1)

    Any advice would be appreciated. Thank you!

    You can try something like the following (the last operation is "reshaping table")

  • What is the best way to always increment at index 0 only for an array of multiple elements?

    The principle is to complete a worksheet of left right in the same line but the increment of the column letter only (IE - B4 and C4 etc.). Herewith, I adapted an existing example VI that works for an array of 2 elements (ie - B4) but does not work for a 3-element array (ie - B40, B50 becomes). Keeping simple, what is the best way easier to modify my existing code to always check that the size of the table and the index automatically return to 0 to correctly increment the first letter only (IE - B) and not the number (IE - 4)?

    Thank you!

    Barry

    Instead of 'index automatically to zero', why not just make a zero instead of the size of table manipulation-1-1?

    Of course it will all fall apart once you get to column Z.

    Also look into the Board of Excel.   Do not post question.  This is just a link to the other discussions related to Excel.  Some of them might give you ideas how to manipulate your cell references.

  • Array with the element in Type String

    Hi all

    It seems that I couldn't create an array with the element in the string Type, all that available to choose is double or decimial.

    I'm sure it's my fault because I'm fresh for her.

    Any idea is appreciated,

    + Kunsheng

    You should be able to use array initialize with data type to string, see below:

  • I need to find all of the XML elements and add a line break for the text of each of them

    I need to find all XML elements and to add a line break the text of each of them.

    Is it possible with a script?

    Try this piece of code as it is. I hope that's what you want...

    var myDoc = app.activeDocument;
    var inddRooElement = myDoc.xmlElements.item(0);
    var xPathElements = inddRooElement.evaluateXPathExpression("//*");
    var elementCount = xPathElements.length;
    for(var eId=0; eId
    

    ----------------

    Green4ever

  • How to add content in the xml element?

    I need to insert a word sqrt (plain text without tags) in the xml element of m:msqrt as below:

    enter image description here

    I tried,

         

    var path = (app.activeDocument.fullName.parent.fsName) m:System.NET.SocketAddress.ToString () replace (/ \ / g, ' /'); document path (sample.indd) active

    var xmlPath = (app.activeDocument.fullName.parent.fsName) m:System.NET.SocketAddress.ToString (.replace(/\\/g, '/')) + "" / with_aid2.xml ";"

    xmlFile = file (xmlPath);

    {if (xmlFile.Exists)}

    xmlFile.open ();

    var myString = xmlFile.read ();

    xmlFile.close ();

    myXml = new XML ();

    myXml = XML (myString);

    var msqrtCount = myXml.xpath("//m:msqrt");

    } else {alert (xmlPath + "does not exist!") ;}}

    for (var i = 0; i < msqrtCount.length (); i ++) {}

    var added = msqrtCount [i];

    added.contents = "sqrt";

    }

    I get an error indicates the invalid content property.

    Try this,

    var myDoc = app.activeDocument;
    mySqrtTag(myDoc)
    function mySqrtTag(elm)
    {
        for (var i = 0; i < elm.xmlElements.length; i++)
        {
            if(elm.xmlElements[i].markupTag.name.toString() == "m:msqrt")
            {
                elm.xmlElements[i].insertionPoints[0].contents = "sqrt";
            }
            mySqrtTag(elm.xmlElements[i]);
        }
    }
    
  • Apply the style of Pará to the xml element based on the type of master page?

    IM using a flow xml, im importing the xml to be used across different master page templates and I want to apply paragraph styles different items depending on what master page xml, they are on...

    So I have 3 put templates in place

    Type of page 1

    Type of page 2

    Type of page 3

    and 3 paragraph styles

    style 1

    style 2

    style 3

    I have the same xml structure deposited on each page...

    < Entry >

    < name > Page < / name >

    < / name >

    So, can I use javascript to apply the paragraph (style 1) style to the xml element (name) on any page that uses the master page (type of Page 1)

    Is this possible? whether and how this could be done?

    Thanks in advance

    Hello

    Try:

    #include '... / XML rules/glue code.jsx ";

    myDoc var = app.documents.item (0);

    var myRuleSet = new Array (new applyParaStyle());

    {with (MyDoc)}

    var elements = xmlElements;

    __processRuleSet (Elements.Item (0), myRuleSet);

    }

    function applyParaStyle() {}

    myIdName = "Xp".

    This.XPath = "//restaurant_name";

    This.Apply = function (myElement, myRuleProcessor) {}

    {with (MyElement)}

    {Switch(insertionPoints[0].parentTextFrames[0].) ParentPage.appliedMaster.Name)}

    case "X-Master:

    App.Select (texts);

    App.Selection [0]. FillColor = myDoc.colors.item ("xxxx");

    break;

    case 'guide-Scotland:

    App.Select (texts);

    App.Selection [0]. FillColor = myDoc.colors.item ("scotland");

    by default:

    break;

    }

    }

    Returns true;

    }

    }

  • How to pass the content of an xml element in the text frame in inDesign Script

    var XMLFile = File.openDialog ("select XML Files... ») ;

    var doc = app.activeDocument;

    If (!) App.Documents.Length)

    {alert ("ERROR: Document not opened");}

    return;

    }

    doc.importXML (XMLFile);

    var firstFigureNode = doc.xmlElements [0] .xmlElements [1] .xmlElements [0];

    var lableNode = firstFigureNode.xmlElements [0];

    var lableNodeText = lableNode.contents;

    myFrame var = doc.textFrames.add ({geometricBounds: [-13, 13, 3, -3]});

    lableNodeText.move (LocationOptions.AFTER, myFrame.texts [0]);

    ========================================================

    My requirement is: == > > move the content of an xml element in the text by inDesign Script block, but XML InDesign file Structure should not be change & data in the XML Structure should remain as it was before...

    I tried to code above, but it does not work...

    Please can someone help me in solving this problem...

    It does not work correctly...

    It moves firstFigureNode in myFrame...

    firstFigureNode.placeXML (myFrame);

    ===>> For Apple Script try below Code ===>>

    myFrame markup using firstFigureNode

  • Check for the existing XML element

    Hi all

    I'm writing a simple script first check if an XML element exists and creating so if it's not. I tried to change a piece of code that I used previously to do the same for paragraph styles, but apparently it's not that simple. Currently, all I get is the error "Unable to run the script in the 'main' target engine!" Without checking them, adding the XML element based on the result of the search works very well.

    /* Find all instances of the word "Superscript" */
    app.findTextPreferences.findWhat = "Superscript";
    var mySuperscript = myDocument.findText(); // Save search result for future reference
    
    /* See if an XML element named "Superscript" already exists, and create it if that's not the case; then add it to all instances of the word "Superscript" */
    var myXMLElementSuper = myDocument.xmlElements.item("Superscript");
    try {
    var myName = myXMLElementSuper.name;
    }
    catch (myError){
        var myXMLElementSuper = myDocument.xmlElements.add({markupTag:"Superscript", xmlContent:mySuperscript[i]});}
    

    Any help would be greatly appreciated!

    Regards and thanks in advance.

    Julian

    The myDocument.xmlElements always has a single element - the root element.

    If you want your element directly below that, you have to work a level down.

    To try-catch for such situations regular aid is bad because you spend so usually the ESTK option stop on exceptions and real problems don't miss. Use the isValid property.

    var rootXE = myDocument.xmlElements.item(0);
    var superXE = rootXE.xmlElements.itemByName("Superscript");
    if( !superXE.isValid )
      superXE = rootXE.xmlElements.add(...
    else
     superXE = superXE.getElements()[0]; // take first of potentially multiple elements
    
  • Add a xmlns tag to the XML using DBMS_XMLGEN

    I'm using the version of Oracle version 10.1.0.4.2.

    I want to create an xml file according to some data in the relational database tables. For the same thing, I created object types and discovers with the types of objects, since the data is divided into several tables.

    Then, I used DBMS_XMLGEN.getxml to generate xml with queries from the view of the object.

    Y at - it an option to add the xmlns attribute in the xml file generated.

    Please let me know if any additional details are needed.

    If you want to add the namespace declaration to the root element, I don't think it's possible with DBMS_XMLGEN directly.
    You can ask DBMS_XMLGEN to treat some of the fields of the object as XML attributes by prefixing with '@' (for example '@my_attribute'), but you can't control which for bounding of the elements.

    A possible solution is to add it later, using XSLT, or insertChildXML, but apparently it is not available in your version.

    However...

    For the same thing, I created object types and discovers with the types of objects, since the data is divided into several tables.

    Because the data from different tables, why not use SQL and SQL/XML functions to build the document?
    This is simple, simple and needs no additional items.

    select xmlelement("Departments",
             xmlattributes('http://xmlns.example.org' as "xmlns")
           , xmlagg(
               xmlelement("Department",
                 xmlattributes(d.deptno as "Id")
               , xmlelement("Name", d.dname)
               , xmlelement("Employees"
                 , xmlagg(
                     xmlelement("Employee",
                       xmlattributes(e.empno as "Id")
                     , xmlforest(
                         e.ename as "Name"
                       , e.job as "Job"
                       )
                     ) order by e.empno
                   )
                 )
               ) order by d.deptno
             )
           )
    from scott.dept d
         join scott.emp e on e.deptno = d.deptno
    group by d.deptno, d.dname
    ;
    

    Output:

    
      
        ACCOUNTING
        
          
            CLARK
            MANAGER
          
          
            KING
            PRESIDENT
          
          
            MILLER
            CLERK
          
        
      
      
        RESEARCH
        
          
            SMITH
            CLERK
          
          
            JONES
            MANAGER
          
          
            FORD
            ANALYST
          
        
      
      
        SALES
        
          
            ALLEN
            SALESMAN
          
          
            WARD
            SALESMAN
          
          
            MARTIN
            SALESMAN
          
          
            BLAKE
            MANAGER
          
          
            TURNER
            SALESMAN
          
          
            JAMES
            CLERK
          
        
      
    
    
  • Loop through all of the xml elements

    How do I loop over all xml tagged in a story? I created a reference to the xml elements of the story I want to like this:

    var xmlStory = myDoc.xmlElements[0].xmlElements[0];
    

    In this structure, I have items < v > 10 / < v >, which I want to change of < id v '10' = > 10 / < v >. I want to do in the InDesign scripting and not with XSL export because of workflow, I plan. I know I can loop on children in the structure like this:

    for(var i=0;i<xmlStory.xmlElements.length;i++){
                        if(xmlStory.xmlElements[i].markupTag.name == "v"){
                                  xmlStory.xmlElements[i].xmlAttributes.add("id", xmlStory.xmlElements[i].contents);
                       }
             }
    

    This works very well for the first level, but I want to find all elements with the tag '< v >. These tags can appear at any level in the structure. How can I make sure that all of them are included and not just the first elements of the child of the element of the story?

    Try this,

    #target inDesign;

    var doc = app.activeDocument;
    xmlTag var = doc.xmlElements [0];
    var vTag = xmlTag.evaluateXPathExpression("//v")
    for (var i = 0; i)<>
    {
    Try
    {
    vTag [i].xmlAttributes.add ("id", vTag [i].xmlContent.contents)
    }
    {catch (e)}
    }

  • How can I save the references to the elements of the xml elements page?

    Hello

    I am trying to add coordinates of the page elements to their associated as xml attributes xml elements.

    I can easily create xml help items

    myDocument.mapStylesToXMLTags ();

    Now, I want to browse the xml document and find details of each element of the associated page and then add them in the corresponding as attributes xml node.

    In other words, I'm trying a code (assuming that all the nodes as children of the root for simplicity) as follows:

    for (var i = 0; i < myRootXMLElement.xmlElements.length; i ++) {}

    var myElement = myRootXMLElement.xmlElements.item (i);

    var myElementsPageItem = * did not find a reference of function / correct documents *.

    var myBounds = myElementsPageItem.visibleBounds;

    addORupdate (myElement, "y1", myBounds [0]);

    addORupdate (myElement, ' x 1', myBounds [1] ");

    addORupdate (myElement, "y2", myBounds [2]);

    addORupdate (myElement, ' x 2', myBounds [3] ");

    }

    In my example of document all the xml that is created by mapStylesToXMLTags() are history of type.

    So I need a way to refer to the corresponding (or rectangle) page element of the history so that I can add information about contact information item xml as attributes.

    Thank you very much...

    myElement.xmlContent.parentTextFrames was not defined in the xml document that is generated by mapStylesToXMLTags()

    After some research the object model, I found my data in

    myElement.xmlContent.textContainers [0]

    Thank you

    Halin

  • Add namespaces via XQuery to an XML Instance

    I'm juggling a question from a colleague, which I think is a good exercise. When you use the latest version of the database, I try to add namespaces in a document XML, 'the way XMLDB.

    My colleague needs this because he works with object types is the context of the use of Oracle Enterprise Service Bus / SOA costume. He needs convert object types in XML format, but WITH the namespace declarations.
    I want to solve it, for instance via XQuery, but am a bit stuck.

    TEST SCENARIO
    SQL> CREATE OR REPLACE TYPE PAF_FLOW_EVENT_T AS OBJECT
      2   (  proces_id            number
      3   ,  proces_type          varchar2(30)
      4   ,  proces_name          varchar2(100)
      5   ,  proces_aanmaakdatum  date
      6    ,  event                varchar2(30)
      7   ,  os_user              varchar2(50)
      8   ,  betrokkene_id        number
      9    ,  begunstigde_id       number
     10    ,  opmerking            varchar2(2000));
    
    Type created.
    
    SQL> create or replace
      2  function paf
      3  return PAF_FLOW_EVENT_T
      4  as
      5  begin
      6    return PAF_FLOW_EVENT_T( 1, 'ProcessType','ProcessName',sysdate,'EventName','OSUser',999,666,'Remark'
      7                     );
      8  end;
      9 /
    
    Function created.
    
    SQL> select paf from dual;
    
    PAF(PROCES_ID, PROCES_TYPE, PROCES_NAME, PROCES_AANMAAKDATUM, EVENT, OS_USER, BE
    --------------------------------------------------------------------------------
    PAF_FLOW_EVENT_T(1, 'ProcessType', 'ProcessName', '03-SEP-10', 'EventName', 'OSU
    ser', 999, 666, 'Remark')
    
    
    1 row selected.
    
    SQL> set long 10000
    SQL> set pages 5000
    SQL> set feed on
    
    SQL> select xmlquery
      2         ('xquery version "1.0"; (: :)
      3          $i/*
      4          '
      5          passing xmltype(paf) as "i"
      6          returning content
      7         )
      8          as "XMLQuery Output"
      9 from  dual;
    
    XMLQuery Output
    --------------------------------------------------------------------------------
    <PAF_FLOW_EVENT_T><PROCES_ID>1</PROCES_ID><PROCES_TYPE>ProcessType</PROCES_TYPE><PROCES_NAME>ProcessName</PROCES_NAME><PROCES_AANMAAKDATUM>03-SEP-10</PROCES_AANMAAKDATUM><EVENT>EventName</EVENT><OS_USER>OSUser</OS_USER><BETROKKENE_ID>999</BETROKKENE_ID><BEGUNSTIGDE_ID>666</BEGUNSTIGDE_ID><OPMERKING>Remark</OPMERKING></PAF_FLOW_EVENT_T>
    
    1 row selected.
    Out necessary (without the pretty print) would be
    XMLQuery Output
    --------------------------------------------------------------------------------
    <PAF_FLOW_EVENT_T xmlns="http://www.domainname.nl/pas/events/">
      <PROCES_ID>1</PROCES_ID>
      <PROCES_TYPE>ProcessType</PROCES_TYPE>
      <PROCES_NAME>ProcessName</PROCES_NAME>
      <PROCES_AANMAAKDATUM>03-SEP-10</PROCES_AANMAAKDATUM>
      <EVENT>EventName</EVENT>
      <OS_USER>OSUser</OS_USER>
      <BETROKKENE_ID>999</BETROKKENE_ID>
      <BEGUNSTIGDE_ID>666</BEGUNSTIGDE_ID>
      <OPMERKING>Remark</OPMERKING>
    </PAF_FLOW_EVENT_T>
    Someone at - it an idea. As said tried several approaches, but or my mind is fuzzy at that time or...

    Also tried things like: http://fgeorges.blogspot.com/2006/08/add-namespace-node-to-element-in.html

    .. .but it seems that, for this latest version, this could be a bug
    SQL> select xmlquery
      2         ('xquery version "1.0"; (: :)
             declare function local:add-ns-node
      3    4                                  ($elem   as element(),
                                     $prefix as xs:string,
      5    6                                   $ns-uri as xs:string
                                    ) as element()
      7    8           {element { QName($ns-uri, concat($prefix, ":x")) }{ $elem }/*}; (: :)
             local:add-ns-node(<xxx><a/></xxx>, "p1", "uri2")
      9   10          '
     11          returning content)
     12          as "XMLQuery Output"
     13  from  dual;
    
    XMLQuery Output
    --------------------------------------------------------------------------------
    <xxx><a/></xxx>
    
    1 row selected.
    Published by: Marco Gralike, Sep 3, 2010 14:44

    Marco,
    I attest to XQuery (yet) so it is probably better (more correct) to put this together, but here are two ways I came with to reproduce your desired results. The first is a simple hack assuming you know what you want the node root to look like. The second is a little more dynamic, but I feel does not work if you have grandchildren in the XML file. (It's all about 11.1.0.6)

    SQL> set linesize 120
    SQL> select xmlquery
      2         ('xquery version "1.0"; (: :)
      3           let $x := $i/*/*
      4           return {$x}
      5           '
      6           passing xmltype(paf) as "i"
      7           returning content
      8          )
      9          as "XMLQuery Output"
     10    from dual;
    
    XMLQuery Output
    ------------------------------------------------------------------------------------------------------------------------
    1ProcessTypeProcessName03-SEP-10EventName<
    OS_USER>OSUser999666Remark
    
    SQL> select xmlquery
      2         ('xquery version "1.0"; (: :)
      3           let $rn := fn:name($i/*)
      4           return element {$rn}
      5                  {attribute xmlns { "http://www.domainname.nl/pas/events/" },
      6                   for $x in $i/*/*
      7                   return element {name($x)} {$x/text()}
      8                  }
      9          '
     10          passing xmltype(paf) as "i"
     11          returning content
     12          )
     13          as "XMLQuery Output"
     14    from dual;
    
    XMLQuery Output
    ------------------------------------------------------------------------------------------------------------------------
    1ProcessTypeProcessName03-SEP-10EventName<
    OS_USER>OSUser999666Remark
    

    I ran your local: Add-ns-node example, through XML Spy and it produces the result shown on this web page. Maybe a bug or feature not taken in charge of 11g yet?

    I ran both of my samples above Spy as well. The first ran cleanly and the second produces an error message

    XQuery runtime error!
    Expression of a computed attribute constructor name returns a QName, which is in the namespace for xmlns http://www.w3.org/TR/REC-xml-names

    The second error message makes sense, but I have not validated. I don't currently have all the other engines to throw XQuery by given my experience with the engines of the spy.

  • that means xml, when I try to set up an analysis of the image years ago, I get the message that there are on this scan xml elements and if I save it, elments of xml will be cleared. What is

    When I bring up some old pictures on my computer, it comes like a scan, when I opened the scan he says he has xml elements, which, if I save it, the xml elements will be deleted, what are xml elements

    The normal definition of xml is the Extensible Markup Language and is the most used in the web development. There is no logical reason why scans contain xml in their breast.

    All files have an extension that is used by Windows to identify what program to use to open the file. Word uses .doc or .docx format, Excel .xls or .xlsx, Adobe uses .pdf etc.

    Right-click on one of the files and select Properties, in the general tab, it displays the type of file and its extension.

    You are referring to 'initials pvt' but pvt isn't a common file extension and is used by a couple of applications, but have nothing to do with analysis or graphics.

    Up to what you did what in fact do a copy files (copy the directory as a whole) and let the originals intact.

    Although Word works with graphics files which is not normally the native program to use, can you explain the steps that you use to open the files.

  • Create the XML element for the cell in the chart CC2015

    Hello world

    I am currently working with the xml element.

    And I want to create xml, table cell element.

    For now, I can create xml for the graphic cell by select graphic image of that cell, and then call the AutoTag() function.

    But I want to create an xml element of a chart without selected cell.

    I found the function () Utils < IXMLElementCommands >-> CreateElement()

    but it doesn't seem to work with a graphic table cell structure.

    Does anyone know how to do?

    Thanks in advance.

    Try,

    InterfacePtr cellContent (tableModel-> QueryCellContentBoss (gridAddress));

    if(cellContent == Nil) {}

    break;

    }

    InterfacePtr cellXMLReferenceData (cellContent, UseDefaultIID());

    {if(!cellXMLReferenceData)}

    break;

    }

    XMLReference cellXMLRef is cellXMLReferenceData-> GetReference();.

Maybe you are looking for

  • Lack of visibility of the download link

    Before I got demoted to the FF40, I could hover over a link and the gray bar above the task bar would show what was the link. He could also tell me which was being downloaded. Now, I can't say that a link is really, do not know what is the download,

  • Battery on Satellite A210

    Hi all I have the Satellite A210-1as, and it has a battery life of about 20 min. Lappy is a couple of months and this week is the first time that I ve actually used without being able to... (Nice try).I say just Toshiba or is it only a bad batting fo

  • A6E99EA #ACQ: producd key of window 7 hp

    I need help with the product key for my HP 630

  • Drag and drop the models of the range of functions

    I really like how can I drag and drop a States JKI Machine in range of my service on a block diagram.  Instead of placing a Subvi on black chart, the code in the template is placed on the block diagram.  How can I get my own templates for this?

  • Why the right mouse clicking on the icons and thumbnails cause error message and the screen resets?

    When I returned from vacation, my PC worked as usual, but later in the day that it would be not laod, it gets to a certain point and then a blue screen and try a reboot. Managed to use the 'safe mode' and finally 'System restore', but it kept crashin