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

Similar Messages

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

  • How to loop through xml records from file without ROW , /ROW tags?

    I am using dbms_XMLSave.insertXML procedure to insert xml formated record from file. MY xmlformated records does not have open and close ROW tags. I have multiple records in the file.How can I loop through without <ROW>,</ROW> tags?

    I am using dbms_XMLSave.insertXML procedure to insert xml formated record from file. MY xmlformated records does not have open and close ROW tags. I have multiple records in the file.How can I loop through without <ROW>,</ROW> tags?

  • How to reveal XML tags in InDesign CS5.5?

    I'm trying to tag a business catalog for an XML export. I've never done it before - but our sister company has done the same task with a similar catalog. I can view their catalog in InDesign CS5.5 for Windows over a VPN connection in order to see how they tagged their catalog.
    I'm doing this task on a Mac using InDesign CS4. The interfaces are not the same. The biggest problem is the sister company is in Czech and so is InDesign. I need to open the tags pane. On the Mac, its just "Window>>Tags." There is a "Window" (Okna) menu, but I'm not seeing a "Tags" choice. I have the structure open, but I want to see all the little colored tags. How do I reveal these on the Windows CS5.5 version?
    Thanks

    Wouldn't it be View > Structure > ... ?

  • How to add parent XML tag in ID CS5

    Hi,
    I have the following xml structrure in the InDesign cs5 document.
         <para>
              <link>
                    <insert>
    I want to add <xref> tag within this structure as parent to <insert>, like below:
         <para>
              <link>
                    <xref>
                        <insert>
    can anybody help me on this.
    Thanks,
    Krishnan

    Hi,
    First Select <insert> tag,
    var parentTagName = app.selection[0].associatedXMLElements[0].markupTag.name;
            if(parentTagName.toString() == "insert"){
                app.selection[0].associatedXMLElements[0].xmlElements.add("xref", app.selection[0]);
    Regards,
    Bala.

  • Sender sending data through XML, How to process it in ECC (No PI involve)?

    Hi,
    The sender system sending data through XML tag and that need to be processed in SAP side.
    How it can be done without involving XI or IDoc?
    Is it possible through HTTP post?
    Sample XML Transactions
    1. SAP Availability Transaction (Request)
    <?xml version="1.0" standalone="yes"?>
    <ECCAVAILREQUEST>
    <AVAILTEXT>CHK STATUS</AVAILTEXT>
    </ECCAVAILREQUEST>
    2. SAP Availability Transaction (Response)
    <?xml version="1.0" standalone="yes"?>
    <ECCAVAILRESPONSE>
    <AVAILTEXT>OK</AVAILTEXT>
    </ECCAVAILRESPONSE>
    3. DUMMY_SYSTEM PO Transaction (Request)
    <?xml version="1.0" standalone="yes"?>
    <DUMMY_SYSTEM REQUEST>
    <CREATEPB>1</CREATEPB>
    <POORDERDATA>
    05607015156070151TORDAEHTWW05727500002D0979054+
    </POORDERDATA>
    4. DUMMY_SYSTEM Order/Inquiry Transaction (Response)
    <DUMMY_SYSTEM RESPONSE>
    <C_PO>99999</C_PO>
    <RETURNDATA>
    DAT&#13;&#10;
    </RETURNDATA>
    </DUMMY_SYSTEM RESPONSE>

    Hi,
    check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/21/e9c97ceb1911d6b2ea00508b6b8a93/content.htm
    this is for processing inbound IDOc through XML-HTTP(Inbound) port
    like this there should be an option for reading files placed by HTTP_POST.
    in SICF transaction there should be a service to do that.
    defaulthost -> sap-> xi-> adapter_plain. i know you don't have XI in your landscape but this is the component which be responsble for receving messages over HTTP_POST.
    look for a program which can access messages from there.
    please check with your basis team
    Suresh

  • Adobe InDesign CS5 Server JavaScript: Get rectangle by XML tag

    Hi,
    Current set-up:
    Adobe InDesign Server CS5 scripted through ExtendScript via PHP SOAP
    The problem:
    I'm currently placing an image file into a rectangle using the following code:
    frame     =   doc.rectangles[0];
    imgList   =   frame.place(new File(img));
    This works fine; the img file is placed into the rectangle as expected. However, this only refers to the first rectangle in the document: if I have two rectangles in the document, the image is placed into the last created rectangle.
    What I'd ideally like to be able to refer to the rectangle by its XML tag - something like:
    frame     =   doc.getRectangleByTag('Pic'); // <Pic> being the name of the XML tag
    imgList   =   frame.place(new File(img));
    Does anyone have any advice as to how this can be achieved? I realise this is rudimentary question, but am finding no joy after several hours of searching.
    Many thanks

    What I'd ideally like to be able to refer to the rectangle by its XML tag - something like: 
    frame     =   doc.getRectangleByTag('Pic'); // <Pic> being the name of the XML tag
    imgList   =   frame.place(new File(img));
    Are you sure you want to do it this way?
    Could you explain why? I suspect there is a better solution.
    In any case, at least in my test case, the XML tag is associated with the image inside the frame and not the frame itself. So if you want the frame, you must get the image associated with the tag and then go up to the parent. This works in a simple test:
    var frame =
        app.activeDocument.xmlElements[0].
        evaluateXPathExpression("//tennis")[0].
        graphics[0].parent;
    [object Rectangle]

  • Search for, edit, and delete XML tag (Adobe InDesign Server CS5)

    Hi all,
    I'm working with Indesign Server CS5 and JavaScript, though having some trouble coming up with a solution to a problem...
    I need to build a JS script (called through SOAP) that will enable me to search an InDesign file for a given XML tag.
    Upon finding the XML tag, if the 'action' variable is set to delete, it should delete the tag and its contents.
    If the action is set to edit, it should change the contents of the tag to some user-specified content.
    The primary caveat is that the XML tag is variable, as is the XML structure of the InDesign file.
    Here's what I have in mind, in pseudocode:
    function findXMLTag(tag, action) {
         app.searchForTag(tag);
         if (tagIsFound) {
              if (action == "delete") {
                   tag.delete;
              } else if (action == "edit") {
                   tag.contents = "Updated content";
    Any help would be greatly appreciated!
    Thanks,
    Ben Kay

    'searchForTag' can be implemented as a recursive function.
    Recursion is defined like this: I thought, "I'll just search this forum for 'recursion'." The first post I found was one of my own, suggesting that the poster should search the forum for 'recursion'.
    Here is an example: find the XML Element [<email>]
    And another: Remove xml element using JS[CS3] (read carefully, as the OP got stuck on how to successfully remove an element and continue)
    And one, using XML Rules -- which I'm totally unfamiliar with, but may work for you: Changing Values in XML tags

  • IDOC to File, variable substitution on outbound message XML tag attributes

    My scenario is IDOC to FILE using XSL mappings.The target format is 2 XML tags (header, line) with the data stored in the attributes of each tag.
    EG. <header attr1=one attr2=two attr3=three><line attr1=one attr2=two /></header>
    The name of the file is dictated by an outbound attribute value in the header tag.
    Can I get access to it the attribute in the target message in the CC_FILE using variable substution. ?
    Currently I am not using content conversion as the XSL produces the file format needed, so I would pefer not to change the outbound message format/structure as this is going to an external party. I would prefer not to change the outbound format as this would need content conversion to strip the unwanted/information/processing node that is used for this purpose (file naming).
    The name is a calculation of fields in the IDOC and is not explicit dictated (business logic is applied in the mapping to get the file name), so I would prefer to use the attribute of the resulting XML to keep the "business logic" in the XSL..
    Things that cannot be changed.... 1. Must use XSL.for mapping. 2. Format cannot be changed of the outbound message. 3. Would prefer not to involved content conversion to keep formatting/node structure in the XSL mapping.
    I have seen some reference to this being possible on the forums but nothing solid from what Ive read.
    Something like var1 = payload:/Header/@attr1 in variable sub to get at the attribute
    Any comments ?
    Thanks in advance.
    One final piece of info. its on a PI 7.1 system.

    I think its best explained by my other thread Link:PI 7.1 Access to Dynamic Configuration through Java Class .
    Thanks for the link I have already implemented based on that link but the one crucial difference is that it is implemented using a static method with no reference to the actual object (payload) for Dynamic configuration. It seems that without the 7.0 API which isnt available in 7.1 by default XSL with java extentions is limited to static methods. If you could read the other thread it certainly is possible I'm mistaken.

  • Checking .txt file with valid XML tags

    hey guys,
    I've a .txt file which conatins info with XML tags. I've to check whether the file contains valid tags or not!
    a tag should start with "<" and end with ">", there shouldn't be space between characters after "<" e.g.
    a tag should be like "<name>" or "</name>" not "< name>" or  "< /name>" nor "<name" or "</name"nor "name>" or  "/name>"Here is an example of a well formed XML document:
    <root>
    Some text <nextTag> more text  <secondTag> stuff </secondTag> </nextTag> more text again
    </root>Here is an example of XML .txt file:
    <students >
         <student>
              <name> John </name>
              <name> Doe </name>
              <address> 98 Pine St.</address>
         </stdnt>
    </students>I also have to make sure that no text appears before and after the root tag! Please help me, i'm trying to figure out but my alogrithm just doesn't work! Thanks in advance!!!

    What's the purpose of those requirements? If you
    wanted to check whether the file was well-formed XML
    then you would just need to run it through an XML
    parser. But some of the things you plan to reject are
    actually well-formed XML. I don't see the point of
    that.basically, it's my assignment. In the assignment our task is to check the .txt files to make sure that all XML tags are valid. The problems i mentioned in my first post, i've figured those out, eventually. There're few other things which i've to also make sure for example no text appearing before and after the root tag
    Can someone please tell me how i can check following cases:
    text<root> or </root> text  (both are invalid XML files)

  • 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

  • How to create a flat file without any xml tags in PI 7.0

    Hi
    I would like to take the content of the tiff-tag and map it to a file, which content is the value of the tiff-tag. How do I do that?
    source:
    <sourcexml>
       <tiff>dhlflfhlfhjhfjhfakjhfkjhfkjhfahflkhflahfalhfalhfldhflkahflak</tiff>
    </sourcexml>
    resulting content of file:
    "dhlflfhlfhjhfjhfakjhfkjhfkjhfahflkhflahfalhfalhfldhflkahflak"
    The point is, the the resulting file should not contain any xml tags but only the plain value of the tiff tag in the source document.
    Do I need to specify something in the receiver file adapter?
    tiff is an image format.
    BR
    Mikael

    Hi
    after the mapping and thus as input to the File receiver  CC the message looks like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:blob xmlns:ns0="http://dongenergy.dk/pi/zztest/milun">
      <indhold>tiffog dadada</indhold>
      </ns0:blob>
    Recordset Structure is set to "indhold,1"
    and the "lines" are
    indhold.addHeaderLine  = 0
    indhold.fieldSeparator = 'nl'
    A file is created but it is empty.
    Mikael

  • Reading a xml file and Extract content of xml tags

    Hi,
    I need a InDesign script to Extract content of xml tags by reading a local xml file. And stamping the content of xml on InDesign Text frame.
    My sample xml is as follows .
    <events type="array">
    <event> 
    <aktiv_jn>J</aktiv_jn> 
    <enetpulse_id>1712408</enetpulse_id>
    <event_id>65974</event_id>
    <hjemmehold>AZ Alkmaar</hjemmehold>
    <id>93</id>
    <kickoff>2014-08-17T12:30:00+01:00</kickoff>
    <land_id>140</land_id>
    <land_navn>Holland</land_navn>
    <liga_id>13684</liga_id>
    <liga_navn>Eredivisie</liga_navn>
    <livebetting_jn>J</livebetting_jn>
    <marked_id>2897740</marked_id>
    <marked_nummer>138</marked_nummer>
    <marked_tekst>AZ Alkmaar - Ajax</marked_tekst>
    <moderkamp_jn>J</moderkamp_jn>
    <ob_bet_type>MR</ob_bet_type>
    <odds_1>2.95</odds_1>
    <odds_2>2.25</odds_2>
    <odds_x>3.35</odds_x>
    <program_slut>2014-08-18T23:59:00+01:00</program_slut>
    <program_start>2014-08-15T00:00:00+01:00</program_start>
    <resultat>2</resultat>
    <spilstop_dato_tid>2014-08-17T12:30:00+01:00</spilstop_dato_tid>
    <sport_id>21</sport_id>
    <sport_navn>Fodbold</sport_navn>
    <taerskel nil="true"/>
    <udehold>Ajax</udehold>
    <udfald_1_id>9661951</udfald_1_id>
    <udfald_2_id>9661953</udfald_2_id>
    <udfald_x_id>9661952</udfald_x_id>
    </event>
    </events>
    And on my Indesign Page upon execution of script: I need text like,
    land_navn:     Holland
    odds_1:     2.95
    odds_2:     2.25
    odds_x:     3.35

    Hi,
    Try:

  • Add XML Tag to XML File (Idoc to XML File)

    Hi there.
    Just a question regarding the addition of a tag header in an XML file please?
    Idoc - > XI -> file (XML File)
    We have a need to add something like this below in bold to XML Tag Header in the inbound file:
    <?xml version="1.0" encoding="UTF-8"?>
    <?POSTEN SND="SE03220037090" SNDKVAL="1" REC="SE03220669500"
    MSGTYPE="ORDERS"?>
    Any ideas on how this can be managed would be apreciated please?
    Thank you.
    Mick.

    Hi Carlos.
    Thanks for your reply. I like what you are suggesting, however, I have no knowledge of Java and how to implement this Java addition to the mapping interface.
    I would appreciate any hints you may have. The value that I am trying to add to the tag header is exactly as it is below(the value in bold) and it can in fact be fixed, i.e. I am not looking to dynamically determine the values in the additional tag but just add the value as it is below...
    <?xml version="1.0" encoding="UTF-8"?>
    <?POSTEN SND="SE03220037090" SNDKVAL="1" REC="SE03220669500"
    MSGTYPE="ORDERS"?>
    I would appreciate any input from you on that.
    Thanks in advance Carlos.
    Mick.

Maybe you are looking for