Map two tag with single style JS[CS4]??

I've tried to come up with solution but still fail to get anything positive if I wanted to tag two tag(consecutive) to one style e.g. see sample code
<Art>
<Head1>This first heading</Head1>
<p>This is <it>first</it> para</p>
<Head2>This <b>second</b> heading</Head2>
<body-text>This is body <sup><it>this text should be in italic superscript</it></sup> text para</body-text></Art>
Sample script code:-
var myDocument = app.documents.item(0);
    var myPage = myDocument.pages.item(0);
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("Head1"), myDocument.paragraphStyles.item("Head1"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("Head2"), myDocument.paragraphStyles.item("Head2"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("p"), myDocument.paragraphStyles.item("Para"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("body_text"), myDocument.paragraphStyles.item("Body"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("sup"), myDocument.paragraphStyles.item("Sup"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("it"), myDocument.paragraphStyles.item("Italic"));
myDocument.xmlImportMaps.add(myDocument.xmlTags.item("b"), myDocument.paragraphStyles.item("Bold"));
//What else could be here kindly suggest
myDocument.mapXMLTagsToStyles();
My requirement is to apply "SupItalic" style at bold character tags
Mac

Hi Pankaj,
This requirement will be achieved only by script, no other way.
Thanks,
Praveen

Similar Messages

  • Two button with single function

    I want to create two buttons for single function and one button for one function. For example, I click button1, the screen will show "clicked1"
    If I clicked button2, the screen will show "clicked2". If I click button1 and then click button2, it will show "two button are clicked". However, it does not work in two button with single function. What is the problem? Here is the code.
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    var button1:MovieClip=new Button1();
    button1.x=200;
    button1.y=200;
    addChild(button1);
    var button2:MovieClip=new Button2();
    button2.x=300;
    button2.y=250;
    addChild(button2);
    button1.addEventListener(MouseEvent.CLICK, onClick);
    button2.addEventListener(MouseEvent.CLICK, onClick2);
    var isClicked:Boolean;
    var isClicked1:Boolean;
    function onClick(evt:MouseEvent):void{
              isClicked=true;
              trace("clicked1");
    function onClick2(evt:MouseEvent):void{
              isClicked1=true;
              trace("clicked2");
    if (isClicked&&isClicked1){
              trace("two buttons are clicked");

    It works but I want the screen only shows the "isClicked" only when I click button1. But now when I click button1, "isClicked" and "two buttons are clicked" show at the same time.
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    var button1:MovieClip=new Button1();
    button1.x=200;
    button1.y=200;
    addChild(button1);
    var button2:MovieClip=new Button2();
    button2.x=300;
    button2.y=250;
    addChild(button2);
    var isClicked:Boolean;
    var isClicked1:Boolean;
    button1.addEventListener(MouseEvent.CLICK, onClick);
    button2.addEventListener(MouseEvent.CLICK, onClick2);
    button1.addEventListener(MouseEvent.CLICK, onClick3);
    button2.addEventListener(MouseEvent.CLICK, onClick3);
    function onClick(evt:MouseEvent):void{
              isClicked=true;
              trace("clicked1");
    function onClick2(evt:MouseEvent):void{
              isClicked1=true;
              trace("clicked2");
    function onClick3(evt:MouseEvent):void{
              trace("two buttons are clicked");

  • Script to map xml tags to para styles

    I am using the 'FindChangeByList.jsx' to format a series of text files.
    I realise that I can map tags to styles using the 'Tags" palette.
    But I wondered, if it is possible, if someone would be able to show me the syntax to include in my list (.txt file) to map xml tags to paragraph styles assigned in the list as it runs the script?
    Steve

    If you want through find and change here below is a function for apply tag on paragraph style
    var myDoc = app.activeDocument;
    addtags("A Head", "Head");
    addtags("Text", "P");
    function addtags(stylename, tag)
    if(myDoc.paragraphStyles.item(stylename) != null)
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.findWhat = '.+';
    app.findGrepPreferences.appliedParagraphStyle = stylename;
    app.changeGrepPreferences.markupTag = tag;
    myDoc.changeGrep();
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    Shonky

  • Conditional build tags with character styles and ignored text

    RoboHelp HTML v8.0.2.208
    Windows XP Professional Version 2002 Service Pack 3 with 2 GB of RAM
    Output: WebHelp and HTML Help
    I have recently moved my projects from RH HTML X5 to RH HTML 8 and this is when the following problem appeared. I use lots of conditional build tags within the help projects. Some of these tags are for my own use for reference and I combine these with character styles containing a coloured background (highlight) so that they show up in the WebHelp or HTML Help output (e.g. text to identify the software version that the field/feature/text was added, reminders to check details, insertion of bug ID numbers, design document names, etc.). These areas of text are stripped out of the final build for customers by using a conditional build expression.
    What I have noticed is that if a paragraph contains text with a conditional build tag applied AND that tagged text has a character style applied AND an unknown word within the conditional build tag is ignored (with the HTML tag <?rh-ignored text="word_to_be_ignored" ?>), saving the topic, closing it, then re-opening it shows that the conditional build text has stretched to the next conditional build tag, or to the end of the topic if there aren’t any other conditional build tags. This also happens by switching from Design View to HTML View. Note that this doesn’t happen if Ignore All is applied to the unknown word.
    This doesn’t just apply to projects converted from RH X5. I created a new test project in RH8 and the same behaviour was observed. Similar behaviour occurred very occasionally in RH X5 but that seemed to be down to HTML tags being nested incorrectly.
    The largest project contains around 1200 topics and with many hundreds of conditional build text areas this now causes a problem. I’ll probably have to locate every ignored word in an area of conditional text within each project, set it to Ignore All and then manually remove and re-apply the conditional build tags, unless someone can come up with something clever. Can anyone else replicate this and should it be logged as a bug?

    Hi Daggins,
    Thanks - that is good info to have. But as we all agree, that does take away from the point of single-sourcing.
    You aren't misunderstsanding exactly... I am doing all my conditional tagging in FM and it works like a charm in terms of the PDFs that I generate from FM, and even the conditionally tagged text in RH shows/hides correctly. The issue is I am also importing my index and TOC from FM... and even if I have an entire file in FM tagged as conditional (all the text is tagged as conditional, I don't know if you can tag a file as conditional), the file name as a heading it still appears in the RH TOC. There is no text... but in my view it shouldn't appear in the TOC either (it looks like just a broken link when I generate my online help) - this is not ideal.

  • Mapping XML tags to paragraph styles that contain nested styles

    I am importing XML into InDesign (CS5.5) and the tag mapping to styles is working fine until I get to a paragraph style that contains a nested style.
    I have a sentence that starts with a number:
    1the dog runs fast.
    In InDesing properly styled looks like this:
         1  The dog runs fast.
    (tab)1(tab)The dog runs fast.
    The number is styled with a character style (Number) and the whole sentence is styled with a paragraph style (Sentence). In order to get the tabs in between the number, I have a nested style within the paragraph style (Sentence). This triggers the tabs when it hits the character style (Number) like this:
    Number up to 2 Tab Characters
    In XML, it looks like this
    <sentencetag><numbertag>1</numbertag>The dog runs fast.</sentencetag>
    Sentencetag is mapped to Sentence paragrph style and Numbertag is mapped to Number character style, but the nested style for the tabs are not displaying. I just get this in IND.
    1the dog runs fast.
    Everything works beautifully until I hit the nested styles, which I do need to get to work somehow. Any help would be much appreciated.
    Thanks in advance!

    It sounds like your tab characters are actually disappearing from content in the XML. Jeff was responding to the fact that they need to be there, and you state that you originally had them in your document, but they are not showing up once imported through the XML.
    The tabs may be disappearing in the XML document due to the "TAB" character in your text editor not being a tab, or at least not properly-formed XML TAB equivalent, OR because you are not "importing whitespace elements" when you import your XML.
    Importing whitespace elements can wreak havoc on other things in your XML structure and styled layout within the Indesign document, so I would put the XML quivalent of TAB everywhere a tab should be in your XML, and make sure NOT to import whitespace (when importing XML using "Merge Content", select not to import whitespace items from the import options).
    I believe the XML friendly character code for a TAB character is "&#9;" or "&#09;" but have not tested this. Don't include quotes when adding the character code, just the ampersand, semicolon, and everything in-between.
    Also, sounds like your tags are mapping ok for you, so your XML should look something like:
    <sentencetag>&#9;<numbertag>1</numbertag>&#9;The dog runs fast</sentencetag>.
    It should't matter where you put the TAB character equivalent in relation to your nested tag.

  • Import Map file failes with single/Multiple Occurance

    Hi All,
    Using a file I mapped the source and target structures.. The source file has one multiple occurance node . so I used look up option in source table and mapped with target fields...saved the map..
    When I used the following XML file .. I used the same map created befoe... I see the Remote System fields are not failed to map to target structure.. How can I get rid of this issue....
    <Product>
    --<Name>Rajeev</Name>
    --<REMOTE_SYSTEM>
    <Z_MDM_REMOTE_SYSTEM>
           <Z_MDM_SYSTEM_NAME>Panaroma AW Customer ID</Z_MDM_SYSTEM_NAME>
         <Z_MDM_VALUE>600013</Z_MDM_VALUE>
         <Z_MDM_VALUE1>600011</Z_MDM_VALUE1>
         <Z_MDM_VALUE2>600012</Z_MDM_VALUE2>
    </Z_MDM_REMOTE_SYSTEM>
    --<REMOTE_SYSTEM>
    </Product>
    Using above I saved the map.. Its fine.. I am able to import data in to MDM..
    When the file has multiple values of remote system as shown below then field are unmapped... vice versa is also the same..
    <Product>
    --<Name>Rajeev</Name>
    --<REMOTE_SYSTEM>
    <Z_MDM_REMOTE_SYSTEM>
           <Z_MDM_SYSTEM_NAME>Panaroma AW Customer ID</Z_MDM_SYSTEM_NAME>
         <Z_MDM_VALUE>600013</Z_MDM_VALUE>
         <Z_MDM_VALUE1>600011</Z_MDM_VALUE1>
         <Z_MDM_VALUE2>600012</Z_MDM_VALUE2>
    </Z_MDM_REMOTE_SYSTEM>
    <Z_MDM_REMOTE_SYSTEM>
           <Z_MDM_SYSTEM_NAME>Panaroma AW Customer ID</Z_MDM_SYSTEM_NAME>
         <Z_MDM_VALUE>600013</Z_MDM_VALUE>
         <Z_MDM_VALUE1>600011</Z_MDM_VALUE1>
         <Z_MDM_VALUE2>600012</Z_MDM_VALUE2>
    </Z_MDM_REMOTE_SYSTEM>
    --<REMOTE_SYSTEM>
    </Product>
    Do I need to create a seperate map for multiple iteration and single occurance..OR missing some thing? Please advice..
    Thanks
    Rajeev

    HI Ravi,
    May be I took the wrong example..
    I am not talking about remote systems... I am talking about XML source file.. If the XML source file consist of single occurance of any qualifier table then those qualifier table fields are not mapping.. IF I used the base file as multiple occurance Qualifier table....
    In the same way if I use base file as single occurance of Qualifer table .. Qualifier Fields are not getting mapped if the source file is single occurance..
    Suppose :If I use the base file as this and save the map.. I am able to import files whcih are single occurance of EMAIL...
    Fields are not getting mapped if the EMAIL occurnace is multiple.....
    <Product>
    --<Name>Rajeev</Name>
    --<EMAIL>
    <Z_MDM_EMAIL>
    <ID>ABC_yahocom</ID>
    <TYPE>TEMP</TYPE>
    </Z_MDM_EMAIL>
    --</EMAIL>
    </Product>
    In the same way: If I use the following XMl as base and create a map and save it.. Able to import files which had email occurance multiple.. Unable to import data and the fields are not mapped ......
    <Product>
    --<Name>Rajeev</Name>
    --<EMAIL>
    <Z_MDM_EMAIL>
    <Z_MDM_EMAIL>
    <ID>ABC_yahocom</ID>
    <TYPE>TEMP</TYPE>
    </Z_MDM_EMAIL>
    <Z_MDM_EMAIL>
    <ID>CDE_yahocom</ID>
    <TYPE>TEMP</TYPE>
    </Z_MDM_EMAIL>
    --</EMAIL>
    </Product>
    Please advise.. Thanks Rajeev.

  • Having trouble with paragraph styles in CS4?

    Let me start by saying that I am recently switched from Quark, so I am very much a newbie at InDesign. I have been watching as many videos as possible, but can't seem to find the answers in them to specific questions like this.
    I have been taking old brochures that were created in ID3, and pasting type and photos into a new format that was created in ID4. The new format has paragraph styles created already, with updated fonts and other formatting as well.
    When I flow in all the new type, and click on the style sheet, it does change the type to the correct font and size, but there are formats within the paragraph that are not being updated. For instance: the whole paragraph (according to the style applied) should be Gotham Book, but even after applying the style to it, part of it stays Gotham Bold. It was bold in the earlier version of the document, but needs to be unbolded in this one.
    Why, when I apply the style, does it not affect the whole paragraph?

    The latter: InDesign CS3 files are being changed to a new design in InDesign CS4. I did not create either of these files, but am just making the changes from old style to new style, on about 15 different brochures.
    I guess I need to find a quick way to undo any character styles that were applied previously throughout the whole brochure. I want to be able to flow in the old copy, select all of the body copy for instance, and apply the new paragraph styles, without worrying that there is some other formatting in there that I don't even know about. I thought that applying the new paragraph styles would undo ANY of the previous formatting, but that turns out not to be the case.
    I think the poster who suggested doing a find/change might be onto something, but my brain hurts right now, so I am quitting for the day and having a lovely glass of chardonnay... I'll start again fresh in the morning.

  • Two database with Single Catalog

    Hi Experts,
    Is it possible to have two databases registered with a single catalog?
    My database versions are : 9i & 10g.
    The installed database version is 10g.
    Please advice & suggest
    Thanks & Regards,
    MB

    I have problem while connecting with the catalog , am trying to connect from 10g catalog to 9i database, but i get the following error.
    RMAN> connect target sys@TABS
    target database Password:
    Recovery Manager incompatible with TARGET database: RMAN 8.0.4.0 to 9.2.0.0 required
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-06429: TARGET database is not compatible with this version of RMAN
    Please i need help
    Thanks & Regards,
    MB

  • Issue mapping XML tags with element id's

    I know how to map standard XML tags into a template, but how do you handle an XML document formatted like this?
    <?xml version="1.0" encoding="UTF-8" ?>
    - <claims>
    - <claim type="institutional">
    - <loop id="HEADER">
    - <seg id="BHT">
    <ele id="BHT01">0019</ele>
    <ele id="BHT02">00</ele>
    <ele id="BHT03">0000</ele>
    <ele id="BHT04">20090806</ele>
    <ele id="BHT05">104133</ele>
    <ele id="BHT06">CH</ele>
    </seg>
    - <seg id="REF">
    <ele id="REF01">87</ele>
    <ele id="REF02">004010X096A1</ele>
    </seg>
    - <loop id="1000A">
    - <seg id="NM1">
    <ele id="NM101">41</ele>
    <ele id="NM102">2</ele>
    <ele id="NM108">46</ele>
    </seg>
    - <seg id="PER">
    <ele id="PER01">IC</ele>
    </seg>
    </loop>

    its again standard way of mapping.
    use attribute and map it.
    what is the requirement ?
    little more info on how you get this xml, how do you want to make the output to be ? etc..

  • How to sync two devices with single Apple ID?

    I would like to use the same Apple ID for both devices. During syncing in computer ITunes, is it possible to avoid the applications in both devices share to each others?

    What syncs to any given device from a single iTunes library depend on how you have that device's profile set up in iTunes. When you connect the device to iTunes and select it under Devices, you will see a screen to the right. That screen has several tabs, including a tab for Apps. You select which apps you want on a particular device there.
    Be sure you do not have "Automatice Downloads" set up under Settings>iTunes & App Stores for the devices in question.
    Cheers,
    GB

  • Using two computers with single Ipod

    I have an IMac G5 which I have my main ITunes library of music on. I also have an IBook that I travel with and occassionally I download a disc of music onto that computer's Itunes. Then I want to download that disc to my Ipod but if I connect to the IBook I will lose everything except what's on the
    IBook. Can I manage this in the "manuel mode" and how do I get to the manuel mode on the IBook since I have to plug in the IPod to get to preferences and indoing so would lose everthing! help

    "Question: I have a computer at home and one at work. Can I update my iPod music collection from more than one computer?
    Answer: Yes. When you first connect iPod to your computer, iPod recognizes that computer as its "home" computer. Each time you connect, iPod automatically downloads the music library stored on it. When you connect iPod to a different computer, iPod asks for permission before synchronizing with this music library. If you choose Auto-sync, iPod recognizes the second computer as its home computer and breaks the link with the original computer. If you do not choose Auto-sync, iPod switches to manual update mode, allowing you to selectively drag songs, albums, or playlists from the second computer to your iPod.
    Synchronization occurs only in one direction, from your computer to your iPod. This means you cannot transfer music, automatically or manually, from your iPod to a computer, and you cannot use iPod to copy a music library from one computer to another. But, if you legally are allowed to copy music files, you can configure your iPod as a hard disk to move music files."

  • Masking two objects with single image

    hello guys
                   can anybody guides me how to mask tow objects(one box and other image) present in same canvas with third image that also present in same canvas.i can mask only one object at a time but need to mask both.any solution ?
    Thanks in advance
       vineet sharma

    Thanks A Ton Arun.it works for me.
    can u do one more favour for me. plz tell me how to draw the arc and star in flex with mouse.
    i give u reference site http://www.papercritters.com/pc.php
    plz click on toy critter and check the shape menu on right side.
    you will get the shapes including arc and star .i need to draw shapes in similar way.
    ny ways thanks once again for help

  • Map XML tag to an object style

    Hi everyone!
    I am not sure this is the correct place to post it, but i didn't find any "tagging" department of the forums.
    I do import some XML into ID document.
    Text nodes of my XML are imported properly, and i can map any tag of XML to one of the paragraph or table styles.
    But, when i import any images (or another ID documents) with <... href="..." />, how can i map that tag to an object style?
    ///////////// It would be very helpful for example when i'm going to set the stroke of 1pt to all of inline images of text frame.
    Please any feedback would be helpful.
    Alex.

    I will try to give an example, just to give a kick start ........... you need little bit of tweaking to meet your actual requirement:
    suppose you have an xml element "tag" having an attribute "@href" with object style name defined as  it's value. 
    <tag href="object_style_name">
    "object_style_name" is a object style and should exist in your document. To map the tag with the corresponding object style value you can use XMLRules in JS:
    //NOTE: NOT TESTED, BUT SHOULD WORK
    #include "glue code.jsx"
    main();
    function main(){
    if (app.documents.length != 0){
    var myDoc = app.activeDocument;
    var myRuleSet = new Array (
    new findObjAttribute("//*[@href]")
    with(myDoc){
    var elements = xmlElements;
    __processRuleSet(elements.item(0), myRuleSet);
    else{
    alert("You have no document open!");
    exit();
    function findObjAttribute(XPATH){
    this.name = "findObjAttribute";
    this.xpath = XPATH;
    this.apply = function(myElement, myRuleProcessor)
    //Just to check whether the collect element is selected
    var elmName=myElement.markupTag.name;
    var styleName=myElement.xmlAttributes.itemByName("href").value;
    with(myElement){
    try {
    applyObjectStyle(myDoc.objectStyles.item(styleName), true);
         } catch(e){};
    return true;
    HTH,
    Pankaj Chaturvedi

  • Struts- two actions with same path in struts config

    hai
    I am having html:select tag with two options (View And Download) in a form.My form signature is like <html:form action="select">.I mapped two options(View,Download) with same action path.When i click view it doesn't forwards(remains idle) and no error is shown.But i click download it forwards to the appropriate page.If iam having two tags with same action path the second is only working.This problem doesn't comes when iam having one tag alone.
    My code is here:
    -----------Select.jsp----------------
    <html:form action="Select">
    <html:select property="id">
    <html:option value="view">View</html:option>
    <html:option value="download">Download</html:option>
    </html:select>
    </html:form>
    ----------------Struts-config.xml------------
    <form-beans>
    <form-bean name="viewForm" type="ViewForm"/>
    <form-bean name="download" type="DownloadForm"/>
    </form-beans>
    <action-mappings>
    <action path="/Select"
    name="viewForm"
    type="ViewAction"
    input="/Select.jsp">
    <forward name="success" path="/Success.jsp"/>
    </action>
    <action path="/Select"
    name="downloadForm"
    type="DownloadAction"
    input="/Select.jsp">
    <forward name="success" path="/Welcome.jsp"/>
    </action>
    </action-mappings>
    Can i have action tag with same paths like this.If not please provide me a solution

    I have created two success pages.
    I have created two findForward in my ActionClasspublic ActionForward execute(ActionMapping mapping,...............)
    if(a==view)
    return mapping.findForward("success");
    else
    return mapping.findForward("success1");
    ----------------Struts-config.xml------------
    <form-beans>
    <form-bean name="viewdownloadForm" type="ViewdownloadForm"/>
    </form-beans>
    <action-mappings>
    <action path="/Select"
    name="viewdownloadForm"
    type="ViewdownloadAction"
    input="/Select.jsp">
    <forward name="success" path="/Success.jsp"/>
    <forward name="success1" path="/Success1.jsp"/>
    </action>

  • [JS IDCS5] Create tags from paragraph styles

    Hello,
    I would like to iterating through al the paragraph styles within a document to create there tags from. The tags should have the same name as the paragraph styles. Is that possible and how?
    Regards, Sjoerd

    Hi Phil,
    Absolute beginer here. The script creates tags for the styles outside groups, but for some reason it doesn't create the tags out of the Paragraph Styles in folders.
    I enabled the line below and tried to change the "myPStyle"  for "myAllPStyle" in the following lines, but still nothing. Gives error when reaches the line myDoc.changeText();
    Any hint?
    var myAllPStyle = myDoc.allParagraphStyles; //if you want this enable a line all the folder paragraph styles also consider
    for (i=2; i<myAllPStyle.length; i++){
         var myAllPStyleName = myAllPStyle[i];
         //alert(myPStyleName.name);
         try{
              var myXml = myDoc.xmlTags.add(String(myAllPStyleName.name));
              }catch(e){}
         app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
         app.findTextPreferences.appliedParagraphStyle = myAllPStyleName;
         app.changeTextPreferences.markupTag=myAllPStyle[i].name;
         myDoc.changeText();
         app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    Also, how can I make it Map the tags with the PStyles by name after with the script?
    Thanks so much
    Hector

Maybe you are looking for

  • Macro calculation to change for one particular month of year.

    Hi All, I have a query for change in macro. WE have a macro to calculate Target inventory which has same calculation for all through future months for 18 months. Now my user wants to change this all future months calculation would be same except for

  • I tried to read my mails from hotmail. It wont open

    cant get to my hotmail

  • Data refresh bug when using inheritance?

    I am getting unexpected behaviour when using the pm.refresh(Object) method. Refresh works correctly and reloads data if the lock has been updated on tables/objects with no inheritance. However, if I try to use refresh on an object that is part of an

  • Cannot print pdf from safari

    When I try to print a pdf downloaded by safari I only get a blank, black page, if I print via safari itself, and an error that no pages are selected (when thy are) if I try to print via adobe reader,  I'm running OSX 10.9.2 and Safari 7.0.3

  • S/W Inventory

    Using Zenworks 3.0 I am trying to inventory the software on all the computers in our network. The problem I am having is that I am getting too much information. All I really need is what s/w has been installed since Windows was put on the machine. Is