How to read XML file in InDesign Script

indesign #target

var myFile is File.openDialog ("file select XML");.

If (myFile! = null)

{ myFile.open("r");

myElement var = new XML (myFile.read ());

myFile.close ();

Alert (MyElement.xmlElements.Length);

}

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

Code above does not have XML elements, variable myElement to get all the data to an xml file,

but I don't get her child of the elements...

Can someone help me solve this problem please...

Thank you...

Hello

Try this...

alert(myElement.elements().length());

Concerning

Tags: InDesign

Similar Questions

  • Someone please tell me how open/read a file on my Mac OS Pro Tour/Yosemite .asf. Please help, frustrated!

    Someone please tell me how open/read a file on my Mac OS Pro Tour/Yosemite .asf. Please help, frustrated!

    of course, it's another format darn owner, so you will need a copy of Windows media player for mac.  (or VLC) there is a way to convert, however, but I suspect it will not free

    Good luck

    John B

  • How to read the files on time capsule

    How to read the files on time capsule from iPad?

    Thank you

    Using an application like navigation on the iPad. More info here:

    Stratospherix - FileBrowser - overview

  • How to read minidump files?

    My question is small, but has a large influence on the detection of the windows error.

    I have a question, how to read minidump files?

    This is the default location is "C:\WINDOWS\Minidump.

    Specifically, I have no problem in real-time, but I want to know about it.

    I have also noticed that some MVP suggest that you download the minidump & they inspect it. But how do?

    Do not hesitate to make the technical content, I will try to understand that also.

    I have no OS dependencies so here you can chat on any OS (XP, Vista, win 7).

    It would be good if you give me an example. As an example you can quote all the minidump pre inspected which is uploaded to skydrive files.

    S.Chatterjee

    http://support.Microsoft.com/kb/315263 MS - MVP - Elephant Boy computers - don't panic!

  • How to edit pdf file (in indesign) without having to re-export then and redo all the fields of the form and formatting?

    How to edit pdf file (in indesign) without having to re-export then and redo all the fields of the form and formatting?

    Edit PDF files in InDesign is not a good idea. If the file was originally exported ID, then change the original and then create a new PDF file.

    Open an old, and then use the command replace Pages to insert the new pages on the 'old'. The fields that you have already created will remain in place when you do this.

  • How To Read RTF file in JAVA?  Using iText?

    How To Read RTF file in JAVA?  Using iText?...

    import java. IO;

    com.lowagie.text import. *;
    com.lowagie.text.rtf import. *;

    public class RTF3 {}
    Public Shared Sub main (String [] args) {}

    System.out.println ("this example produces a RTF Sample.rtf file name");

    Create the Document object
    The myDoc document = new Document();

    try {}

    Create writer to listen to a document object
    and directs the RTF stream to the Sample.rtf file
    RtfWriter2.getInstance (myDoc, new FileOutputStream ("Sample.rtf"));

    Open the document object
    myDoc.open ();

    Create a paragraph
    Point p = new Paragraph();
    p.Add ("Helloworld in Rtf file... amazing isn't");

    Add a paragraph to the document object
    myDoc.add (p);

    }
    catch (Exception e) {}
    System.out.println (e);
    }
    close the document
    myDoc.close ();
    }
    }
    Exception in thread "main" java.lang.NoSuchMethodError: com.lowagie.text.Rectangle.width (F)
    at com.lowagie.text.rtf.document.RtfPageSetting.rectEquals(RtfPageSetting.java:433)
    at com.lowagie.text.rtf.document.RtfPageSetting.guessFormat(RtfPageSetting.java:362)
    at com.lowagie.text.rtf.document.RtfPageSetting.setPageSize(RtfPageSetting.java:341)
    at com.lowagie.text.rtf.RtfWriter2.setPageSize(RtfWriter2.java:248)
    at com.lowagie.text.Document.open (unknown Source)
    to the view. RTF3.main (RTF3. Java:23)

    Can you help me?

    import com.lowagie.text.Document;
    import com.lowagie.text.rtf.parser.RtfParser;
    import java.io.FileInputStream;

    String Fichierentree = "sample.rtf."
    Document document = new Document();
    document. Open();
    RtfParser parser = new RtfParser (null);
    parser.convertRtfDocument (new FileInputStream (inputFile), document);

  • How to read a file of all the text in a pl/sql variable?

    Hi, I need to read an entire text file - which actually contains an e-mail message from a system of content management - in a variable in a pl/sql package, in order to insert the database information and then send the email. I want to read the whole of a sudden text file, no not one line at a time. Shoud I use Utl_File.Get_Raw or is there a more appropriate to do this?

    How to read a file of all the text in a pl/sql variable?

     ...
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....
    
  • does anyone have example script writing and reading XML file

    someone at - it an example script for writing to variables affecting and reading variables to an xml file.

    Discover the second to the last link on this page:

    http://www.Cisco.com/en/us/partner/products/SW/custcosw/ps1846/products_implementation_design_guides_list.html

    There are some very good examples.

    HTH, please rate all positions!

    Chris

  • How read XML file (extn is .gpx) created by Garmin GPS

    I need to read a XML file with extension .gpx created by Garmin GPS. In general, the .gpx files, we work with are rows of 20K - 30K. My current workaround is to open the .gpx file in Excel and save it as a .csv, I then read using LabVIEW. However, we would go out to Excel the workflow and read the .gpx file directly in LabVIEW.

    The attached .zip contains the original .gpx file created by GPS and the .xlsx file created by open - save in Excel 2007.

    I use LabVIEW 8.5.1 on Vista 64-bit.

    Thank you!

    Hello

    If this file has this format always you don't need to use an xml parser to extract the information. The ScanFromString function can do. See the code I developed

  • read xml files in the directory, and then extract the words from their

    I looked in the forums of LabView for a problem similar to mine, but I succumbed to find advice, I need.

    Some time previously, I wrote a LabView program to build a dictionary from an array of strings.  It was really just a list of words that I used to make a crude search engine.

    Now I try to repeat this experience.  However, I'm stuck at the first hurdle.  I have a directory containing a number of folders and files, including .xml files.

    What I have to do is read the individual words in the xml files and then merge the words in a large list.  From there, I should be able to make the dictionary, and I hope that my old search engine still works with the new data.

    The attachment shows my unsuccessful attempt to create a VI that can first index all files in a directory (what it is) and then list only files ending in ".xml" (which it does not).

    Any advice on how to get my word out list would be greatly appreciated!

    Adam

    Is that what you are looking for? (See attached image VI)

  • Process of reading XML files

    Hello

    I have an obligation to read the .xml file that includes the following data in the file.

    < WFPaymentAck >
    < PmtID > 500001 < / PmtID >
    < / WFPaymentAck >


    I want to read the file and access the data that is present in the < PmtID > tag. that is, 500001.

    I have tried two ways, but I get the following error when I try to access the entitlement activity data by using the 'getVariable' method (for example: bpws:getVariableData('Receive_Read_InputVariable','body','/ns2:WFPaymentAck/ns2:PmtID')).

    + Error in evaluate expression "69 online <>." The result is empty for the XPath: /ns2:WFPaymentAck/ns2:PmtID".+ «»

    Please me briefly the steps of how to go about it.

    Thanks in advance.

    Kind regards
    achapla

    Hi Achapala,
    I tried your example. You must use the xml code that is now being questioned by file adapter underneath marker. It will work



    500001

    Kind regards
    NGO

  • How to read a file that contains a matrix!

    Hi all

    I have a file that I saved from matlab using this command: SAVE filename X - ascii-double - legs.

    but I don't know how to read and extract its data to draw the graph of the intensity.

    Any help please.

    Best regards

    Nams


  • How to read two files (one updates every second, the other is constant) simoltaneously

    Dear all,

    I'd appreciate if someone help me.

    I want to read two files, one is the temperature that updates every second, and the other is energy hysteresis that has specific lines and is constant.

    I had a program in the discussion forum to read a file as it is updated. I checked this program in my case and it works.

    Then I added playback file hysteresis energy to the existing file. But while I run the program, the energy hysteresis file is read with all the lines.

    But the goal is that every time the updates of the temperature, I need to read a line of the file hysteresis energy.

    in this way every second, so, I have a new temperature data and a row of the other file.

    I tried to use 'for loop' inside the program, but it did not work, because the temperature reading will stop until that end of the loop.

    I joined the program.

    Could someone help me how read only a row of hysteresis energy file every time that the temperature updated?

    IS that what you wanted to achieve?

  • Reading XML File.vi returns an empty string

    Hello

    I use reading of XML File.vi and this VI returns an empty string on my XML file, but on another XML file, it seems to work correctly.

    I open my file XML in Internet Explorer 7.0 and it apears as aspected.

    What could be the problem?

    Thanks in advance for any help.

    Kind regards

    Daniel Coelho

    You are right, and it seems to work as I want.

    Thank you for your help, this LabXML works well.

    This post is officially solved

    My best regards,

    Daniel Coelho

  • Reading XML file problem

    Hi all

    I'm reading an xml file and displays the output. I get a blank screen. Can someone help me please.

    Thanks in advance

    I can't attach the xml file. Since this is not a valid extension. Please find the following xml code.


    Samsung

    Busan
    South Korea

    If you can change the saved .xml file, you can modify it to be compatible with Labview XML shema and use Unflatten of XML as in your VI. If you can't, you must use the XML parser library. Attached, you will find 2 exmaples for these situations.

Maybe you are looking for