Win/Mac CS3: create an XML file and add content

Hello

I want to create an XML file to a specified location. This file contains information about the images in an Indesign document.

-Can I create a new file XML in Javascript?

-If so, how can I add content?

Thanks for all the tips

Hans

I made a small example, just to see how it works.

I don't know if there is a smarter way of usage of the XMLobject, I guess that's what link is on about, haven't read it yet however.

var myRootXmlObj = new XML ("" ');
var font = "";
var myInstalledFonts = app.fonts.everyItem () .name;

for (i = 0; i< myinstalledfonts.length;="" i++)="">
font = new XML ("" + myInstalledFonts [i] + "'");
myRootXmlObj.fonts.appendChild (do);
}

var f = new File ("myTestFile.txt"); in windows XP, this is in the user documents folder

writeXMLFile (f, myRootXmlObj);
Alert (readXMLFile (f));

ROM http://forums.adobe.com/message/1114070#1114070 forum thread
function writeXMLFile (file, xml) {}
If (!) XML XML instanceof))) {}
throw "wrong XML" parameter;
}
leader. Encoding = 'UTF8 ';
leader. Open ("w", "TEXT", "?");
signature of Unicode, it comes to UTF16 but will convert to UTF8 'EF BB BF.
leader. Write ("\uFEFF");
file.lineFeed = "unix";
leader. Write (XML. ToXmlString());
leader. Close();
};

function readXMLFile (file) {}
If (! file.exists) {}
throw "file not found:"+ decodeURI (file.absoluteURI);.
}
leader. Encoding = 'UTF8 ';
file.lineFeed = "unix";
leader. Open ("r", "TEXT", "?");
var str = file.read ();
leader. Close();
return of new XML (str);
};

Tags: InDesign

