Find the XML Element [ email ]

Hi All,
I am new to InDesign scripting.
I want to know how to find the XML Element [<email>] in n number of nested structure?
Give me any idea.
Thanks, RAJ

Hi RAJ,
See my updated code below:
var myDocument = app.activeDocument;
FindEmail(myDocument);
alert("process Completed");
function FindEmail(elm)
    for (var i = 0; i < elm.xmlElements.length; i++)
        XMLelementName=elm.xmlElements[i].markupTag.name.toString();
        if(XMLelementName=="email")
            elm.xmlElements[i].markupTag = "mail";
        FindEmail(elm.xmlElements[i]);
Regards,
Ramkumar .P

Similar Messages

  • How to find the xml elements in Indesign pages

    i imported the xml file in vb.net. now i want to find the number of pages and no. of elements. i found out it. but i was not able to find which elements are placed in which page. i want that information. plz kindly help. i am using vb.net.<br />for eg. <ce:figure> placed in which page no., <ce:sections> placed in which page no., etc..,

    I imported the xml file in vb.net. now i want to find the number of pages and no. of elements. i found out it. but i was not able to find which elements are placed in which page. i want that information. plz kindly help. i am using vb.net. for eg. <ce:figure> placed in which page no., <ce:sections> placed in which page no., etc..,

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

    I need to find all XML elements and add a line break to the text of each of them.
    Is this possible with a script?

    I need to go from this ...
    to this...
    but looking for the XML elements (not paragraphs) and then adding text ...
    Thanks for your attention !!!

  • How to Find the XML Tag in indesign

    HI!!<br /><br />We are working with XML work flow in indesign. In indesign how could we find the XML Tag in indesign.<br /><br />Example::<br />In the Below list we could have to find the xml tag <chapter> in story editor or in the main text frame in indesign using find option. Kindely sent if any Plugins is available.<br /><br />For exmaple:<br />************<br /><book><br /> <part><br /> <chapter><br />  <head><br />   <para><br />    <bold><br /><br />Thanks,<br />C.K.Venkatesan

    I imported the xml file in vb.net. now i want to find the number of pages and no. of elements. i found out it. but i was not able to find which elements are placed in which page. i want that information. plz kindly help. i am using vb.net. for eg. <ce:figure> placed in which page no., <ce:sections> placed in which page no., etc..,

  • How to escape or remove the special characters in the xml element by regula

    Hi members,
    How to escape or remove the special characters in the xml element by regular expression  in java??
    For Example ,
    <my:name> aaaa </my:name>
    <my:age> 27 </my:age>
    In the above example , i have to retrieve the value of the <my:name> Element(For examlpe -- i have to get "aaaa" from <my:name> tag)...
    How to retreive this value by using DOM with XPATH in java
    Thanks in Advance

    Hi members,
    I forget to paste my coding for the above question....This is my coding......In this display the error...... Pls reply ASAP.......
    PROGRAM:
    import java.io.IOException;
    import java.util.Hashtable;
    import java.util.Map;
    import org.w3c.dom.*;
    import org.xml.sax.SAXException;
    import javax.xml.parsers.*;
    import javax.xml.xpath.*;
    public class DOMReaderForXMP {
         static Document doc;
         static XPath xpath;
         static Object result;
         static NodeList nodes;
         public DOMReaderForXMP() throws ParserConfigurationException, SAXException,
                   IOException, XPathExpressionException {
              DocumentBuilderFactory domFactory = DocumentBuilderFactory
                        .newInstance();
              domFactory.setNamespaceAware(true);
              DocumentBuilder builder = domFactory.newDocumentBuilder();
              doc = builder.parse("d:\\XMP.xml");
              XPathFactory factory = XPathFactory.newInstance();
              xpath = factory.newXPath();
         public static void perform(String path) throws Exception {
              result = xpath.evaluate(path, doc, XPathConstants.NODESET);
              nodes = (NodeList) result;
         public void check() throws Exception {
              perform("//my:name/text()");
              if (!nodes.item(0).getNodeValue().equals("application/pdf")) {
                   System.out.println("Mathces....!");
    ERROR:
    Exception in thread "main" net.sf.saxon.trans.StaticError: XPath syntax error at char 9 in {/my:name}:
    Prefix aas has not been declared

  • [JS-CS4] - How to read the XML Element and its Attributes

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

  • Unable to find the xml message in the queue even though xml is invoked

    Hi,
    Currently,we are invoking a queue in a BPEL Process where we are trying to place an xml into it.When verified in Console can see the queue is invoked and also a new record is being created in the queue but unable to find that xml in it.Could you please tell me how and where can we find the xml in the queue.
    Regards,
    N.Das
    Edited by: DasN on 05-Mar-2013 22:52

    Check these...
    https://forums.oracle.com/forums/ann.jspa?annID=893
    http://docs.oracle.com/cd/E13222_01/wls/docs100/ConsoleHelp/taskhelp/jms_modules/queues/ManageQueues.html
    Cheers,
    Vlad

  • I need the XML elements appear in different paragraphs ...  Could do this with a script?

    I need the XML elements appear in different paragraphs ...
    Could do this with a script?
    Thanks...

    You can use this / Puedes usar esto
    insertTextAsContent("\n",XMLElementPosition.beforeElement);                  
    //  or             
    insertTextAsContent("\r", XMLElementPosition.afterElement);
    Necesitaria mas información,

  • CS5.5 can't find the XML Connector Component - what give

    I'm working on a actionscript 2 file in flash CS5.5 and can't find the XML Connector Component any place. What happened to it?  How are you suppose to get a round it missing. Is there someplace I can download the .swc file and install it? converting to action script 3 is not an option in this case.
    thanks
    Joel

    Thanks for the reply...
    But I can't find any information on using the URLLoader class in Actionscript 2. This is an Actionscript 2 project that I don't have the time or the knowlage to try convert to AS3.  What I need is the AS2 XML Connector Component, I just can't find it anyplace in CS5.5. Where did they move it to? or is it gone?. The cs5.5 help files link me over to the AS2 reference guide. I found lots of references to it in the AS 2 guide in the cs5.5 help files but they all start with....
    Confirm that your Publish Settings specify ActionScript 2.0.
    Add an instance of the XMLConnector component to your application and give it an instance name.
    So the problem is, I can't find an "instance" of the XML Connector Component any place in flash CS5.5. I do see all the parameters and the trigger method listed in the script window but can't find the "component". All the sample scripts I've found on using the XMLconnect have a line to import the component and when I try to use them it throws an error. 
    In fact I can't find any of the "Data" components that were in my older copy of flash. So I asume that Adobe , in their collective wisdom, decided we didn't need them any more so I guess the question needs to be...
    Given that this project must use actionscript 2, and that the XML connector Component appearently doesn't exsist any more. How do I do the job it did to get an XML file into my AS2 flash project. if I can get it loaded I can use the inspector, as I use to I assume, to bind it. Any code example or links to some would be appreciated.
    thanks
    Joel

  • How to find the WBS element for the payment document?

    Dear All,
    How to find the WBS element in the payment document?...I know in payment doc there will not be any WBS but is there any option where I can find in any of the Tables.
    I am in the process of developing a Z report where i need to fetch the payment documents based on WBS. Can any one please help me on this.

    Hi Ram,
    As you are not giving any input of WBS at the time of payment you cannot fetch this directly. But to know the WBS for the reporting purpose on which WBS the payment has been made, you can develop a Z-Report. The WBS elements of clearing documents against the payment entry can be fetched out.
    In this report if there is a single payment against many invoices also possible with different invoice and WBS elements to be displayed on the Z-Report
    Regards
    Divya S

  • How to find the XML file size in the scenarios?

    Hi All,
    Recently i have attended an interview at a MNC.
    They asked some realtime questions like
    1.how to find the XML document size in a File-File scenario?
    2.What is mass-assignment replication etc.....
    Can anybody tell me the solution for these.
    Best regards
    Hari prasad

    If the input is a flat file, there is no exact way to calculate the size of the generated XML file, since it depends on many factors (number of fields in the recordsets, size of the name of the fields, number of records, etc).
    As a rule of thumb, generally ppl use XML file size = 2 x Flat file size, in order to do sizing calculations etc. But again, that is just an estimation, not a precise calculation.
    Regards,
    Henrique.

  • Where I can find the XML error messages repository?

    Hi guys,
    I don't know where I can find the XML error messages repository? (SXMB_MONI)
    I found a structure SXMSMSGDSP! But this is only a structure... I need a table or something like a program who can handle this structure.
    I think, this structure is used to shown an ALV, but first, a method read from memory and handle these data to ALV functions.
    There is a simple table or a kind of way to access this data (error messages) and manipulate it?
    Thanks in advance,
    Ricardo.

    Hi,
    U can check Table <b>SXMSPERROR</b> in in SE11....
    Regards,
    Sridhar Reddy

  • How do I find the smallest element of a doubly linked list?

    I currently have a doubly link list, each node contains two datafields df1 and df2. I need to find the smallest of df2 contained in the list and swap it with index one - until the list is sorted.
    Any ideas on how to search a doubly linked list for the smallest element would be greatly appreciated, thanks for your help.
    ps: I have found methods for find an element in a list and tried to alter it to find smallest, but my dfs are objects and I am having difficulty with the comparison.
    thanks so much for your time.

    I have given some comments in your other thread and instead of finding the minimum in each scan, you can do "neighbour-swaps". This will sort the list in fewer scans.

  • DNG SDK build project cannot find the xml sdk

    On win7/x64.  Installed dng sdk and all dependencies per the readme files.  xml sdk built OK with vc10 express, as 64 bit static and dll.
    But the vc solution for dng_validate has incorrect names for the xml sdk build projects, so it cannot find those components.  Specifically it looks for "..\..\..\xmp_sdk\build\vc\XMPCore.vcxproj".  the actual paths in the xmp sdk are different and longer, like "..\..\..\xmp_sdk\build\vc10\dynamic\windows_x64".  Moreover there is no XMPCore.vcxproj there.
    I suppose the real problem may be that the dng sdk project is trying to build it as .net managed code, while the xml sdk was built as open code.  So I guess what I am looking for is a way to build the dng sdk open.

    I would confirm your post, but I have not found a solution. I wish someone at Adobe would look into this.

  • How to associate an xml from httpservice to datagrid if the xml element name contains periods in it

    Following is the xml from an http service, how to associate
    this xml to a data grid (employee name, number) since it contains
    periods(dots) in xml element name.
    An early help is appreciated.....
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <com.companyx>
    <person>
    <employee.data>
    <employee.name>mrx</employee.name>
    <employee.number>1001</employee.number>
    </employee.data>
    <employee.data>
    <employee.name>mry</employee.name>
    <employee.number>1002</employee.number>
    </employee.data>
    <employee.data>
    <employee.name>mrz</employee.name>
    <employee.number>1003</employee.number>
    </employee.data>
    <page>0</page>
    </person>
    </com.companyx>
    Thanks,
    Vijay Karthik

    HI
    GOOD
    IT IS POSSIBLE IN ABAP
    Extensible Markup Language (XML) is a simple, very flexible text format derived from SGML (ISO 8879). Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere.
    XSD->
    XML Schemas express shared vocabularies and allow machines to carry out rules made by people. They provide a means for defining the structure, content and semantics of XML documents. in more detail.
    XDS->
    XDS can process data images from CCD-, imaging-plate, and multiwire-detectors in a variety of formats. Detector specific Input file templates greatly simplify the use of XDS; they are provided as part of the documentation.
    XDS runs under Unix or Linux on a single server or a grid of up to 99 machines of the same type managed by the MOSIX system; in addition, by using OpenMP, it can be executed in parallel on up to 32 processors at each node that share the same address space.
    http://www2.stylusstudio.com/SSDN/default.asp?action=9&fid=23&read=2926
    /people/r.eijpe/blog/2006/02/19/xml-dom-processing-in-abap-part-iiia150-xml-dom-within-sap-xi-abap-mapping
    THANKS
    MRUTYUN

Maybe you are looking for