How to move some xml element and its content to a new frame

Hi All,
How to move some xml element and its content to a new frame.

Hi Chinnadk,
Sorry my code its comment some lines. Now only I check the forum thread, you just try one more time.
#target InDesign;
#include "/Program Files (x86)/Adobe/Adobe InDesign CS5.5/Scripts/XML Rules/glue code.jsx"
var myDoc = app.activeDocument;
//____________________ XML RULE SET
var myRuleSet = new Array (new margintag);
with(myDoc){
    var elements = xmlElements;
    __processRuleSet(elements.item(0), myRuleSet);
function margintag(){
    this.name = "margintag";
    //this.xpath = "//margintag[@type='mn2']";
    this.xpath = "//margintag";
    this.apply = function(myElement, myRuleProcessor){
        with(myElement){
            app.select(myElement);
            try{
                var myPrePara = app.selection[0].paragraphs[-1].parentTextFrames[0].paragraphs.previousItem(app.selection[0].paragraphs[-1]);
                if(myPrePara.characters[-1].contents=="\r"){
                    myPrePara.characters[-1].remove();
                var myTextframe = myElement.placeIntoInlineFrame(["7p9","6p"]);
                myTextframe.appliedObjectStyle= myDoc.objectStyles.item("MN1");
                myTextframe.fit(FitOptions.FRAME_TO_CONTENT);
                myTextframe.parentStory.paragraphs.everyItem().appliedParagraphStyle = app.activeDocument.paragraphStyles.itemByName("MN1");
                }catch(e){}
            app.selection = null;
        return true;
thx,
csm_phil

Similar Messages

  • [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

  • How do I sync my iPhone and its contents to my new MacBook Pro?

    Hi all.
    I've just bought my first MacBook Pro and I'm very happy with it.
    I'm just trying to set up iTunes with my iPhone which I've had over a year.
    The problem is that iTunes isn't detecting all of the apps currently on my iPhone; only the recent purchases/downloads I've made using the new MacBook Pro.
    I assume this is something to do with the fact that my iPhone is probably still 'synced' with my old Dell which is now dead.
    How do I make it so that my new MacBook Pro and iPhone talk to one another without losing all of my data/settings/layout etc of everything on my iPhone?
    Thanks in advance!

    By design, the iPhone will sync itunes content with one computer at a time. Any attempt to sync such content with a second computer will result in ALL itunes content being first erased from your phone & then replaced with the content from the second computer. This is a design feature and cannot be overridden. Because you are replacing your computer, your phone will see this computer as a "new" computer. The itunes content sync is one way: computer to phone. If you have photos that were synced to your phone or music ripped on your own that were not backed up, you will first have to extract them from your phone using third party software, before you do anything else, as Apple makes no provision to do so:
    http://www.wideanglesoftware.com/touchcopy/index.php
    Once you've done that, do the following in the order specified:
    1. Disable auto sync when an iPod/iPhone is connected under Preferences>Devices in itunes.
    2. Make sure you have one contact & one event in the supported applications(Address Book, iCal) on your computer. These entries can be fake, doesn't matter, the important point is that these programs not be empty.
    3. Connect your phone, iTunes running, do not sync at this point.
    4. Store>Authorize this computer.
    5. File>Transfer Purchases(To make sure all purchased content on your phone will be in your itunes library).
    6. Right click in the device pane & select reset warnings.
    7. Right click again and select backup.
    8. Right click again & select restore from backup, select the backup you just made. When prompted to create another backup, decline.
    9. This MUST be followed by a sync to restore your itunes content, which you select from the various tabs, You'll get a popup regarding your contacts & calendars asking to merge or replace, select merge.
    You should be good to go.

  • PSE9: How do I move/copy an Album and its contents from my PC to my laptop?

    I am using Windows 7 and PSE 9 on my PC and want to get a copy of the album and its contents to my Vista laptop running PSE 9 without changing anything on the source PC. Anyone know how to do this? I know I can move the files through Windows Explorer on my network but I have already gone through the trouble of putting the best photos into an Album and would like to simply move the Album over and not have to go through the trouble of recreating it.

    You will need to copy the files.
    1. Make a new folder on your laptop
    2. Open Organizer, select your Album then press Ctrl+A to select all photos
    3. Click the Fix tab and choose Full Photo Edit to open the album contents in the editor
    4. Click File >>Process Multiple Files
    5. From the drop down menu (Process files From) choose Opened Files
    6. For destination click the browse button and navigate to your new folder on your network and click OK
    7. Make sure Rename and Resize is unchecked but check Convert files To and choose Jpeg Max quality or whatever you prefer then click OK and wait for Elements to finish.
    8. Go to your laptop folder to see your images.

  • How to get selection screen elements and its table reference of a report ?

    halo experts
    How can I get selection screen elements and its table reference of a report ? . I tried rs_refresh_from_select_options. But I am unable to get the table and field it is referring to
    For eg if my selection screen 1000 is
    parameters: p_carrid type spfli-carrid,
    select-options :s-_connid type sflight-connid.
    is there any Fm or method which gives me what are the screen elements( p_carrid and s_connid ) and what table( splfi and sflight ) and field ( carrid and conid )it is referring to ?

    The following code is an example of how you might dynamically determine all your PARAMETERS and SELECT-OPTIONS variables at run time.  The PARAMETERS and SELECT-OPTIONS only point to a dictionary element--not a specific table.  Even though you may say "spfli-carrid" or "sflight-connid", the data type really references the dictionary type and not a specific table/structure.
    REPORT  ZTEST_PROG.
    TABLES sflight.
    DATA:
           screen_tab TYPE STANDARD TABLE OF screen,
           wa_screen TYPE screen,
           scrn_nm TYPE string,
           scrn_leftover TYPE string,
           l_type TYPE REF TO cl_abap_typedescr,
           typ_nm TYPE string,
           typ_pre TYPE string.
    FIELD-SYMBOLS <fs_data> TYPE ANY.
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECT-OPTIONS s_connid FOR sflight-connid.
    INITIALIZATION.
      LOOP AT SCREEN.
        IF screen-group3 = 'PAR'
          OR screen-group3 = 'LOW'.
            APPEND screen TO screen_tab.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION.
      LOOP AT screen_tab INTO wa_screen.
        ASSIGN (wa_screen-name) TO <fs_data>.
        l_type = cl_abap_typedescr=>describe_by_data( <fs_data> ).
        IF wa_screen-group3 = 'LOW'.
          SPLIT wa_screen-name AT '-' INTO scrn_nm scrn_leftover.
          TRANSLATE scrn_nm TO UPPER CASE.
        ELSE.
          scrn_nm = wa_screen-name.
        ENDIF.
        SPLIT l_type->absolute_name AT '=' INTO typ_pre typ_nm.
        WRITE:
                 / 'Screen Name:  ', scrn_nm,
                 / 'DDIC Type:    ', typ_nm.
      ENDLOOP.
    When you get into defining internal tables you can determine those at run time with cl_abap_structdescr.  The following is an example of how you might do that.  You can loop through the "components_table" and evaluate each field of the structure in this way.
    DATA: structure_reference TYPE REF TO cl_abap_structdescr,
          components_table TYPE abap_compdescr_tab,
          components_structure LIKE LINE OF components_table.
    structure_reference ?= cl_abap_structdescr=>describe_by_data( any_structure ).
    components_table = structure_reference->components.
    I don't know if this answers any of your questions but I hope that some of it is useful.

  • How to move to Photoshop Elements and new computer

    Hi, I've been using Photoshop Elements for several years, but am new to the forum.  I recently got a new Windows 7 computer and moved all my files, including photos, using a Windows 7 migration cable. I was using Photoshop Elements 6 on my old Windows XP computer and want to upgrade to Photoshop Elements 8 on the new computer.  How do I get my catalog into PE8?  Based on what I'm seeing in the posts on this forum, I'm thinking that I've gone about this the wrong way.  It looks like maybe I should delete my photo files from the new computer, then install PE8 on the old computer, do a backup in PE8, and restore the backup on the new computer in PE8. Does this make sense, or can someone suggest a better way to do this?  Thanks for your help.

    I should delete my photo files from the new computer, then install PE8 on the old computer, do a backup in PE8, and restore the backup on the new computer in PE8.
    That is definitely the most reliable method.  You're changing three things at once: new computer, new version of Windows, new version of PSE.  The catalog conversion process (upgrading to a new version of PSE) and backup/restore are both fairly buggy, so it's wise to do one step at a time to make troubleshooting and workarounds much easier.  It's also better to use the most recent (less buggy) PSE 8 to make the backup, rather than PSE 6.
    People are tempted to take a shortcut on this and try to use PSE 8 on the new computer from a PSE 6 backup.  That will often work, but when it doesn't, they then waste a lot more time trying to make it work.   As the Car Talk Guys used to say, "It's the cheapskate who pays the most."
    See this FAQ for tips on converting from PSE 6 to 8:
    http://www.johnrellis.com/psedbtool/photoshop-elements-faq.htm#_Problems_converting_catalo gs
    and this FAQ for using the backup/restore method:
    http://www.johnrellis.com/psedbtool/photoshop-elements-faq.htm#_Move_your_photos_1

  • How to get the xml element and comment name in a page?

    I need to list all element and comment name in a page

    Hi,
    do
      //K2Vector<XMLReference> allXMLRefs;
                        std::vector<XMLReference> allXMLRefs;
      IActiveContext* context = GetExecutionContextSession()->GetActiveContext();
                        UIDRef documentUIDRef = ::GetUIDRef(context->GetContextDocument());
                        XMLReference rootXMLRef = GetRootXMLReference(documentUIDRef);
                        GetFlattenedElementList(documentUIDRef,allXMLRefs);
                        std::ostringstream os;
                        for(std::vector<XMLReference>::iterator it = allXMLRefs.begin(); it != allXMLRefs.end(); ++it)
                                  XMLReference nextref = *it;
                                  PMString tag_name;
                                  os.str("");
                                  os <<  AsString(nextref,tag_name).GetPlatformString().c_str();
      CAlert::WarningAlert(os.str().c_str());
              }while(kFalse);
    I use above code to get tag name.
    Any one help me to get the comment tag in XML

  • How to append a file directory and its contents in a jTextArea

    how will i display the contents of this file and file directory in a jTextArea or ...let's say it will display the content of "c:/AutoArchive2007-05-24.csv" in a jTextarea
    say this file "c:/AutoArchive2007-05-24.csv"contains the ff:details
    user:jeff AutoArchive-Process Started at Thu May 24 15:41:54 GMT+08:00 2007
    and ended at Thu May 24 15:41:54 GMT+08:00 2007
    Message was edited by:
    ryshi1264

    use the append(...) to append data to the text area.

  • How do i transfer an app and its contents to new mac

    Hi,
    I've just got a new Macbook with Mountain Lion. I backed up my old Mac (Lion) using Carbon Copy Cloner - although i'm not sure whether it was a bootable back up (when i plug the external harddrive in it shows multipe folders - users, systems, library, applications etc...).
    How do I transfer Aperture , Final Cut Pro, iWork, and iLife and all of their saved contents (projects, pictures etc...) over to my new mac. The Genius today told me that because I didn't do a time machine back up I should be careful when transfering these as certain program files may have changed and will have an affect on the new machine...
    Also, I should mention that I don't have Final Cut Pro, Aperture or iWork installed on my new mac.
    Any help would be greatly appreciated...
    Thanks, Aaron

    Okay cool.
    But if the carbon copy was made on Lion and my new OS is Mountain Lion, will this have an affect on the way apps work??
    The only apps i'm worried about are iWorks (as I dont have original disk so need to transfer these apps via carbon copy), as well as iPhoto - as I have all my photos on it.
    Should I just transfer the iWork apps via drag and drop (then do any updates they say I need. and then when I drag and drop the iWork files (pages files mainly) will they work fine?
    And with the iPhoto photos, should I just drag and drop the iPhoto library file - as I won't need the App as it's already installed on my new mac...
    Just a little confused as to how my new mac will accept the Apps and it's files as they are from an older OS...
    Sorry if this is a little confusing...
    thanks so much.....

  • TS1702 some how my phone deleted an app --- My Secret Folder from my iPhone  How do I restore it and its contents  Thanks

    soem how my iphone deleted an app.  can I retore it and its contents?  How?  thanks

    Redownload it from the app store.

  • How to create a text file or XML file  and add content through  code into it...

    Hi Everyone,
    How to create a text file and add content through the code to the text file eform javascript ......orelse can we create a text file in life cycle designer...
    Else say how to create a new XML file through the code and how some content like Example "Hello World".

    You can create a text file as a file attachment (data object) using the doc.createDataObject and doc.setDataObjectContents:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.450.html
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.528.html
    You can then export the file with the doc.exportDataObject method:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.463.html
    This won't work with Reader if it hasn't been given the file attachment usage right with LiveCycle Reader Extensions.

  • How to move all the standard and adhoc reports from cube to multi provider

    How to move all the standard and adhoc reports from the basic cube to multi provider?
    i created this multiprovider to do the maintenence on the basic cube. for example the infocube physical partition, line item dimension and compression.
    what we decided to do is move all the Standard and ad-hoc reports from the basic cube to the multiprovider. How to do it? and make a copy of the basic cube and do the maintenence on the cube. please help.
    Thanks in advance sdn experts!

    Hi Les,
    This sounds good and one thing we try to always keep in mind when undertaking such activities is to always minimise the impact to the user and make the process as transparent to them as possible. So lets say you have your multiprovider and copied queries up in Prod, these queries will still pick up the data from the base cube.
    Now you need to make a copy of the base cube for some changes to the cube model, I would suggest that you copy the cube and make your changes on the copied cube itself. Then 9depending on the changes done) you can load data from Original Cube to New Cube. When this is being done, make sure that you change your queries to add a restriction on 0INFORPOV by Original Cube.
    After the load to the new cube is complete you can run reports restricted to each cube to verify the numbers. Then change the 0INFOPROV restriction in the queries to point to the New Cube and disengage the old cube from the multiprovider.
    Hope this helps...

  • How do I recover a .app and its file contents after osx "click and hold" "hit x button" delete

    How do I recover a .app and its file contents after osx "click and hold" "hit x button" delete.
    Accidently deleted rapidweaver and all of its content and paid plugins with it. all contain in its package contents. how do i restore.  I tried using recovery software.

    It is possible that you inadvertently corrupted the file while doing the edit.
    But it could also be possible that you moved the file? For iMovie to see it, it should be in the Movies/iMovie Projects folder.

  • Had to wipe my drive so I could do a clean install of snow leopard Now I look every where on how to move bookmarks, address book and I cal settings.  I have them back up on a external drive with Time machine but can not move, copy or restore my old sett d

    Had to wipe my drive so I could do a clean install of snow leopard.   Now I have look every where on how to move bookmarks, address book and I cal settings.  I have them back up on a external drive with Time machine but can not move, copy or restore my old settings.  The instructions I have found or no help or needs more clarafication on what to do.

    Use migration assistant to move your files.  http://support.apple.com/kb/HT4889

  • How to create new .dat file and its contents?

    Hi There
    Can anybody let me know the procedure of how to create new .ctl or .dat file to load data to tables.
    i working on 2day dba chapter 8. it shows me how to creat table and use .dat file to load data. but doesnot giv any clue how new .dat file and its contents can be created. please help.
    thanks in advance.

    Thanks for ur help
    I ve created txt file in notepad and saved it as dat file. tried to load that data thru Enterprise manager. used load data from User files everything went well and job was showing suceeded but dont know why that data is not showing in the table. i ve tried it now for three four times. used right table and pathe but dont know. has anybody got idea why that ll be?
    Thanks

Maybe you are looking for