Creating an xml document from filenames of selected files

Hey guys, I am totally new to automator and applescript so please be kind!
I have an xml/flash image portfolio website which has image galleries. Each gallery has an xml document which specifies a thumbnail and full size photo to be displayed in the gallery. If I want to make a new gallery I have to make a new xml document and enter all the filenames of the images I want to display in the gallery. ( I guess you can see where this is going).
This is fine if I have 10 images in the gallery but if I want to make a gallery with 350 images in then it could get pretty tedious.
What I would love to be able to do is select a group of images and then have a script or automator action that can copy the files names and create a new gallery xml document containing the relevant code with all the files names. Ideally then saving the gallery with a sequential filename.
Tying this into the new contextual services menu in snow leopard would really make the task incredibly easy.
Is this possible? I'm not scared of learning how to do this therefore some pointers in the right direction would be great.
Thanks,
Chris

Thanks Camalot,
I was just thinking of selecting images from the finder but if this could be integrated into Aperture's export dialog that would be even better.
this is the xml:
<?xml version="1.0" encoding="utf-8"?>
<gallery thumbwidth="220" thumbheight="138" columns="3" gap="4">
<item>
<ID>1</ID>
<title><![CDATA[Title 1]]></title>
<desc><![CDATA[This is description 1. <font color="#0099CC">This is a colourful text. </font> This is a <a href="http://www.flashden.net/user/iceonflames">link</a>. <i>This is italic text.</i> <b>This is bold text.</b> <b><i>This is bold italic text.</i></b> This text is styled by a CSS document.<br/><br/>]]></desc>
<thumb>images/thumbs/7.jpg</thumb>
<image>images/big/7.jpg</image>
</item>
<item>
<ID>2</ID>
<thumb>images/thumbs/8.jpg</thumb>
<image>images/big/8.jpg</image>
</item>
<item>
<ID>3</ID>
<title><![CDATA[Title 3]]></title>
<desc><![CDATA[This is description 3. <font color="#0099CC">This is a colourful text. </font> This is a <a href="http://www.flashden.net/user/iceonflames">link</a>. <i>This is italic text.</i> <b>This is bold text.</b> <b><i>This is bold italic text.</i></b> This text is styled by a CSS document.<br/><br/>]]></desc>
<thumb>images/thumbs/9.jpg</thumb>
<image>images/big/9.jpg</image>
</item>
</gallery>

