Find Xmltag and attribute in the Xml structure

Kings of expensive Script,


I need a script that helps us find one after the other all the elements and attributes in xml in the "select in the structure" of the Indesign file. NOT in the INDESIGN PAGES (layout) (screenshot attached for your reference).


@Example: this research of the Xml structure must be in the form of acrobat PDF format with advanced search option.


Screen Shot 2016-03-17 at 5.54.18 PM.png

How to find this type of labels? Please suggest and help my friends,

Thank you in advance,

Hello

I wrote a piece of code to quickly access based on an xpath expression xmlelements years ago and a dedicated panel.

See if it can help you:

#targetengine "XMLBrowser"

//*
var xmlBrowser = xmlBrowser || (function() {

  var xes;

  var w = new Window("palette", "XMLTree Browser"),
  xmlResults = w.add('listbox'),
  srcField = w.add('edittext', undefined, "//tag", {multiline:true}),
  srcButton = w.add('button', undefined, 'Evaluate Expression');

  w.preferredSize.width = 300;
  w.alignment = ["fill","fill"];
  w.alignChildren = ["fill","fill"];
  xmlResults.preferredSize.height = 300;
  srcField.preferredSize.height = 100;

  srcButton.onClick = function(){
  var xe, doc, root, n, i = 0;
  if ( !app.documents.length ) {
  xmlResults.removeAll();
  }
  else {

  doc = app.activeDocument;
  root = doc.xmlElements[0];

  if ( srcField.text=="" ) return;

  xmlResults.removeAll();

  if ( app.selection.length==1
  && (app.selection[0] instanceof XMLElement )  ) root = app.selection[0];

  xes = root.evaluateXPathExpression(srcField.text);

  xmlResults.enabled = xes.length>0;
  n = xes.length;
  if ( !n ) {
  xmlResults.add("item", "NO RESULTS");
  xes = [];
  return;
  }
  while ( i

HTH

Loïc

www.ozalto.com

Tags: InDesign

Similar Questions

  • No idea how to loop and add the value to the attribute of the xml node?

    I work on a lot of flattening of project using a watched folder.

    I have a process parent to locate the directory and call a sub-process to flatten PDF files.

    I want to write the directory failed to XML.

    If there are several directory failed locations and if I want to add it to the node, he doesn't let me do.

    If I set the Xpath location like/process_data/outputXML/flattenDirectoryRequestMessage/failureFileLocation[x]/@path it gives me invalid character exception. I use 'x' for looping and incrementing.

    If I do not use the [x]. The directory is overwritten.

    No idea how loop and add all the directories failed to attribute of the xml node?

    I understand that you can not browse the xml code to assign the value at each node. Rather you can assign only one time to the node.

    I realized that it is not possible to do it this way. Then concatenate it as strings, and then attach to the xml once.

  • Reorganize the XML structure

    Noob question,

    You can rearrange a structure XML with XSLT or script?

    Lets say I have a clean XML structure like this:

    <Workbook>
         <Element_A_01>
              <Element_A_02></Element_A_02>
         </Element_A_01>
         <Element_A_03></Element_A_03>
         <Element_A_04></Element_A_04>
    
    
         <Element_B_01>
              <Element_B_02></Element_B_02>
         </Element_B_01>
         <Element_B_03></Element_B_03>
         <Element_B_04></Element_B_04>
    </Workbook>
    
    


    Things are a bit messy and the structure turns sharply to it.

    <Workbook>
         <Element_A_01>
              <Element_A_02></Element_A_02>
         </Element_A_01>
         <Element_B_01>
              <Element_B_02></Element_B_02>
         </Element_B_01>
         <Element_A_03></Element_A_03>
         <Element_A_04></Element_A_04>
         <Element_B_03></Element_B_03>
         <Element_B_04></Element_B_04>
    </Workbook>
    
    

    Can I go back tot the original structure of XML with XSLT or scripting to find a tag and place it in the way as the original version?

    Greetings from Holland

    
    

    Assuming that the structure is a document:

    You can export and re - import the XML file and on how apply an XSLT transformation. This will remove only information provision such as text attributes, and a first XSLT will take time.

    You can also use a script, for example

    var rootXE = app.activeDocument.xmlElements[0];
    var wbXEs = rootXE.evaluateXPathExpression("//Workbook");
    var wbXE = wbXEs[0];
    var a1XE = wbXE.xmlElements.item("Element_A_01");
    var a3XE = wbXE.xmlElements.item("Element_A_03");
    a3XE.move(LocationOptions.AFTER,a1XE);
    // refresh a3XE
    var a3XE = wbXE.xmlElements.item("Element_A_03");
    var a4XE = wbXE.xmlElements.item("Element_A_04");
    a4XE.move(LocationOptions.AFTER,a3XE);
    

    This script does not consider the spacing between A4 and B1.

  • [JS/CS6] How can I reach or remove text remains which is stuck in the XML Structure

    Sometimes, the remnants of the deleted text are found at a parent level or root of the XML structure. How can I 'find' scripts?

    Capture1.PNG

    Above, a sample image. The root should be just '<>' and there may be hundreds of items marked under the root, which should not be deleted. The only thing that needs to be removed is the text that shows inside the element root, because it is not in use anywhere.

    To fix it as I want, I can manually drag the document root, enter the editor mode (Ctrl + Y) and delete the text. I do in the editor mode to avoid the deletion of all the other child nodes of the root, which happens easily if I delete all the text in the textframe. When I delete the textframe, after you remove the top-level text which has been 'stuck' before, everything is nice.

    I'd like one to write a script that deletes the text which has got stuck in the root of the way which is shown in the picture (the root is not in the page, it should be empty in case I'm on).

    Defining the content of the xmlElement to "translates in all of the sub-elements being deleted (not what I want).

    Thank you

    Andreas

    It of not elegant, but should work. I can't think of a way to distinguish the 0xFEFFs that "contain" children of other 0xFEFFs that you may have in the history of the root, so that would leave all the ones you hang out.

    var root = app.activeDocument.xmlElements[0],
        i, character;
    
    if (root.parentStory.constructor.name === 'XmlStory') {
        for (i = root.xmlContent.characters.length - 1; i >= 0; i--) {
            character = root.xmlContent.characters[i];
            if (character.contents.charCodeAt(0) !== 65279) {
                character.remove();
            }
        }
    }
    

    Jeff

  • 'Value not completed for attribute "in the XML tag". (SBL-UIF-00265) »

    To get this message when I change a Web layout for a display in Siebel tools 7.8.2 "unfinished value for the attribute"in the XML tag". (SBL-UIF-00265) «... Anyone has an idea why I get this message?

    Hello

    Check the webtemplate to view file. The WT file may contain a double quote in some tags. Maybe it's the cause of the error. U have changed the SWT file by accident. Refer to ID 1280569.1 Web of Support of Oracle for more information.

    Kind regards
    Joseph

  • Table of attributes in the XML element and the element values. Is this possible?

    I use BI Publisher generator model for Word. I'm using Word 2007 and the patch 9821068 generator model.

    I'm trying to create a table using the table Wizard. The values in the column must be based on the attributes of the element and the element values. I have no control over the incoming data.

    Given the following XML:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < valuesOverTime type = "fromServer" >
    < name aValue = "xyz" date = "2010-07-21" time = "" 15: 55:26 ' > 2 < / aValue > "
    < name aValue = 'abc' date = "2010-07-21" time = "" 15: 55:26 ' > 0 < / aValue > "
    < name aValue = "xyz" date = "2010-07-21" time = "" 15: 55:26 "> 42 < / aValue >"
    < name aValue = 'abc' date = "2010-07-21" time = "" 15: 55:26 "> 100 < / aValue >"
    < name aValue = "xyz" date = "2010-07-21" time = "" 15: 55:26 "> 17 < / aValue >"
    < name aValue = 'abc' date = "2010-07-21" time = "" 15: 55:26 ' > 0 < / aValue > "
    < name aValue = "xyz" date = "2010-07-21" time = "" 15: 55:26 "> 1 < / aValue >"
    < / valuesOverTime >

    Table I need should look like this:

    name date time aValue
    XYZ-2010-07-21 15:55:26 2
    ABC-2010-07-21 15:55:26 0
    XYZ-2010-07-21 15:55:26 42

    So far, that I can understand it.

    Any suggestions?

    Thank you
    -Matt
    
      
    
    
  • Find bookmarks and passwords on the old hard drive

    I watched an attempt all suggestions re. This and cannot locate my favorites and passwords on the old hard drive.
    Hard drive is still connected to my computer, even if the PC had a mother brd, the CPU and the RAM upgrade: because of the upgrade failed to load window, if the Windows file is always available. New HARD drive with windows installed, install again. 11.0 ff. The following search suggestions, I find the new profile, but not that of the old drive. I can access my Mozilla folder in Program Files (x 86), but are now looking for appdata etc.
    Yes, I know, it was really stupid to not save this kind of things before the installation of new equipment, but do not think that the material change was hose go my W7 install so bad. Thanks for any help in advance.

    AppData is a hidden file, you need to enable hidden files and folders may be to find. http://www.bleepingcomputer.com/tutorials/how-to-see-hidden-files-in-windows/.

    After finding the appdata folder, read https://support.mozilla.org/en-US/kb/Managing-profiles and recovery of data from an old profile.

  • I lost cell/Solitaire free, etc, so I need to restore the files but can not find system and Maintenance of the Panel

    I got an e-mail allegedly Windows this morning - when I tried to open it nothing happened. Now the games that I had in the starting box disappeared.

    I want to try to restore files in the backup and Restore Center. The brochure that I said to go to the control panel and find system and Maintenance, but I can't.

    Hello

    Take a look at the thread below for a possible solution:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-windows_update/restore-machine-to-its-factory-XP-Pro-condition/e73c252f-0242-E011-9577-d485645a8348

  • PASTE THE BUFFER DUPLICATION AND ATTRIBUTES OF THE PEN OF A PHOTO TO ANOTHER

    I am trying to create the effect of Parallax through a catalog of the same photos. Is it possible for me to paste the clone stamping I did on one photo and paste attributes to the next and so on? Thank you

    If you used the Clone Stamp tool in a new empty layer where you sampled all the layers of cloning in the empty layer. You can drag the layer cloned in your next documents. You can continue clone stamping in the layer to chip away and drag this layer in the following document and so on...

  • Find files and then PUT the results?

    Is it possible to perform a search and then PUT all the found files (download files from search results)?

    I around 255 files in my site updated occasionally to an asset from the library and I can't understand an easy way to download these files on the server without doing it manually on a basis of individual records.

    Any ideas?

    In the files window, click the icon in the upper right (the
    "Venetian blind" icon on a PC, in the header with the word "Files" bar)

    There, select Edit/SelectRecently modified

    --

    E. Michael Brandt

    www.divaHTML.com
    divaGPS | divaFAQ

    www.valleywebdesigns.com
    JustSo PictureWindow

    --

    HSMM_Imaging wrote:
    > Unfortunately, sync is to find about 2000 update files (which can or)
    > not be good to do... not sure because there are multiple users update files.
    (> primarily PDF - on the web server).
    >
    > I want to only download the files that have been disrupted by the library item.
    > 2000 vs 255 files are a big difference.
    >
    > I realize only if I synchronize files and support through the 2000 first
    > files, it can be easier as soon as I change the library item. The thing is, I
    > know 2000 files are not actually "obsolete." It is only through a server
    > local and the changes to the file management that makes things appearing all these files
    > need to sync.
    >
    > Of anyway, if I could download it all the files have only the library item in
    > them, it would make things MUCH easier. I was trying to achieve this by making a
    > the library item tag search query and then download all the results.
    >
    > Does not seem that is possible if... or is it?
    >

  • How to find users and groups in the Sun box

    Please adivce how to find users and group in sunsolaris

    Thanks in advance

    We can get all the details of the Group of the file/etc/Group.

    Similarly the user details are in/etc/passwd.

  • It says no Audio output device installed and when I try to find it and install it the computer says it can't find

    I need to know how to re - turn my speaker. It was working when I got to the computer.

    I suggest that you run the sound troubleshooters.

    Diagnose and automatically repair audio playback problems
    htttp://support.Microsoft.com/mats/AudioPlayback/

    Diagnose and automatically repair the problems of sound recording
    http://support.Microsoft.com/mats/AudioRecording/

    Let us know if that helps with your question.

    Marilyn

  • Read attribute with the XML DOM node.

    Hello, I have a XML file like this:
    <? XML version = "1.0" encoding = "ISO-8859-15? >
    < Datenexport >
    < Codeliste Nr = "1" >
    < Entry >
    < code > < code > J
    < Decodierung_DE > Already < / Decodierung_DE >
    < Decodierung_EN / >
    < / Entry >
    < Entry >
    < code > < code > N
    < Decodierung_DE > NEIN < / Decodierung_DE >
    < Decodierung_EN / >
    < / Entry >
    < / Codeliste >
    < Codeliste Nr = "3" >
    < Entry >
    < code >? < code >
    < Decodierung_DE > Code noch festzulegen < / Decodierung_DE >
    < Decodierung_EN > Code to define < / Decodierung_EN >
    < / Entry >
    ...

    I read the file with DOM and it works fin.
    It is a sample of my code:

    Start

    INDOMDOC: = DBMS_XMLDOM. NEWDOMDOCUMENT (xml_doc. GETclobVAL());

    l_nl: = dbms_xslprocessor.selectNodes (dbms_xmldom.makeNode (indomdoc),'/ Datenexport ',' xmlns:xiz = "http://www.bvl.bund.de/Schema/2010/xiz" ');

    FOR cuta to 0... dbms_xmldom.GetLength (l_nl) - 1
    LOOP

    l_n: = dbms_xmldom.item (l_nl, cur);
    l_nl2: = dbms_xmldom.getchildnodes (l_n);
    lv_value: = dbms_xmldom.getnodename (dbms_xmldom.getfirstchild (l_n));

    FOR cur2 IN 0... dbms_xmldom.GetLength (l_nl2) - 1
    LOOP
    l_n2: = xmldom. ITEM (l_nl2, cur2);
    nodename_val: = dbms_xmldom.getnodename (l_n2);
    dbms_output.put_line ('NodenameAntrag: ' | nodename_val);
    lv2_value: = dbms_xmldom.getnodevalue (dbms_xmldom.getfirstchild (l_n2));
    dbms_output.put_line ('NodeValue: ' | lv2_value);

    IF nodename_val = "Codeliste", THEN number_val: = dbms_xmldom. ??? ;
    ...

    Now, I need to read the number of the "Codeliste" (< Codeliste Nr = "1" >).
    But I haven´t find the right function.
    Anbody help me?

    Always do not use XMLTable for this? ;)

    OK, using DOM, for example:

    SQL> set serveroutput on
    SQL>
    SQL> declare
      2    doc       xmltype;
      3    indomdoc  dbms_xmldom.domdocument;
      4    l_nl      dbms_xmldom.DOMNodeList;
      5    l_n       dbms_xmldom.DOMNode;
      6    lv_value  varchar2(30);
      7  begin
      8    doc := xmltype('
      9  
     10  
     11  
     12  J
     13  JA
     14  
     15  
     16  
     17  N
     18  NEIN
     19  
     20  
     21  
     22  
     23  
     24  ??
     25  Code noch festzulegen
     26  Code to be defined
     27  
     28  
     29  ');
     30
     31
     32    indomdoc := dbms_xmldom.newdomdocument(doc);
     33
     34    l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(indomdoc),'/Datenexport/Codeliste');
     35
     36    FOR cur IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
     37       l_n := dbms_xmldom.item(l_nl, cur);
     38       --lv_value := dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(l_n));
     39       dbms_xslprocessor.valueOf(l_n, '@Nr', lv_value);
     40       dbms_output.put_line('Nr : '||lv_value);
     41    END LOOP;
     42
     43    dbms_xmldom.freeDocument(indomdoc);
     44
     45  end;
     46  /
    
    Nr : 1
    Nr : 3
    
    PL/SQL procedure successfully completed
     
    
  • Reproduce the XML structure

    If I have an empty dataprovider that XML, how can we create another XML with a structure that would match the dataprovider?

    Thank you

    XML.copy)

  • Airbook cannot find HP6600 and CD in the configuration of the printer

    Once I have download CD intall the airbook still gives error saying that it cannot find the current driver, consult the manufacturing.

    Hello

    Please specify your operating system, as well the type of connection you use for the printer.

Maybe you are looking for