How to get xml all the attributes count?

Hi Indesigners,

I tried a lot of time to get all of the xml attributes count in indesign xml and according to the style applied to the xmlAttribute value, I have to do some tasks... Can someone help me...

Thank you and best regards,

Vel.

Finally, I wrote the script to get the xml attributes...

var doc = app.activeDocument;

var parastyle = doc.allParagraphStyles;

var charstyle = doc.allCharacterStyles;

var currentpara;

var att, att2, val = 'ParagraphStyles\r', val2 = "CharacterStyles\r";

[var attNodes = doc.xmlElements[0].evaluateXPathExpression("//*['@']"); "

var i, t;

~ alert (attNodes.length);

for (i = 0;  I have< attnodes.length;="">

{

Try

{

att = attNodes [i].xmlAttributes.itemByName ("aid: pstyle") .value;

Val = val + att + "\r";

checkpara (ATT);

}

catch (e)

{

}

Try

{

att2 = attNodes [i].xmlAttributes.itemByName ("aid: cstyle") .value;

val2 = val2 + att2 + "\r";

checkchar (att2);

}

catch (e)

{

}

}

Alert (Val);

Alert (val2);

function checkpara (currentpara)

{

If (IsInArray (ParaStyle, currentpara))

{

Alert (currentpara + "Available");

}

on the other

{

Alert (currentpara + "Missing!");

}

}

function checkchar (currentchar)

{

If (IsInArray2 (CharStyle, currentchar))

{

Alert (currentchar + "Available");

}

on the other

{

Alert (currentchar + "Missing!");

}

}

function IsInArray(array,item)

{

var retval = false;

for (var i = 0; i)<>

{

If (array [i] .name is point)

{

retval = true;

}

}

Return retval;

}

function IsInArray2 (array2, item2)

{

var retval2 = false;

for (var i = 0; i)<>

{

If (array2 [i] .name is item2)

{

retval2 = true;

}

}

Return retval2;

}

The above codes will be found the missing character style or paragraph style in the document, which is defined as the value of the xml attribute.

Thank you and best regards,

Vel.

Tags: InDesign

Similar Questions

  • How to get through all the layers?

    I would like to write a script to rename all the layers, but I don't know how to do, who can help me?

    function traverse( layerSet, callback )
    {
      for ( var i = 0; i < layerSet.layers.length; i++ ) {
           var l = layerSet.layers[ i ];
           app.activeDocument.activeLayer = l;
           if ( l.typename == "LayerSet" )
           {
                traverse( l, callback );
           }
           callback( l );
      }
    }
    
    function toUpp( l )
    {
        l.name = l.name.toUpperCase();
    }
    
    traverse( app.activeDocument, toUpp );
    

    In this case, the callback is defining the name of the layer in upper case. The app.activeDocument is a layerSet too. For some reason you need to select a layer before running this script.

  • How can I retrieve all the values in a single query in the oracle XML

    Hi all

    I have xml format below, how do I retrieve all the values in a single query.

    < files >

    < job > MANAGER < / job >

    < details >

    < ename > JONES < / ename >

    < sal > 2975 < / sal >

    < ename > BLAKE < / ename >

    < sal > 2850 < / sal >

    < ename > CLARK < / ename >

    < sal > 2450 < / sal >

    < / details >

    < / documents >

    Thank you

    I prefer desgin a little more sophisticated xml and wrap the details in a separate label.

    Then you could something like that

    1 with testdata until)
    2. Select xmltype)
    3'
    4 MANAGER
    5


    6
    7 JONES
    8 2975
    9

    10
    11 BLAKE
    12 2850
    13

    14
    15 CLARK
    16 2450
    17

    18

    19
    20 ') in the form x
    21 double
    22)
    23 select
    24 j.job
    25, d.ename
    26, d.sal
    27 of testdata
    28 join
    29 xmltable ("Scriptures" in passing testdata.x)
    30 columns
    31 job varchar2 (30) path "job."
    32, details xmltype path «details»
    (33) j
    34 (1 = 1)
    left outer join 35
    36 xmltable (' details/emp' in passing j.details)
    37 columns
    path of varchar2 (30) 38 'ename' ename
    39, path of varchar2 (30) sal "sal".
    (40) d
    41 * (1 = 1)
    >/

    JOB                            ENAME                          SAL
    ------------------------------ ------------------------------ ----------
    JONES MANAGER 2975
    BLAKE MANAGER 2850
    MANAGER CLARK 2450

  • All my photos are displayed such as BW because somehow I saved a preset to quickly develop and it records in BW.  This is for all of my photos.  Individually, I can cancel their but did need help how to get rid of the pre-selection, so he's going to defau

    All my photos are displayed such as BW because somehow I saved a preset to quickly develop and it records in BW.  This is for all of my photos.  Individually, I can cancel their but need help how to get rid of the preset then all photos of goes to Default or in the shot. Thank you

    Go to the develop module and highlight all the images in the film at the bottom of the screen. Enable automatic synchronization, and then click the reset button. To reset all the images in your camera default settings.

  • How to get and install the file txtsetup.oem for xp

    need to know how to get and install the txtsetup.oem file to install xp

    Hello

    The easiest way would be to visit the website of the manufacturer of the motherboard. This would normally have downloads for any RAID drivers required for the loading of Windows XP. The download can be an "executable" who writes a disk for you. It can be also something like a zip file with all files inside that must be extracted and copied to a floppy disk.

    If your PC is not a floppy drive, life becomes quite complicated.

    Please mark this as useful or response if applicable.

    Tricky

  • How can I delete all the music on my rocket drive using my computer?

    How can I delete all the music on my drive using my computer? I printed the user manual, but the statement is vague.

    Please help a frustrated old man,

    Thank someone who answers this time (even before ayone answers that I tend to forget to say thanks for the help)

    misterhy

    [email protected]

    You can (and should) get the free mp3tag: http://www.mp3tag.de/en/

    Install mp3tag.  When you install, let it be added to the context menus (an option during installation).

    Open mp3tag and in tools, Options, Tags, Mpeg do option Write ID3v2.3 ISO-8859-1. Those are tags favorite rocket, and once make you it by default, whenever you save tags in mp3tag you will get tags Fuze and respectful.

    Your albums may not be labeled at all, or may be marked in ID3v1, who will not read the "rocket". So he goes to the title, if there is a title tag or file name if there are no tags.

    You can now right click on an album folder and see mp3tag as an option to open it. When you click mp3tag, you'll see the files listed. Put them in order from top to bottom - you can try clicking on the header of the track-number or the name of the header file if they are 01-Track 1. If you can align them up and down, highlight all the and click Dial automatic tools Wizard with the option of leading zeros. Bingo: Track numbers 01, 02, 03, and they will play in the order.

    Sometimes people put numbers to track on the file names and they list in alphabetical order by song title - not good. If the "rocket" Impossible to find track numbers and the name of the file is FirstSongTitle-01 (rather than 01-FirstSongTitle), the "rocket" will play them in alphabetical order by name of file: FirstSong, FifthSong, FourthSong, SecondSong, SixthSong, ThirdSong. Then you will have to put in one of the track numbers.

  • How can I delete all the files in a folder with a back order?

    How can I delete all the files in a folder with a back order?

    rmdir

    To get options for rmdir, at the command prompt do: rmdir /? MS - MVP - Elephant Boy computers - don't panic!

  • I installed vista SP2 and when I started my computer back up everything on my computer is missing... How to get back all my pictures and music files?

    I installed vista SP2 and when I started my computer back up everything on my computer is missing... How to get back all my pictures and music files? I tried to do a system restore, and I can't go back any further, then the service pack install... so everything is still missing... Please help!

    Hello

    Were there any changes or updates made on the computer?

    I suggest you to see link and check if it helps.

    Recover lost or deleted files

    http://Windows.Microsoft.com/en-us/Windows-Vista/recover-lost-or-deleted-files

    See the articles and looking for the missing files.

    Find a file or folder

    http://Windows.Microsoft.com/en-us/Windows-Vista/find-a-file-or-folder

    Tips for finding files

    http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-finding-files

  • How can I transfer all the contacts in my address book to my laptop?

    How can I transfer all the contacts in my address book to my laptop?

    Thank you

    Charles

    Original title: ADDRESS BOOK

    It depends on where your contacts are stored today.  Whether they're on your phone, for example.  But they are also synchronized to your email provider?  In other words, can you get to your address book by going to your email Web site as an e-mail service to company/school, or Gmail, Yahoo, Hotmail or Outlook.com?  If so, you can sync with your laptop by adding this account to your computer.

    If you can answer with details about your configuration and where your contacts are now and where, inside your laptop you want (like inside Outlook perhaps?), we can help a lot more.

  • How to get and set the length and the width of the content of the layer?

    How to get and set the length and the width of the content of the layer

    All layers are packed not equal. a layer as adjustment have no limits. Layer to smart object can have two different sizes. The size of the object and the size of the object may be transformed. All smart object layers have an associated transform. To transform a smart object layers you need to work with the size of the object the generated pixels fot the layer. Text layer can be resized with a transform or by changing the font size. Pixelated layers are resize via a transformation.  The script method is resize.  When you resize the number of pixelsits made by interpolation. You can specify what method to use or set Photoshop interpolation preferably by default.

    There is also a bug in Photoshop scripts if you pause the story said make a selection and use resize. Photoshop will properly support up to a State before where you suspended history. This bug seems to be in all versions of Photoshop.

    If you look ate the script in my bug report, you should get a good idea of how to resize a layer.

    Photoshop: Bug Script resize the rear paper folded to a history State

  • How to get TableId in the Document by FDK?

    My Code getting Table, but it does not work.

    He can only get a cell contained = "Source of FrameMaker Item.

    This content does not exist in my table.


    tableId = F_ApiGetId (0, DocId, FP_FirstTblInDoc);

    While (tableId) {}

    firstrowId = F_ApiGetId (DocId, tableId, FP_FirstRowInTbl);

    so that {(firstrowId)

    Rad_error_nocontent = F_ApiGetId (DocId, firstrowId, FP_FirstCellInRow);

    so that {(Rad_error_nocontent)

    Rad_error_nocontent = F_ApiGetId (DocId, firstrowId, FP_NextCellInRow);

    }

    firstrowId = F_ApiGetId (DocId, tableId, FP_NextRowInTbl);

    }

    tableId = F_ApiGetId (FV_SessionId, DocId, FP_NextTblInDoc);

    }

    }


    How to get TableId in the Document by FDK?

    diatranthanhoa,

    I do not understand your question. But if you try to browse all the cells of each table, you have errors in your code. These are common mistakes. The errors are:

    -FP_NextTblInDoc is a property of a table object, not the document

    -FP_NextRowInTbl is a property of a line object, not the table

    -FP_NextCellInRow is a property of a cell, not the line object

    So, I have maturities adjust your code as follows, noting that I didn't test this:

    tableId = F_ApiGetId (0, DocId, FP_FirstTblInDoc);

    While (tableId) {}

    firstrowId = F_ApiGetId (DocId, tableId, FP_FirstRowInTbl);

    so that {(firstrowId)

    Rad_error_nocontent = F_ApiGetId (DocId, firstrowId, FP_FirstCellInRow);

    so that {(Rad_error_nocontent)

    Rad_error_nocontent = F_ApiGetId (DocId, Rad_error_nocontent, FP_NextCellInRow);

    }

    firstrowId = F_ApiGetId (DocId, firstrowId, FP_NextRowInTbl);

    }

    tableId = F_ApiGetId (DocId, tableId, FP_NextTblInDoc);

    }

    }

    Hope this helps,

    Russ

  • How to get information about the types within a user defined package

    Hi all
    Have a package with some types (user-defined) defined in the package specification. How to get information about the types and
    information about the columns of this type.

    for example:
    Create package mp is

    type t is record (no number is varchar2 (30));

    procedure a (m t out...

    Thanks in advance.

    userg

    G_user wrote:
    the req's, want to build a script dynamically using data dictionary
    so if possible, I take the name of the type within the package specification.

    Let me rephrase - is there a data dictionary to get information on the type defined by the user within a package specification

    Best approach will be to have a standard in the definition of data types.

    Have a process to follow the object definitions in the package if it is mandatory.

  • DELL Precision T7500 eSata connector on the rear of the machine - how to get power to the drive?

    Howdy,

    I have a DELL Precision T7500 with an eSata connector on the rear of the machine - all my existing SAS and SATA ports on the motherboard are taken and I want to connect an external SATA drive.  How to get power to the drive?

    Is there a map that I can buy.  I have PCI, PCI - X, 2 slots available on the motherboard PCI Express.

    Should I consider that meanders on a power cable 4 wires from inside the machine?

    Thanks in advance.  :)

    Greetings MakesOwnWeather,

    Thank you for your question.

    You need to use what we call a 'hard drive enclosure. What is the physical size of the hard drive external that you want to use? 2.5 inches? 3.5 inches?

    The device draws power eSATA or USB below don't ports so no need of an additional power cable. He receives only 2.5-inch disks.

    http://Accessories.Dell.com/SNA/ProductDetail.aspx?c=CA&l=en&s=DHS&CS=cadhs1&SKU=a3018200

  • How can I find all the plugins in the firefox browser

    HI I was wondering if I could ask a question how can I find all the installed plugins in the firefox lasted I would like to be able to know if, for example, if the shockwave plugin is updated and which version is currently installed in the firefox browser lasted.

    Thank you

    Hello Funny78, type Subject: addons in the address bar and then select plugins, add-ons manager opens and you can see the last version of the plugins (and other info), now click on the click to see if your plugins are up to date and see if it is.

    Thank you

  • How to get rid of the stupid list dropdown in the search box

    How to get rid of the stupid list dropdown in the search box

    If you want to restore the window previously used independently to manage search engines, you can enable or disable this pref to false with a middle-click on the topic: config page.

    • topic: config page: browser.search.showOneOffButtons = false

    Close and restart Firefox to force change.

Maybe you are looking for