InDesign XML Hierarchy comparison

Hi all,
I need the logic of comparing the xml hierarchy between two documents, is there any possibility to do this in InDesign Javascript.
Using InDesign CS5.5/Windows/Javascript.
Please let me know if any easy tricks to achieive this task.
Regards,
Karpanai.

I just posted a question about this ( http://forums.adobe.com/thread/844501?tstart=0 ) due to the same problem. Goes for CS4 as well, but only on Mac. I have not observed similar problems in Windows.
My href paths looks like this in the XML file:
file:///filename.jpg
and I've also tried
file://filename.jpg
So after I've located the folder and the first image I would expect InDesign to go on placing images from that folder, just as it does in Windows.
A possible workaround would be to put the XML file to import into the same folder as the images.
Best regards,
Andreas

Similar Messages

  • Placing a PDF graphic into an existing XML hierarchy?

    I have an existing XML hierarchy that has a picture element that looks like this:
    <picture href=""></picture>
    which is already placed in a TextFrame.
    I'd like to place a PDF graphic at the location of this element, in essence updating it.
    I'm able to update the href attribute with the correct filename, but this doesn't create a placed graphic AFAICT.
    I can place a graphic in my TextFrame, but don't understand how to specify this <picture> element as its location.
    Any pointers to example code, or hints/tips?
    Greatly appreciated!
    Charles

    Oh, right. Did we forget to tell you that trying to use XML in InDesign is usually a bad idea and that you could do much better without it?
    Anywhohowwhichwhywhere...
    In keeping with that theme, XML doesn't really come into play. If you have a rectangular frame rect and a filename filename and you want to place  filename in the rect then you just use: rect.place(filename);
    So in your case, it's just about defining the two. I guess:
    var rect, filename;
    rect = app.documents[0].selection[ROW].associatedXMLElement.
        xmlElements[COL].xmlElements[0].xmlElements[0];
    filename = new File(rect.xmlAttributes[0].value);
    rect.place(filename);
    Of course, if your filename is really a URL you'll have a spot of trouble there, maybe.
    And you might be better off using XPath, i.e. .evaluteXPathExpression("//picture") to get your rectangle.
    And what if href= isn't the first attribute of the <picture/> tag?
    I suppose that perhaps you should consider using the .placeIntoFrame() and .placeXML() methods of the XMLElement class. I suspect you'll be sorry if you try, but go ahead :-).

  • How to place the images in Indesign xml file by Javascript?

    How to place the images in Indesign xml file by Javascript?
    We got the Indesign xml file, how to give the image placement link by Indesign javascript? Please help me its urgent.

    Hi,
    You can pass the image url as a href attribute=> file:///Users/me/Documents/my_pic.jpg directly within your xml. It just needs that you pass a local, static and valid url.
    If you want to add image later once the xml is flowed and so target specific nodes and inject images, it's a bit more complex. If the node is not part of the layout, you may try to reach the XMLElement objet and such an attribute, then layout the element.
    var x = some XMLElement
    x.xmlAttributes.add("href","file:///Users/m/Documents/my_pic.jpg" );
    If already placed, then you have to get the associated pageItem, then place your file into it.
    pagItm.place ( File ( "/Users/m/Documents/my_pic.jpg" ) );
    Hope that helps,
    Loic
    http://www.loicaigon.com

  • InDesign XML unparsed Entity unable to handle

    Recently we switched over to the latest DocBook V5.1b2.
    This DTD includes entityref attribute whose required value is an ENTITY.
    Unfortunately this attributes throws error while validating in InDesign, which doesn't when validated with other XML validator tools after exporting.
    I found the below note from InDesign XML reference document from the link
    http://www.adobe.com/designcenter/indesign/articles/indcs3ip_xmlrules.pdf
    Note: Unparsed entity references are not processed by InDesign. For images, use an href attribute
    that contains the file name instead. If necessary, transform the XML file with XSLT to create the
    required structure.
    Have any one got idea to overcome this restriction within InDesign to handle unparsed entities.

    "Within" InDesign, no, nothing you can do. It's documented though, as you found out yourself, and the solution provided might work.
    Can you show a tiny snippet of XML where this entity attribute is used? It ought to be quite simple to write an XSLT that removes this attribute and does an identity transform on the rest of the data, and to apply this XSLT on importing your XML.

  • Indesign XML  to InCopy

    Hi all,
    How to export Indesign XML to InCopy.
    We tried with Non XML workflow its working fine.
    While exporting Indesign XML to InCopy its not converting the base text stream, only the floats are getting converted.
    Please advice.
    Shaji

    r u find solution for this.

  • Converting SiebelMessage IO Hierarchy to XML Hierarchy

    Dear All,
    Is there any vanilla EAI BusinessService available that directly converts SiebelMesssage Hierarchy to an XML Hierarchy?
    I tried 'EAI XML Converter' BS. But it is only able to convert SiebelMessage Hierarchy in to XML Doc rather than to XML Hierarchy.
    If I get an XML Doc then I need to again use 'XML Hierarchy Converter' BS to convert XML Doc to XML Hierarchy. But it is a two step proces again!
    Kindly let me know if vanilla EAI BusinessService available that directly converts SiebelMesssage Hierarchy to an XML Hierarchy.
    Thanks a lot!

    Hi,
    Thanks once again.
    I'll definitely try with 'EAI File Transport' BS.
    But I am sure that I got the Siebel Message as output when I used the EAI Write to File BS 'WriteXMLHier' method. The o/p file even has got the IO name. I believe that IO name will not be included in an XML file.
    When searched in net, some one has told me that this is the vanilla behaviour of 'EAI XML Write to File' BS, WriteXMLHier method (Writes a Siebel Message in to a file even with 'WriteXMLHier' method being used as by default it takes Siebel Envelope ).
    I was also told that even though it writes the o/p as Siebel Message, once the hierarchy is sent to a Webservice, it will be sent as XML Hierarchy only an this is only due to the behaviour of 'EAI XML Write to File' BS. Please let me know if you have any other information.
    Thanks..

  • Indesign XML support frustration, my worst customer experience ever

    Hi,
    I have opened a paid for incident with Adobe, case #  182 433 774 , and am completely frustrated. I have spent 3 hours on the phone talking to people that have NO grasp on the english language, and no technical expertise. They say they don't know XML, but can help me. Days have gone by, and they claim that my problem has been escallated, yet they don't even have the details of the problem. This is clearly the worst tech support that I have ever encountered, even though we are talking about a $2,000 product. Isn't there any better tech support that I can buy?
    Does anyone know what support options I have to resolve and XML issue?  We are only able to render the first page of our XML driven catalog, then the job seems to complete without any complaint. We are using Indesign 5.0.

    Well, you could ask your question here! I hate XML but I can probably help you.

  • InDesign-XML Exporting text that has been deleted

    Hey,    
    After tagging my document in InDesign i deleted some text/pictures/tables. Now whenever i seem to export the same document to XML the old deleted text will export as well? Is there a way to stop this "ghost text" coming back in the export?
    Thanks!!!!!

    Yep--I read your first post too quickly.Sorry about that. Does the tagged structure show up in the structure pane? It should.
    I cannot replicate the problem. Anything I delete in my tagged files do not get exported into the resulting XML whether it is recycling imported XML or creating it from scratch in ID.
    Can you upload a sample to dropbox.com or another large document sharing site (that does not require membership) and provide a download link? If it is sensitive stuff, feel free to click on my name and email or private message me the download link. I would be happy to take a look.
    Oh. You also don't indicate which ID version you are using. Which could be an issue as regards me looking at the file. I stopped upgrading with CS6. I do not think XML or data merging has changed since, well, before CS6, so functionally it shouldn't matter. But if you are using CC, you would need to save out as an IDML for CS6 in order for me to look at it.
    Mike

  • Indesign XML-IN workflow - Anchoring issues

    Hi all,
    We are using Indesign CS5.5 and CS6.
    For XML-IN workflow, we have developed a in-house tool for automation.
    Marginal Notes: Using Script we drag the content from the XML tree and anchor it in Margin as per layout.
    The issue here: In Pagination if they release the anchor the marginal content become Non-XML and wiped out from the XML tree.
    Is there is any work-around to handle these types of issues.
    Please advice.
    Shaji

    Hello Shaji.
    As far as i know there is no solution for this. I'we been struggling with it for a while now. The only "workaround" i found was to use copy-paste instead of releasing the anchor:
    Select the anchored frame, copy it, paste it in place, then remove the old anchor. It should create a new Story element in the XML tree. 
    It's not hard to script, if all you need is to release all anchors from the document/story, for example

  • Best way to get SharePoint workflow to trigger InDesign XML refresh and PDF export?

    What is the best way to get a SharePoint workflow to trigger the refresh of an XML datasource within an InDesign document, and generate a PDF export? The datasource would be hosted by SharePoint.
    Would InDesign Server be required?

    My understanding of the license is that Adobe requires you to use InDesign Server for this sort of thing.
    But the implementation is probably the same either way. Periodically poll, or find some way to trigger it.

  • InDesign XML

    How do you preserve text formatting when text is imported into a text frame via XML?
    Formatting a text frame via map tags to styles will format all text within a frame the same way. What I am asking about is applying additional formatting to individual words within a block of text.
    If you have the following XML node
    <text>This is some text</text>
    How can you import the above text such that the word 'some' is italicized and the word 'text' is bold?
    If displaying XML in a browser you can include html tags inside the XML tag, such that the XML node would look like
    <text>This is <em>some</em><strong>text</strong></text>
    I don't know how to do the same in InDesign.
    Thanks,
    Nathan

    From what I hear this is a great book:
    http://www.amazon.com/exec/obidos/tg/detail/-/0321503554/ref=ord_cart_shr?_encoding=UTF8&m =ATVPDKIKX0DER&v=glance

  • Table data in Indesign - XML, Excel or other?

    Hi
    We are setting up a document that will include a lot of tables for a range of different products.
    The last 2 columns in the tables are for prices and delivery. We need to be able to increase the prices in the Indesign tables easily as and when we need to as the prices increase/decrease for products.
    The increase will most likely be global and by a certain percentage.
    How would we set up the tables/data to be able to do this?
    I'm guessing some kind of external file is fed into Indesign, like XML or Excel, so we can change the prices externally and they are then 'pulled' into Indesign.
    Please help!
    Thanks in advance

    I had not noticed the direct export from InDesign to RTF. You had to put the cursor inside the story to make that option appear!
    It looks really good, and I've sent the result on, to the ones who are going to use it, for them to check whether it's good enough, and if they can take it on to excel or work with it in the RTF format as it is.
    Thank you so much for pointing out this option!

  • InDesign XML traversal Question?

    Hi All,
    I've the three types of the XML structure in Input XML,   the above snapshot for your easy references. The problem how to identify the three pattern of XML in InDesign CS5.5 using Javascript.
    Sample 1 has the <p> tag with some para contents after that the list tag was started.  Script eg:  myElement.xmlElements[0].markupTag.name will gives the name of the first xmlelement inside the <p>,  but how to differentiate if the para has immediate list element or few para text is there after that the list comes ?
    Is there any possibilities to identify?
    Thanks in advance.
    Imagine

    InDesign's limited subset of xpath 1.0 for .evaluateXPathExpression() makes it impossible, I think, to do this that way.
    var doc = app.activeDocument;
    var root = doc.xmlElements[0];
    var elements = root.evaluateXPathExpression("//p[node()[position() = 1 and not(self::*)]]");
    That should get you your first example—all <p>s whose first child node is not an element node. It seems like it works.
    var elements = root.evaluateXPathExpression("//p[List[not(following-sibling::node())]]");
    That should get you <p>s with <List> children without following siblings, which should match your third example only, but matches all three.
    My xpath is rusty, though. Maybe someone else has a better idea. I suppose you could do it by comparing the index of each child element's .xmlContent.
    I think if you applied a transform as you imported the xml (where InDesign offers a fuller xpath processor) and marked these different scenarios with an attribute it would work.
    Jeff

  • Indesign, XML export and NITF

    As producer of a weekly newspaper, I need advice as to generate xml from Indesign CC (Mac) to NITF standards, as preferred by my digital distributor. That includes dividing an article - that may be formatted in just one text frame - into two equal elements: One for headline, byline etc., and one for the body of text. Is there any way of doing this without altering the original layout, intended for printing? I would rather not having to break the one frame up into two just for this purpose – for every article in the paper. Simply put: can one frame, in a whizz, be two elements, both head and body? There are no shortage of helpful advice around on xml, nor on the NITF standard for news dressing, but I have not yet found one that deals with both. Thanks in advance.

    Your suggestion seem to work for me. I created two tags (head and body) that I applied just to other groups of tagged text. It gave me this structure, that might just be what my doctor ordered. Now I am ready to move on to next question: How to get 3 text frames squeezed into this same structure... Thank you so much, Mike!
    <Root>
    <head> 
    <title>title</title> 
    <lead>lead</lead>
    <byline>byline</byline>
    </head>
    <body> 
    <bodytxt>bodytxt</bodytxt> 
    <sub3>sub3</sub3>
    <bodytxt>bodytxt</bodytxt>
    </body>
    </Root>

  • XML Object Comparison

    When comparing two XML objects, it appears that flexunit is reporting their equality when the values of XML elements are not equal.
    Here's a valid example:
    var xmlA:XML =
    <root>
         <element1>text1</element1>
         <element2>text2</element2>
    </root>;
    var xmlB:XML =
    <root>
         <element2>text2</element2>
         <element1>text1</element1>
    </root>;
    Assert.assertTrue(ObjectUtil.compare(xmlA, xmlB) == 0)   => true
    This is correct: element order does not matter and $xmlA/root/element1 == $xmlB/root/element1
    Here's an invalid example:
    var xmlA:XML =
    <root>
         <element1>text1</element1>
         <element2>text2</element2>
    </root>;
    var xmlB:XML =
    <root>
         <element1>text3</element1>
         <element2>text2</element2>
    </root>;
    Assert.assertTrue(ObjectUtil.compare(xmlA, xmlB) == 0)   => true
    This is NOT correct: $xmlA/root/element1 != $xmlB/root/element1
    Can somebody confirm this?  If confirmed, is this by design or am I missing something?
    Thanks!
    Sam

    As you've discovered, the problem is with your comparison. XML in Actionscript are really objects under the hood.
    Lets say you had this:
    var xml1:Object = {element1: "text1", element2: "text2"};
    var xml2:Object = {element2: "text2", element1: "text1"};
    Here, just like you want to do the XML comparison, the order of the properties doesn't matter, but you want to check the values of a particular property.
    So xml1 == xml2 fails not because the element values are out of order, but because the comparison occurs on the objects themselves, and not the properties in the objects.
    In order for my object comparison to succeed, I would probably need to create a hash of properties from both objects and verify that the keys are the same and the values of matching keys are the same if I don't want to use any of the built in utilities for comparing objects.
    So, in your example, the comparison you want to use is E4X, doing something like this:
    Assert.assertTrue( xmlA.element1.text()[0], xmlB.element1.text()[0]);
    I'm not sure how to write an E4X expression traversing two nodes at once, but maybe that will give you some ideas to go on?

Maybe you are looking for

  • BIG, rather funny translation error! in the dutch version!

    they made a big error in translating the words at the ipod options page, it's like, in the bottom you have the bar that says how full your ipod is and with what, like: "audio" "video" or "photo's" only the last one "Free" in english, is translated as

  • Firefox not responding after I open it up

    Firefox has been working fine for me and then out of the blue it stopped loading up. I clink on the icon to launch the browser and it opens a window but the web page never loads up. If I attempt to click on anything in the window it says 'not respond

  • Conned by an App

    Hi. I browsed the apps in appworld and chose to download one based on the several positive reviews it had. It did have negative reviews as well but I could not tell if the problems those users had were as a result of the programme or their providers,

  • Bridge not assigning keywords to .ai files

    My problem is this, I converted a couple ov Vectors to .ai to assign keywords to it. But Bridge keeps telling me that it can't write Metadata to the files. Can anyone please help with this? I've got all the updates for Bridge and I've tried clearing

  • Datagrid and multiple ItemRenderer

    What I would like to do and haven't been successful is add a column to a Datagrid at runtime.  Each cell in that column is going to be different based upon user data. The first column is populated based upon a user query then another query (i.e. REST