Indesign Javascript, find  xml tag from cursor position

Hi All,
I have a single textframe with multiple xml tags within formated by paragraph and character styles.
I want to access the xml tag attribute of the xmltag, related to my first 5 characters....
How to do it?
Or second approch, i need to find first and last xml tag on the page.

Try this (second approach),
Select any text frame and try the below code:
alert(app.selection[0].lines[0].words[0].associatedXMLElements[0].markupTag.name)\\first XML tag
alert(app.selection[0].lines[-1].words[-1].associatedXMLElements[0].markupTag.name)\\second XML tag
Vandy

Similar Messages

  • Way to find XML Tag name from RDF

    Hi
    Is there some way by which simply looking at fields in RDF, we can find out what XML Tag will be used by the data shown by it. Actually I am using a RDF's output for my XML report. Finding XML tag for a particular field is difficult job.
    Thanks for your help.
    Regards
    Varun

    Got It :-) Just check the data source of field and that is the XML tag. Thanks

  • Remove XML tags from XML element in Oracle

    Hi,
    I have a requirement where I have to remove all the xml tags from xml element with banks, currently I'm using replace 4 times to replace all different types of xml tags, performance is really bad. is there any better option to remove xml tags from xml data leaving the actual data. please find the example data below.
    select
    TO_CLOB(REPLACE(REPLACE(REPLACE(REPLACE
    ('<Concatcolumn><ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>','<ConcatGroupID>'),'<Concatcolumn>'),'</ConcatGroupID>',';'),';</Concatcolumn>')) AS Concatcolumn
    from dual
    **************Out put*************
    MyText Data goes here ;Data agian

    One way is to use xquery:
    SQL> with t as
    select xmltype('<Concatcolumn>
                          <ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>'
       ) xml from dual
    select xmlquery('string-join(//text(), ";")' passing xml returning content).getclobval() xml from t
    XML                                                              
    MyText Data goes here ;Data agian                                
    1 row selected.

  • When I start Firefox, I get this alert message "[JavaScript Application] XML tag name mismatch (expected META)". What is this message?

    My firefox updated today automatically, and then when it started up, it displayed this alert message:
    "[JavaScript Application] XML tag name mismatch (expected META)"
    I can press OK and my browser then works just fine and I can go to websites and what-not. I have not run across any problems or anything. I am just wondering what this alert message means and if I should fix it?
    I tried closing the browser and pulling it back up, and the same message was displayed. Also, if I open a new window the same message is displayed. But it is only displayed right when I open the browser, and does not show up anytime while using the browser.

    If you click the Home button from another page, does the error repeat? If so, what is your home page?
    When Firefox starts, it fires up a lot of add-ons. A standard diagnostic for add-on issues is to try Firefox's Safe Mode.
    First, I recommend backing up your Firefox settings in case something goes wrong. See [[Backing up your information]]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, restart Firefox in Firefox's Safe Mode ([[Safe Mode]]) using
    Help > Restart with Add-ons Disabled
    In the Safe Mode dialog, do not check any boxes, just click "Continue in Safe Mode."
    Do you still get the message? If not, one of your add-ons might not be fully compatible with Firefox 14 or might need an update.

  • Find XML Tags then apply para style

    Hi everyone,
    I need your help for find xml tags and apply para graph style in InDesign CS2. We have 200 xml files apply only 7 type of paragraph styles so any one help and any JS/Apply script or any other find and replace method. I am really appreciate of my bottom of heart.
    thank you so much.

    Hi,
    Try:
    #include "../XML Rules/glue code.jsx";
    var myDoc = app.documents.item(0);
    var myRuleSet = new Array (new applyParaStyle());
    with(myDoc){
            var elements = xmlElements;
            __processRuleSet(elements.item(0), myRuleSet);
              function applyParaStyle(){
                        this.name = "Xp";
                        this.xpath = "//restaurant_name";
                        this.apply = function(myElement, myRuleProcessor){
                                  with(myElement){
                    switch(insertionPoints[0].parentTextFrames[0].parentPage.appliedMaster.name){
                        case "X-Master":                   
                        app.select(texts);
                        app.selection[0].fillColor = myDoc.colors.item("xxxx");
                        break;
                        case "guide-Scotland":
                        app.select(texts);
                        app.selection[0].fillColor = myDoc.colors.item("scotland");
                        default:                   
                        break;
                                  return true;

  • Our etext output needs a combination of XML tags from multiple levels

    Our etext output needs a combination of XML tags from multiple levels. Each unique combination of <OutboundPayment>/<Payee>/<SupplierNumber> and <OutboundPayment>/<DocumentPayable>/<ReferenceNumber> needs to be on a unique line. That means we need to combine information from different levels into a single e-text line before there is an end of record.
    Right now, it pulls the supplier number for the first invoice and matches it up to the proper line, but each line after that just repeats the supplier number it pulled the first time and uses that on each line matched to the different invoices instead of looping back and picking up the correct supplier associated with each invoice in the Format Payments Instructions.
    I have Oracle Support trying to resolve this in an SR, but so far they have made no progress. Has anyone else done this before? What command do I need to use to combine these two levels into one line of output.
    If I create a header line just above the detail line just for the supplier number it gives me exactly what I need, but on two lines in the etext output. I need it all on a single line.
    Thanks.

    If anyone needs the solution, I finally have it:
    I created a level for grouping criteria as PaymentReferenceNumber/Payee/Address/AddressName, DocumentInternalIDSegment2, called InvoiceDetailLevel. The base level is OutboundPayment.
    I then added a level (InvoiceDetailLevel) between OutboundPaymentInstruction and the DocumentPayable level.
    Then in the syntax for the supplier number and the address I entered this in the Data column:
    ../../ OutboundPayment/Payee/SupplierNumber
    and
    ../../ OutboundPayment/Payee/Address/AddressName
    That did the trick and now it is working correctly on every line, looping back to get the proper information.

  • Want to create XML tag from the query

    Here i want to create a xml output from the below code for the given P_repair_number can anyone help me for the code i have written
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    facing the above error when run from concurrent program
    Procedure dfdfdf(p_repair_number number,
                              errbuf        OUT VARCHAR2,
                              retcode       OUT NUMBER) as
    v_error_code NUMBER; -- error code
      v_error_message VARCHAR2(255); -- error message
      v_text_msg VARCHAR2(100);
    cursor Rodetails(p_repair_number IN NUMBER) is
    SELECT
      dra.repair_number,
      dra.repair_line_id,
      items.concatenated_segments item_name,
      items.description item_desc,
      dra.inventory_item_id,
      sr.incident_number sr_incident_number,
      decode(dra.customer_product_id, '',dra.serial_number,cp.serial_number) serial_number,
      ltrim(oeh.order_number) rma_number,
      rstl.resource_name ro_owner_name,
      fndl.meaning flow_status_name,
      dra.status ro_status_code,
      drtt.name repair_type_name,
      dra.problem_description,
      dra.promise_date,
      rgtl.group_name repair_org_name,
      decode(dra.customer_product_id, '',dra.item_revision,cp.inventory_revision) revision,
      cp.lot_number,
      dra.unit_of_measure uom_code,
      uom.unit_of_measure_tl uom_name,
      dra.quantity,
      cp.instance_number ib_instance_number,
      plkup.meaning ro_priority_meaning
    FROM
      csd_repairs dra,
      csd_repair_types_tl drtt,  
      cs_incidents_all_b sr,
      csi_item_instances cp,
      fnd_lookups fndl, 
      csd_flow_statuses_b fsb,
      mtl_system_items_kfv items,
      mtl_units_of_measure_tl uom,
      jtf_rs_resource_extns_tl rstl,
      jtf_rs_groups_tl rgtl,
      oe_order_headers_all oeh,
      cs_estimate_details edt,
      csd_product_transactions txns,
      fnd_lookups plkup 
    WHERE dra.repair_type_id =  drtt.repair_type_id
      AND drtt.language = userenv('LANG')
      AND dra.repair_mode = 'WIP'
      AND dra.incident_id = sr.incident_id
      AND dra.CUSTOMER_PRODUCT_ID = cp.INSTANCE_ID(+)
      AND dra.flow_status_id = fsb.flow_status_id
      AND fsb.flow_status_code = fndl.lookup_code
      AND fndl.lookup_type = 'CSD_REPAIR_FLOW_STATUS'
      AND dra.inventory_item_id = items.inventory_item_id
      AND dra.unit_of_measure = uom.uom_code
      AND uom.language = userenv('LANG')
      AND dra.resource_id = rstl.resource_id (+)
      AND rstl.category (+) = 'EMPLOYEE'
      AND rstl.language (+) = userenv('LANG')
      AND dra.owning_organization_id = rgtl.group_id (+)
      AND rgtl.language (+) = userenv('LANG')
      AND dra.repair_line_id = txns.repair_line_id
      AND txns.estimate_detail_id = edt.estimate_detail_id
      AND edt.order_header_id = oeh.header_id
      AND edt.line_category_code = 'RETURN'
      AND dra.currency_code = oeh.transactional_curr_code
      AND dra.ro_priority_code = plkup.lookup_code(+)
      AND plkup.lookup_type(+) = 'CSD_RO_PRIORITY' 
      AND items.organization_id = cs_std.get_item_valdn_orgzn_id
      AND dra.repair_number=p_repair_number
      AND rownum <50;
    begin
    errbuf := NULL;
    retcode := 0;
      SAVEPOINT Create_external_orders;
      --retcode             := FND_API.G_RET_STS_SUCCESS;
      IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
        fnd_log.STRING (fnd_log.level_procedure, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER.BEGIN', 'Enter - PrintTraveller');
      END IF;
    --FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
    --FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORDER>');
    FOR v_rodetails IN Rodetails(p_repair_number)
    LOOP
    /*For each record create a group tag <G_RODETAILS> at the start*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORDER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_RODETAILS>');
      FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_NUMBER>' || v_rodetails.repair_number ||
                                       '</REPAIR_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_LINE_ID>' || v_rodetails.repair_line_id
                                    || '</REPAIR_LINE_ID>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ITEM_NAME>' || v_rodetails.ITEM_NAME
                                     ||'</ITEM_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ITEM_DESC>' || v_rodetails.ITEM_DESC
                                    || '</ITEM_DESC>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SR_INCIDENT_NUMBER>' || v_rodetails.SR_INCIDENT_NUMBER ||
                                       '</SR_INCIDENT_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERIAL_NUMBER>' ||v_rodetails.SERIAL_NUMBER
                                     ||'</SERIAL_NUMBER>');                               
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RMA_NUMBER>' || v_rodetails.RMA_NUMBER
                                    || '</RMA_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_OWNER_NAME>' ||v_rodetails.RO_OWNER_NAME ||
                                       '</RO_OWNER_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<FLOW_STATUS_NAME>' || v_rodetails.FLOW_STATUS_NAME
                                     ||'</FLOW_STATUS_NAME>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_STATUS_CODE>' || v_rodetails.RO_STATUS_CODE
                                    || '</RO_STATUS_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_TYPE_NAME>' || v_rodetails.REPAIR_TYPE_NAME ||
                                       '</REPAIR_TYPE_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PROBLEM_DESCRIPTION>' || v_rodetails.PROBLEM_DESCRIPTION
                                     ||'</PROBLEM_DESCRIPTION>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PROMISE_DATE>' || v_rodetails.PROMISE_DATE
                                    || '</PROMISE_DATE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_OWNER_NAME>' || v_rodetails.RO_OWNER_NAME ||
                                       '</RO_OWNER_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORG_NAME>' || v_rodetails.REPAIR_ORG_NAME
                                     ||'</REPAIR_ORG_NAME>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_STATUS_CODE>' || v_rodetails.RO_STATUS_CODE
                                    || '</RO_STATUS_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REVISION>' || v_rodetails.REVISION ||
                                       '</REVISION>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<LOT_NUMBER>' || v_rodetails.LOT_NUMBER
                                     ||'</LOT_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<UOM_CODE>' || v_rodetails.UOM_CODE
                                    || '</UOM_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<UOM_NAME>' ||v_rodetails.UOM_NAME ||
                                       '</UOM_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<QUANTITY>' || v_rodetails.QUANTITY
                                     ||'</QUANTITY>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<IB_INSTANCE_NUMBER>' || v_rodetails.IB_INSTANCE_NUMBER
                                    || '</IB_INSTANCE_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_PRIORITY_MEANING>' || v_rodetails.RO_PRIORITY_MEANING ||
                                       '</RO_PRIORITY_MEANING>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_RODETAILS>');                             
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</REPAIR_ORDER>');                                
    END LOOP;
    IF(retcode != FND_API.G_RET_STS_SUCCESS) THEN
                    RAISE FND_API.G_EXC_ERROR;
                  END IF;
                  IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
                    fnd_log.STRING (fnd_log.level_statement, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER', ' In PrintTraveller');
                  END IF;
    fnd_file.put_line(fnd_file.log, 'Successfully completed PrintTraveller');
    EXCEPTION
    || Catch all error.
    WHEN OTHERS THEN
    ROLLBACK;
    v_error_code := SQLCODE;
    v_text_msg := 'Fatal Error, Oracle Error is: '
    || TO_CHAR (v_error_code, '99999');
    fnd_file.put_line (fnd_file.log, v_text_msg);
    v_error_message := SQLERRM;
    fnd_file.put_line (fnd_file.log, v_error_message);   
    end dfdfdf;Edited by: user12053530 on Apr 19, 2010 5:54 AM

    However using SYS.ODCIVARCHAR2LIST makes sense if your query is a part of bigger processing (PL/SQL procedure or function) and you will do some processing depending on File_Type, like in this example (not compiled, could contain syntax errors):
    DECLARE
      l_stid           VARCHAR2(10);
      l_address        VARCHAR2(30);
      l_File_Type_tab  SYS.ODCIVARCHAR2LIST;
      cur_cursor IS SELECT STID,
                    ADDRESS,
                    CAST(COLLECT(DISTINCT File_Type) AS SYS.ODCIVARCHAR2LIST) AS File_Type
                    FROM (
                          SELECT STID,
                                 ADDRESS,
                                 File_Type
                            FROM DUMMY
                    GROUP BY STID, ADDRESS;
    BEGIN
      OPEN cur_cursor;
      <<main_loop>>
      WHILE (1=1) LOOP
         FETCH cur_cursor INTO l_stid, l_address, l_File_Type_tab;
         EXIT WHEN cur_cursor%NOTFOUND;
         -- Now do processing for each File_Type in l_File_Type_tab;
         <<each_file_type>>
         FOR i IN l_File_Type_tab.FIRST .. l_File_Type_tab.LAST LOOP
           -- for example:
           -- IF l_File_Type_tab(i) = 'SALES'
           -- THEN
           --   do_something(l_stid, l_address);
           -- ELSIF l_File_Type_tab(i) = 'TRANSFER'
           -- THEN
           --   do_something_else(l_stid, l_address);
           -- ELSE
           --   do_something_default(l_stid, l_address);
           -- END IF;
         END LOOP each_file_type;
      END LOOP main_loop;
      CLOSE cur_cursor;
    END;

  • Unable to find XML document from class path resource

    Hi,
    I am trying to learn spring and wrote my first class today. I added all the jar files to the lib folder and created all the classes. When I try to run the client program I get
    [INFO] XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [MorningGreeting.xml]
    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [MorningGreeting.xml]; nested exception is java.io.FileNotFoundException: class path resource [MorningGreeting.xml] cannot be opened because it does not exist
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:180)
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
         at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
         at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
         at com.training.spring.greetCustomers.EnterTraining.main(EnterTraining.java:22)
    Exception in thread "main"
    I have my client, interface, XML file all in the same package com.training.spring.greetCustomers. I could not understand what I am doing wrong?? Can you please help me.

    congratulations on deciding to learn spring. that's a smart thing to do.
    stop assuming that you did it correctly. the xml file is not in the classpath. when you get it there correctly, spring will find it.
    you have the source files and xml in that directory, but where do the .class files end up when you run them? does the xml config end up there, too?
    remember, the xml config should be in the directory where the root of the package hierarchy begins, not down where the .class files are.
    %

  • Removing XML definition & XML tage from the XML message....

    Dear All,
    We are using PI 7.1 and implementing a scenario in which we need to send a signed payment message to our partner, our implemented scenario goes as follows:
    1) We are using SOAP without header to send the message.
    2) We are signing the payload using our own java code as UDF in graphical mapping.
    3) the main issue that we have is that in the final XML message which is being sent to our partnet, XMl definition and the topmode XML tage are again added to the signed message. Please see the following for reference:
    Source Message:
    We are using only I node in the graphical mapping and one UDF to sign in between the source and the target node. So after signingwe get the following in the target node:
    Signed Message
    0u201A#u0152# *u2020Hu2020÷ ### u201A#}0u201A#y###1#0 ##+######0u201A#h# *u2020Hu2020÷ ### u201A#Y#u201A#U
    u201A#ý0u201A#¸0u201A#  ######5gu0152yu2022ݬ½´b#¿#u2019 u01780 # *u2020Hu2020÷ #####0�Ý1#0 ##U####US1#0###U# ##VeriSign, Inc.1#0###U####VeriSign Trust Network1;09##U### BLAH BLAH BLAH SOME VERISGIN CERTIFICATE SIGNING INFORMATION
    but the final message that get through the SOAP and reaches our partner look liks the following:
    , as all this is appearing twice in our final message.
    I'll appriciate if anyone can help us finding a solution for that, as we tried to remove it in our java class at the adapter level in the module tab, but that produces java error.
    Regards,

    Vijaya, we already have solved this problem by creating an EJB and adding it to SOAP Adapter processing modules, so rather signing our payload in the UDF in graphical mapping we are now signing the payload in the SOAP adapter module and removing any unwarranted characters etc over there as well. We cannot send SOAP with header in our scenario as it is adding hell lot of extra bites that our partner system cannot understand, so we have adapted the EJB way of solving it. Thanks anyways for your suggestion.
    Athar Ullah Khan

  • Generating target XML tag from a value in the Source XML document

    Hi there,
    I have a scenario where the following transformation needs to occur:
    Source Message...
    <Catalogue>
      <key>abc<\key>
      <value>123<\value>
      <key>def<\key>
      <value>456<\value>
    <\Catalogue>
    Target Message...
    <Catalogue>
      <abc>123<\abc>  --> Value of KEY becomes the XML tag and the VALUE gets assigned to it
      <def>456<\abc>
    <\Catalogue>
    The target message is written to an xml file using the receiver file adapter.
    I would like the target message generation to be dynamic so that when a new key-value pair is added, it would not require a change in the XI mapping layer.  Is there a way to accomplish this without having to code or enhance the adapter.  I am trying to avoid doing this in the mapping because that would mean changing the mapping every time a new key-value pair needs to be added.
    Any suggestions to accomplish this are welcome.
    Thanks all.

    Hi,
    I doubt if it will work for you. you can generate dynamic values using this but not tags dynamically. You need to see if there are any methods to generate tags dynamically.
    One way of doing this is by using Java Mapping and playing around with InputStream and OutputStream.It will work for sure with this.
    Thanks
    Amit

  • Find XML file from archive

    Hi,
    I have one xml file that is packaged in an EAR file and deployed to Websphere.
    I have to read the contents of the xml file.
    How can I do that?

    I have some XML files that are packaged in a EAR file and deployed to Websphere AppServer.
    Ex: WEB-INF/classes/XMLDir/test.xml
    I have to find the location of these files ( relative to Webspere classes dir ) and Parse through these files.
    The below code is not finding xml files (returning NULL ) and throwing Exception.
    String xmlFile = "XMLDir/test.xml";
    InputStream input = this.getClass().getResourceAsStream(xmlFile);
    How can I find these xml files, so that I can parse through these files.

  • Finding XML file from EJB doesn t work.

    Hi all:
    I have an EJB accesing a XML file to parse a XML document. The file is in the classpath, and sometimes the EJB finds it and sometimes not.
    What happens?
    When the EJB finds it, DOMParser method, parse(InputStream), doesn t work.
    I use this file to config DB connection externally for my BC4J (I don t use JTS).
    Thanks in advance.
    Joaqumn.

    Well, it won't work as iWeb has no import facility so cannot open html files.
    What you could do is upload the html file to wherever you are hosting your site and create a link to it from iWeb, or find another package similar to the one you are using at present that is for Mac rather then PC.

  • Feature Request: Zoom from cursor position

    Default zoom behavior seems to be to zoom with the zoom center at the center of the screen. This works sort of OK.
    However, it would be more efficient for me if I could zoom with the zoom center at the cursor/mouse position. Then I can quickly zoom in/out on the feature I want.

    1.) Select the detail/part you want to zoom to by clicking on it with the left mouse button.
    2.) Click the right mouse button and select
    `Part Options'->`Zoom To Part'
    from the context menu.
    Alexander

  • Indesign Javascript and xml structure

    Hi to all
    I am new to program javascript in Indesign, and I am looking for some example on how modify the xml structure inside a document using a javascript script.
    i.e.
    if I have a structure like this in the original document:
    root
    section
    tag1
    tag2
    tag3
    I need to transform it in this way( this is just an example, may be more complex):
    root
         section
              tag1
              tag2
              tag3
    Any help on where or how to solve this is very appreciate.
    Thanks a lot

    I think the MoveXMLElement.jsx script there shows pretty well what's involved. Here's something that addresses something closer to your example:
    var root = app.activeDocument.xmlElements[0];
    root.xmlElements.item("tag1").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    root.xmlElements.item("tag2").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    root.xmlElements.item("tag3").move(LocationOptions.AT_END, root.xmlElements.item("section"));
    You want to be careful about the order you do things and when you grab references to the xml structure objects, since you're changing them as you go (i.e. root.xmlElements[3] might refer to tag3 when you start, but will be invalid once you start moving things into section).
    If the xml structure in your InDesign document is the result of an xml import, you might consider transforming the xml as you import it. It's faster and more natural there.
    Hope that helps,
    Jeff

  • Finding xml tags name

    Hello,
    I use: Node root=doc.getDocumentElement();
    to find root of XML and NodeList a=root.getChildNodes(); to find all his children. how can I find tag's name (age)?
    <age> 22</age>

    Well, in a, you have a NodeList. That list contains a lot of nodes. If age is the first (and/or only) node in that list, you probably can take a.item(0).getNodeName();
    Read more at http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Node.html and http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/NodeList.html

Maybe you are looking for

  • For users of Central Station or Big Knob....or passive speakers

    I've got a bit of a conundrum and would appreciate your expert input to try and solve it. I have two sets of passive monitors, and an alesis ra-100 amp. I'm looking at the central station by presonus, but something on their website left me a little c

  • Does apple needs to make a external hard drive?

    me personally. i think if apple would make a external hard drive or make the ipad/iphone/ipod compatible with a third party hard drive i wouldnt have a need for a computer the apple system would be a all in one. Im going to get a ipad 2 but was inter

  • Address book entries in different language / alphabets

    as a foreigner living in Greece I find it useful to have local names addresses written in greek characters. I have entered names in Latin characters and phonetic option in Greek, later the opposite. Some entries appear in alphabetical order, others a

  • Commercial invoice

    Hi all, I created import PO of quantity 100 and made commercial invoice of 50 quantities and done GR with ref to commercial invoie. But when i am again recieving second lot of 50 quantities and creating commercial invoice system is not allowing to cr

  • Someone pulled the CF out of my 4402. How to Restore?

    So one of our 4402's we had laying around that wouldn't boot and I found that the CF card got yanked.  I put a 32MB Cisco branded CF card just for kicks to see if the controller would recognize it, and it did.  However; I have no idea how to load the