Similar Messages

  • How to Create an XML document from XSQL servlet which follows a particular DTD struct

    how to Create an XML document from XSQL servlet which follows a particular DTD structure.Could anyone send me a sample code for this.

    You'll need to associate an XSLT transformation with your XSQL page that transforms the canonical result into your DTD-valid format.
    For example, given an XSQL page like:
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="rss.xsl" ?>
    <xsql:query max-rows="3" connection="demo" xmlns:xsql="urn:oracle-xsql">
    select title,id,description,url,to_char(timestamp,'Mon DD') timestamp
    from site_entry
    order by id desc
    </xsql:query>and an "rss.xsl" stylesheet that looks like this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes" doctype-system="rss-0.91.dtd"/>
    <xsl:template match="/">
    <xsl:for-each select="ROWSET/ROW">
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    <xsl:for-each select="ITEM">
    <item>
    <title><xsl:value-of select="TITLE"/></title>
    <link><xsl:value-of select="URL"/></link>
    <description><xsl:value-of select="DESCRIPTION"/></description>
    </item>
    </xsl:for-each>
    </channel>
    </rss>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>You produce DTD-valid output against the rss-0.91.dtd DTD that looks like:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE rss SYSTEM "rss-0.91.dtd">
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • Create an XML document from a HTML form???

    Good morning, is it possible to create an XML document from a HTML form
    if yes, can someone tell me how to proceed exactely, I would be very thankful!

    Hi,
    A very simple intro at this link. Apologies for anything unclear.
    http://cswww.essex.ac.uk/TechnicalGroup/TechnicalHelp/xmlCreate.htm
    best
    kev

  • Creating an XML document from a DTD in Java

    Hi All,
    I need help on the following requirement very badly. Pls help me.
    I have a requirement to implement with java and XML. I am quit new to XML.Can any of you pls help me.
    I have a DTD file. I need to generate XML document from it using java code. I have to use DTD as a template to generate my XML document.
    After going through WEB sites, I understtod that, we have to user Java API JAXB for my requirement. But I could not find JAXB.jar anywhere.
    I need to know the following inforamtion ....
    1. Is my understanding of using JAXB for my requirement is correct?
    2. Where can I get JAXB.jar?
    3. What are the steps to create XML document from a DTD in Java?
    If can give me a sample code for this would help me a lot.
    Pls pls reply me. Your help is greatly appreciated.
    Thanks in Advance.
    Regards,
    Gayathri.

    hi Gayathri,
    iam currently working in the same field.
    firs download jaxb from this link:
    http://java.sun.com/xml/downloads/jaxb.html
    first u need to marshall it.
    cheers
    shashi

  • Create single XML document from multiple queries

    hi all!
    being a new programmer in XML world,my question might sound a bit stupid but your answers would mean a world to me. i have to generate a single XML document from my database by querying more than one table. for example i have 3 tables i.e HR_EMP_NAME, HR_PRODUCTS_DETAIL, HR_PAYROLL_SUMMARY. all three tables have completely different columns except one ID column which is a foreign kay from HR_MASTER_LIST. i want to get any insert operation on these tables as a single document. so far as i have studied, one option is to generate XMLDoc using XSU and then add child nodes using JAXP but i am ot geting the logic right.
    please do reply.
    thanks a lot
    usman

    This is an SQL/XML based answer so how much it helps you is hard to say, but it would be one option. You can have the SQL statement build the XML for you as shown by this simple example.
    SELECT XMLElement("root",
              XMLForest(emp.dummy AS "emp_name",
                        prod.dummy AS "prod_lvl",
                        pay.dummy AS "pay_scale"))
      FROM dual emp,
           dual prod,
           dual pay
    WHERE emp.dummy = prod.dummy
      AND emp.dummy = pay.dummy;which produces (formatted for human readability)
    <root>
      <emp_name>X</emp_name>
      <prod_lvl>X</prod_lvl>
      <pay_scale>X</pay_scale>
    </root>Whether that works with what you are trying to do via Java you will have to decide.

  • How to use java to create an XML document from an SQL database?

    Hi,
    I'm a complete novice at XML and have only recently started programming in Java.
    I'm currently trying to develop a package in Java 1.1.8 which requires a set of very specifically formatted XML documents. These documents would need to be updated regularly by people with no knowledge of Java and I would like to make it as simple as possible.
    Since the data will already be in an SQL database, I thought it might be possible to generate the XML documents from the data using a small Java application, but I'm not too sure how to go about this or if this is even possible! Any help or pointers in the right direction would be very much appreciated.
    Louise

    Do you have the option of upgrading to a newer version of the JDK?
    JAXB does what you are wanting very easily. Also there are tools if you don't want to write your own. JAXB is available as early release on Sun's site as is the newest JDK. Otherwise, you have to design a factory and interface that will do this for you (which is what JAXB basically is in a very simplified view).

  • How can I create a XML document from a DOM?

    Hello,
    I'm using the parser for C, version 2 in the DOM modus. How can I dump the object model to a (XML) string after changing some field?
    Do I need to create my own function or is there a function in the DOM interface??

    You need to create your own function. The Java XML parser has such a function
    and we'll probably add one in a future release as well.
    Oracle XML Team

  • Heap space error while creating XML document from Resultset

    I am getting Heap space error while creating XML document from Resultset.
    It was working fine from small result set object but when the size of resultset was more than 25,000, heap space error
    I am already using -Xms32m -Xmx1024m
    Is there a way to directly write to xml file from resultset instead of creating the whole document first and then writing it to file? Code examples please?
    here is my code:
    stmt = conn.prepareStatement(sql);
    result = stmt.executeQuery();
    result.setFetchSize(999);
    Document doc = JDBCUtil.toDocument(result, Application.BANK_ID, interfaceType, Application.VERSION);
    JDBCUtil.write(doc, fileName);
    public static Document toDocument(ResultSet rs, String bankId, String interfaceFileType, String version)
        throws ParserConfigurationException, SQLException {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.newDocument();
            Element results = doc.createElement("sims");
            results.setAttribute("bank", bankId);
            results.setAttribute("record_type", "HEADER");
            results.setAttribute("file_type", interfaceFileType);
            results.setAttribute("version", version);
            doc.appendChild(results);
            ResultSetMetaData rsmd = rs.getMetaData();
            int colCount = rsmd.getColumnCount();
            String columnName="";
            Object value;
            while (rs.next()) {
                Element row = doc.createElement("rec");
                results.appendChild(row);
                for (int i = 1; i <= colCount; i++) {
                    columnName = rsmd.getColumnLabel(i);
                    value = rs.getObject(i);
                    Element node = doc.createElement(columnName);
                    if(value != null)
                        node.appendChild(doc.createTextNode(value.toString()));
                    else
                        node.appendChild(doc.createTextNode(""));
                    row.appendChild(node);
            return doc;
    public static void write(Document document, String filename) {
            //long start = System.currentTimeMillis();
            // lets write to a file
            OutputFormat format = new OutputFormat(document); // Serialize DOM
            format.setIndent(2);
            format.setLineSeparator(System.getProperty("line.separator"));
            format.setLineWidth(80);
            try {
                FileWriter writer = new FileWriter(filename);
                BufferedWriter buf = new BufferedWriter(writer);
                XMLSerializer FileSerial = new XMLSerializer(writer, format);
                FileSerial.asDOMSerializer(); // As a DOM Serializer
                FileSerial.serialize(document);
                writer.close();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            //long end = System.currentTimeMillis();
            //System.err.println("W3C File write time :" + (end - start) + "  " + filename);
        }

    you can increase your heap size..... try setting this as your environment variable.....
    variable: JAVA_OPTS
    value: -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m

  • Creating new analysis gives "Error loading XML Document from ..."

    Trying to create analysis and getting "Error loading XML Document from saw.dll/answers/answersproperties.xml?fmapId=S1clug.
    The response given was:" after choosing subject area. Analysis editor is opened but Subject Areas is empty and can't do anything.
    The problem is on Mozilla 12 (16.0.2, 17.0.1) and IE 8. Chrome works fine.
    My system is Win 7, BI 11.1.1.6.0 is on Oracle Linux (and by the way Mozilla from Linux system works fine)
    What could be the reason of this?
    Edited by: 898973 on 4/12/2012 15:11

    Reinstalling Mozilla with "Remove personal data" option checked resolved the problem.

  • XML Document from XML Schema Bug

    When an XML document is generated from an XML Schema the XML document does not have all the elements specified in the XML Schema. The XML document only has the root element.
    1. Register an XML Schema.
    2. Create an XML document with File>New>General>XML>XML Document from XML Schema. The "Generate only Required Elements" is unchecked.
    3. The XML document has only the root element.
    In JDeveloper 10.1.3 all the elements in the XML Schema get generated.

    Also, the component palette for the XML document generated from the XML Schema does not list all the elements in the XML Schema, only the root element is listed. Even if elements are specified as required in the XML Schema with minOccurs="1" and the "Generate only Required Elements" checkbox is selected only the root element gets generated.

  • Urgetnt:Generate XML Document from Oracle Tables.

    Environment is :9i Release 2
    Requirement : Generate XML document from the data which is vailable in Oracle tables at client location.
    Could some body help me on how to get ahead on this.
    Thanks in advance,
    Kumar.

    Implimentation in PowerBuilder7(Source is experimental.. need optimization):
    kml_store = create datastore
    selectblob kml into :kml_result from (select get_kml(:querry_type,:tmp_querry_value,1) as kml from dual) using sqlca;
    if sqlca.sqlcode=100 then
    MessageBox("INFO","No data found");
    return false;
    end if
    if sqlca.sqlcode = -1 then
         MessageBox("INFO","Error in generating KMl file");
         return false
    end if
    li_FileNum = FileOpen("test.kml",StreamMode!, Write!, LockWrite!, Replace!);
    b_len=Len(kml_result)
    b_len=64244;
    /*inserting in file :)*/
    DO WHILE b_pos<=b_len
         s_pipe=String(BlobMid(kml_result,b_pos,i_str_len))
         ret = FileWrite(li_FileNum,s_pipe);
         s_pipe="";
         b_pos=b_pos+i_str_len;
    LOOP
    FileClose(li_FileNum);
    Message was edited by:
    user601564

  • Load xml document from CLOB

    I'm try to load xml document from CLOB in following way:
    --- procedure loadXML.sql -----
    CREATE OR REPLACE PROCEDURE loadXML
    IS
    CONTENT CLOB := ' ';
    SOURCE bfile := BFILENAME('XMLFILES', 'N_95_A.xml');
    begin
    DBMS_LOB.OPEN(SOURCE, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.loadFromFile(CONTENT, SOURCE, DBMS_LOB.getLength(SOURCE));
    DBMS_LOB.fileClose(SOURCE);
    insert into OFERTY (OFDOCUMENT)
    values (sys.XMLtype.createXML(CONTENT));
    commit;
    end;
    and I get
    SQL> @e:\myxml\loadXML
    declare
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00210: expected '<' instead of '<'
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    ORA-06512: at line 8
    What is wrong?

    Have you tried simply outputting iusing the htp.p function? for example:
    /* ... inside a PL/SQL region */
    declare
       lclb_output clob;
    begin
       select doc_xml into lclb_output from mf_xml_docs where doc_id = :P1_DOC_ID;
       htp.p(lclb_output); -- you may have to split this into chunks and loop through, depending on how big the clob is
    end;

  • Creating Excel xml spreadsheets from XSL

    Hi
    I am trying to create Excel xml spreadsheets from XSL.
    I am using Tim's blog as my reference.
    http://blogs.oracle.com/xmlpublisher/2010/03/multisheet_excel_output.html
    Following is my xml data:
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <!-- Generated by Oracle Reports version 10.1.2.0.2 -->
    <XXTEK_TEST>
    <LIST_G_PROCESSED_DATE>
    <G_PROCESSED_DATE>
    <PROCESSED_DATE>30-MAR-09</PROCESSED_DATE>
    <PARTY_NAME>partyname1</PARTY_NAME>
    <ORDER_NUMBER>17183</ORDER_NUMBER>
    </G_PROCESSED_DATE>
    <G_PROCESSED_DATE>
    <PROCESSED_DATE>03-APR-09</PROCESSED_DATE>
    <PARTY_NAME>partyname2</PARTY_NAME>
    <ORDER_NUMBER></ORDER_NUMBER>
    </G_PROCESSED_DATE>
    <G_PROCESSED_DATE>
    <PROCESSED_DATE>03-APR-09</PROCESSED_DATE>
    <PARTY_NAME>partyname3</PARTY_NAME>
    <ORDER_NUMBER></ORDER_NUMBER>
    </G_PROCESSED_DATE>
    <G_PROCESSED_DATE>
    <PROCESSED_DATE>03-APR-09</PROCESSED_DATE>
    <PARTY_NAME>party name5</PARTY_NAME>
    <ORDER_NUMBER></ORDER_NUMBER>
    </G_PROCESSED_DATE>
    <G_PROCESSED_DATE>
    <PROCESSED_DATE>30-MAR-09</PROCESSED_DATE>
    <PARTY_NAME>partyname7</PARTY_NAME>
    <ORDER_NUMBER>17183</ORDER_NUMBER>
    </G_PROCESSED_DATE>
    </LIST_G_PROCESSED_DATE>
    </XXTEK_TEST>
    Following is my xsl file:
    <xsl:stylesheet version="1.0" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:my-scripts"
    xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
    <xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="no"/>
    <xsl:template match="/">
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:html="http://www.w3.org/TR/REC-html40">
    <ss:Styles>
    <ss:Style ss:ID="Default" ss:Name="Normal">
    <ss:Font ss:Color="black" ss:Size="10" ss:Bold="1" ss:FontName="Arial"/>
    </ss:Style>
    <ss:Style ss:ID="x1">
    <ss:Font ss:Color="black" ss:Size="10" ss:FontName="Arial"/>
    </ss:Style>
    <ss:Style ss:ID="xdo2">
    <ss:Font ss:Color="black" ss:Size="10" ss:FontName="Arial"/>
    <ss:NumberFormat Format="$#,##0;[Red]$#,##0" Bold="0" />
    </ss:Style>
    </ss:Styles>
    <xsl:apply-templates select="XXTEK_TEST"/>
    </Workbook>
    </xsl:template>
    <xsl:template match="XXTEK_TEST">
    <Worksheet>
    <Table x:FullColumns="1" x:FullRows="1">
    <Row>
    <Cell>
    <Data ss:Type="String">Process date</Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">Party name</Data>
    </Cell>
    <Cell>
    <Data ss:Type="String">Order number</Data>
    </Cell>
    </Row>
    <xsl:for-each select=".//G_PROCESSED_DATE">
    <Row>
    <Cell ss:StyleID="x1">
    <Data ss:Type="String">
    <xsl:value-of select="PROCESSED_DATE"/>
    </Data>
    </Cell>
    <Cell ss:StyleID="x1">
    <Data ss:Type="String">
    <xsl:value-of select="PARTY_NAME"/>
    </Data>
    </Cell>
    <Cell ss:StyleID="x1">
    <Data ss:Type="String">
    <xsl:value-of select="ORDER_NUMBER"/>
    </Data>
    </Cell>
    </Row>
    </xsl:for-each>
    </Table>
    </Worksheet>
    </xsl:template>
    </xsl:stylesheet>
    While creating the template, I have chosen the template type XSL-XML. I am trying to test this on E-business Suite (R12).
    I get the error "The uploaded file TEST_temp.xsl is invalid. The file should be in XSL format."
    Where am I going wrong?
    I am trying to create Excel XML spreadsheets, because the excel files created using RTF templates are very huge in size. And it is taking an unacceptable amount of time to open the file. Is there any other solution to overcome this performance issue?
    Regards
    Nishka

    Nishka,
    Looks like your XSL stylesheet is missing the XML header at the top.
    So normally it would look like:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet....>
    </xsl:stylesheet>
    as an Example a stylesheet which just outputs a field:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions">
    <xsl:template match="/">
    <xsl:text>My field:</xsl:text>
    <xsl:value-of select="MYFIELD"/>
    </xsl:template>
    </xsl:stylesheet>
    Patrick

  • Can v create multiple billing document from delivery with single line item

    can v create multiple billing document from delivery with single line item

    Dear Sandesh
    Go to VOV7, select your item category.  In this maintain K  for Billing Relevance
    Now go to VF01, give the delivery number and do not press Enter.  Instead click on Selection list on the next screen, select the items you want to bill and click copy and continue if necessary
    thanks
    G. Lakshmipathi

Maybe you are looking for

  • Data Safety - Time Machine Backup HD

    Greetings, Our organization uses time machine and individual external HDs to backup our workstations. Most of the employees use laptops, and leave the external HDs at their desk. Does anyone have any suggestions for keeping this data safe? Is the bes

  • Itunes won't open, won't force quit, won't anything

    This problem started about a month ago and now it's critical. When I click the itunes icon, it bounces and then freezes. itunes won't open. It also won't force quit. I can't shut down because, it says, itunes won't quit. I have to hold down the power

  • HP Color Laserjet CP2025 printing with a 'shadow' effect

    Hi All My printer is printing some documents with a pink 'shadow' type effect on font (various different ones) and even an image I have inserted. If I print a test page I don't get this, yet documents I have saved as a template and have been using si

  • Letter of Credit amount information

    Hi guys, My client want the system should block delivery, when ever the amount of letter of credit below the invoice amount. Can we map  it in B1? what is calculation field? and how could it be done?

  • HELP ME: PROBLEMS WITH ORGANIZER...

    My editing workspaces are working just fine, however, my organizer will not open (keeps saying "not responding"). If I reinstall the program, will I lose the pictures that are in the organizer that I haven't saved to my comp yet?