Similar Questions

  • Create XML file and make available via WebDAV

    Hello

    I'm new to XML DB ;-)
    Has anyone got a short example how to create an XML file (possibly with XSD in XML DB schema file) via XML DB and make it available via WebDAV?

    Thanks in advance.

    Best regards
    Martin
    SQL> select xmltype(cursor(select * from dual)) from dual;
    
    XMLTYPE(CURSOR(SELECT*FROMDUAL))
    -----------------------------------------------------------------------------
    
    
     
      X
     
    
    
    1 row selected.
    
    SQL> DECLARE
      2
      3    XMLDoc XMLType;
      4
      5  BEGIN
      6
      7    select xmltype(cursor(select * from dual))
      8    into   XMLDoc
      9    from dual;
     10
     11    IF (DBMS_XDB.CREATERESOURCE('/public/dual.xml',XMLDoc)) THEN
     12       DBMS_OUTPUT.PUT_LINE('Resource is created');
     13    ELSE
     14       DBMS_OUTPUT.PUT_LINE('Cannot create resource');
     15    END IF;
     16
     17    COMMIT;
     18
     19  END;
     20  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select xdbURIType ('/public/dual.xml').getClob() from dual;
    
    XDBURITYPE('/PUBLIC/DUAL.XML').GETCLOB()
    -------------------------------------------------------------------------
    
    
      
        X
      
    
    
    1 row selected.
    
    -- You will see an /public/dual.xml file via the WebDav functionality
    
  • The attached VI works when I run it initially to create the XML file, but by pressing once the XML file is created, it is not up-to-date. What I am doing wrong?

    The attached VI works when I run it initially to create the XML file, but when I change the data and run once the XML file is created, it is not updated with new data. What I am doing wrong?

    Thank you.

    It sounds like the logic that has been written in VI

    Internal decision of true / false:

    (file exists: false) write in the file XML, unflatten for display

    (file exists: true) read the XML file, unflatten for display

    At no time when the file exists (true case) is the XML file updated...

  • Create an xml file using the .xsd file

    Hi guys,.

    Version of DB: Oracle 11g

    I was wondering if I had any package that can create a xml file based on a (built-in) .xsd file. I searched but did not find any resource on the internet specific to my problem. Let's say I have an .xsd file. It is possible to load a schema and generate the XML that conform to the .xsd file using sql? If so, I want to store in a CLOB variable.

    Please point me to the right direction.

    Thank you.

    Hello

    No, there is no such functionality yet.

    To build the XML "manually", according to the XSD, for example using SQL/XML functions (XMLElement, XMLAttributes, and XMLAgg etc.).

  • How to convert a .fmb file to .xml file and also how to download apex?

    How to convert a .fmb file to .xml file and also how to download the .xml file converted in the oracle apex?

    Any idea?

    Any link?

    Published by: skud on February 24, 2011 21:17

    Published by: skud on February 24, 2011 21:28

    Hello

    You need to replace the scott.nature_of_trans by nature_of_trans and re he convert to xml, and then create.

    Kind regards

    Patel Kartik
    ------------------------------------------------------------------------
    http://patelkartik.blogspot.com/
    http://Apex.Oracle.com/pls/Apex/f?p=9904351712:1

  • How to extract data from an arbitrary xml file and export it to a CSV friendly?

    Hallo,
    I am facing big problems in the use of XML files. I have a
    application that generates XML files with clusters containing arrays
    and scalars as in the example pasted below. My task is to
    Read it and export the data into a CSV document readable by a human.
    Since I do not know the actual content of the cluster, I need some sort
    Smart VI through the XML looking for berries
    and other data structures for export properly in the CSV file
    format (columns with headers).
    Thank you



    3


    6


    0



    1



    2



    3



    4



    5




    3.14159265358979



    Ciao

    Rather than to get the

    node, you can just go directly to the node since ' one that really interests you. Basically what it means to determine the elements of table how much you have, and it depends on if you have 1 or 2 knots . The rest is just of the child nodes and the next siblings. See attachment as a starting point. The attached XML file is a table 2D (change the .xml extension).

    Notes on the example:

    • I did not close properly references, so it's something you need to do.
    • It is limited to tables 1 d or 2D.
    • I suggest using a control path of the file to specify the input XML file and path of the file/folder control to specify the location of the output file.

  • How to validate a separate xml file and a separate xsd file

    I use Dreamweaver 2015. I'm now working on XML. I have a separate xml file and a separate xsd file. How can I validate them in Dreamweaver? I was told to use Edit-> tag library. Then, I am lost! Please help me!

    Thank you in advance,

    Tammy

    Optimize the code in Dreamweaver

  • I exported my Premium Pro movie to a .m2v file.  When I try to open a new project so that I can create a DVD file and I can choose the .m2v file, it is grayed out.  Also, if I double click on the .m2v file, it will open s toward the top, but w

    I exported my Premium Pro movie to a .m2v file. When I try to open a new project so that I can create a DVD file and I can choose the .m2v file, it is grayed out. Also, if I double click on the .m2v file, it opens, but will not play and seems to be locked or frozen. What can I do?

    Again, you use "import as" assets or timeline?

  • I have created a prproj file and want to create a master DVD.  Is there a simple way to do this?

    I have created a prproj file and want to create a master DVD. Is there a simple way to do this?

    You need to export an MPEG2-DVD file for use in an application to create DVD (like Encore CS6)

    You can also create an ISO for mastering purposes image file.

  • Parse the XML file and extract data

    I want to parse a XML file and get the data as columns.

    Input country.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <MAS Action="Insert">
    <Country ObjectId="100000000000000009" VersionId="8"><Id>1</Id><NlTexts><Name Language="de">Land1</Name><Name Language="en">Country1</Name></NlTexts></Country>
    <Country ObjectId="100000000000000033" VersionId="2"><Id>2</Id><NlTexts><Name Language="de">Land2</Name><Name Language="en">Country1</Name></NlTexts></Country>
    </MAS>
    
    

    I would like to analyze the xmlfile to get the following result

    Required result:

    col1        col2           col3
    1            Land1        Country1
    2            Land2        Country2
    

    or alternatively

    col1  col2       
    1            Land1       
    1            Country1
    2            Land2       
    2            Country2
    

    I tried the extract function

    select extract((XMLTYPE(BFILENAME('XML_DAT_DIR', 'country.xml'),
               NLS_CHARSET_ID('AL32UTF8'))) , '/*/*/Id') as "xdata"
    from dual;
    
    xdata
    ------------------------
    <Id>1</Id><Id>2</Id>
    

    and XMLTABLE (but how can I add countries now)

    SELECT *
        FROM XMLTABLE('/*/*/Id'
               PASSING XMLTYPE(BFILENAME('XML_DAT_DIR', 'country.xml'),
               NLS_CHARSET_ID('AL32UTF8'))
           )
      ;
    COLUMN_VALUE
    ------------------------
    <Id>1</Id>
    <Id>2</Id>
    

    DB version 11.2.0.3 on Windows 64-bit

    Thank you

    Tim

    Here are a few examples.

    For your output required:

    SELECT *.

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , col2 varchar2 (30) path "NlTexts/name [1].

    , col3 varchar2 (30) path "NlTexts/name [2]»

    )

    ;

    or, if the Language attribute is significant:

    SELECT *.

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    col2 varchar2 (30) path "NlTexts/Name[@Language="de"]"

    col3 varchar2 (30) path "NlTexts/Name[@Language="en"]"

    )

    ;

    For your alternate exit:

    SELECT x1.col1

    x2.col2

    -, x2.col3

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , path of xmltype names ' NlTexts/name '.

    ) x 1

    XMLTable)

    "/ Name".

    in passing x1.names

    path of column col2 varchar2 (30) '.'

    -, col3 to ordinalite

    ) x 2

    ;

    (uncomment col3 to see what he does)

    or in a shorter way:

    SELECT *.

    FROM XMLTable)

    ' for $i/MAS/country

    , $j in $ NlTexts/i/name

    Returns the r element {$i / Id, $j}'

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , col2 varchar2 (30) path 'name '.

    ) ;

  • Create a csv file and send it in an e-mail message

    In coldfusion, is it possible to create a csv file and send it in an e-mail, without ever save this file on the hard drive?

    Lol you can't attach a file to an e-mail, unless the file has been created.

    We deal with this situation by creating the file in a directory designated for dynamically created files.  Then we have a scheduled task that cleans all files over a certain age, every night.

  • eCommerce: is it possible to create an own basket and add to cart? with band or anythings else...

    Hi surf autour shoplocket, ecwid, etc.. Its seems to be the way the cleaner to intergrate a solution of e-commerce in the site of muse. But this is not enough, I just want to add an addition to the basket option Pentecost button like size and color, also a shopping cart. The presentation of the product and the structure of my store, I want it completely on muse. I want only the payment process must be certified by a third party 'thing '. Stripe look simple but I don't know how to configure it on muse... Is also possible to create an xml file so that I can integrated in muse. Or a widget with mucow.

    Any tips will be appreciated

    Jeremiah

    Jam Session of the week last Muse was all about eCommerce. You can take a look at this record and see if this helps you.

    Jam Muse: Integrate your online store - YouTube

  • How can I create a new folder and add some choose another folder

    How can I create a new folder and add some pictures a different folder?

    Click Start-> computer.  Navigate to where you want to create the new folder.  Then, hold down the ALT key and press F.  Point again-> file and click folder.  Now, you have created the folder if you need to name it.  Type the name you want to give the file and press ENTER.  Now you have the new folder with the name you gave it.  Use him copy / paste to copy the images to the new folder.

    Good luck.

  • Picasa 3 - How to create a slide show and add music?

    original title: Picasa 3

    I store all my photos using Picasa. I know how to create a slide show. Last year I managed to create a slide show AND add a piece of music. The problem I have is that I don't remember how I did it!

    I don't want to use other software and hope that someone more computer can help me re-trace my steps and create a slideshow with music.

    Sincere thanks for all the help offered.

    A

    I store all my photos using Picasa. I know how to create a slide show. Last year I managed to create a slide show AND add a piece of music. The problem I have is that I don't remember how I did it!

    I don't want to use other software and hope that someone more computer can help me re-trace my steps and create a slideshow with music.

    Sincere thanks for all the help offered.

    A

    It is a forum for Microsoft Windows XP.  Picasa is a Google product.

    I suggest you try the support for Picasa here (<-- this="" is="" all="" a="" link. ="" click="" on=""> )

    You can also try to post in the forums to Picasa (<-- this="" is="" all="" a="" link. ="" click="" on=""> )

    You can also like this: http://geeksontour.tv/learning-library/picasa/

    And this: http://sites.google.com/site/picasaresources/

  • How to create the version compressed as a copy of the version of office content.  I tried the + command line Tablet just below the menu bar horizontal, but it creates a blank page and no content from the desktop version

    I tried to create a Table version of the-Tablet command line just below the horizontal menu, but it creates a blank page and no content of the version of office without worrying. I cleared the table and tried several times but no result.

    Just look closely at the opoins:

    Here is no option to copy the content of a page

Maybe you are looking for

  • Current limit for the PXI-4110

    I'm a PXI-4110 with LabWindows programming. I'm trying the current limit. I have an output to 5V with a load resistance of 1 K; This makes the current 5mA. I put the current limit of 2mA to work. When I read the voltage and current is 5V 5mA. Here is

  • DataSocket PSP data buffering

    I have a VI that writes to a shared variable of network using DataSocket.  The URL DataSocket using PSP.  I have an another VI that reads the variable shared network also using DataSocket.  I'm experimenting with buffering to see when data is lost if

  • date on the photo stamps

    I want to get rid of the time stamp that can be found on some of my photos that are in the windows photo gallery, so when I print photos I can frame without seeing the date on them. Help me please I need to understand this.

  • I need advice on how to best fill af:table

    I have af:table and VO: Select a, b, c and d from table1But I need the fifth column: select count (table2.e) table2, table1 where a = table1.aWhat is the best way?

  • How can I activate the Pinch Zoom on a site with Parallax scrolling?

    Is there a way to activate the Pinch Zoom on a site that has scrolling Parallax?