How can I add text to a field based on XML tagging?

I'm fairly new to using XML in InDesign layouts, and I'm currently facing an issue getting a bunch of content from database records formatted in a print document (text that flows over dozens of pages). I've figured out how to create an InDesign template, but I need to be able to add text between some of the XML elements in two different scenarios:
1. Add text or line breaks before or after an XML element that always appears in the document. For example: Adding "Description:" before the XML-tagged description content, or adding a return after the last element in a list.
2. Add text before or after an XML element only if it appears in the document. For example: If there's a second phone number, tagged "Phone2" in the XML, then I want " or " to appear before it in the layout. Otherwise there's just one phone number and it continues on to the next piece of content.
I have tried inserting this text into the InDesign template, but keeping them means having to also keep parts of the template that aren't used on every import--so I have a bunch of "or Phone2" bits of text to find and replace afterward. That's OK, but I'd like a more elegant solution that doesn't leave potential mistakes in my layout.
In my preliminary research so far, it looks like an XSLT or scripting might be able to handle this, but I don't know where to start. Can someone tell me if what I'm looking for is possible and suggest the best way to do it? I'm going to have to trial-and-error a solution for this myself.
I am using ID CS6 on a Mac. Thanks in advance for your help.

Thanks for your reply. The line that you mention is added at the top of the message, and includes the original sender's email. I would like my name to appear, next to each line I add in the text of the original mail.
For example:
Assuming my name is Joe Smith, what I would like to have as the final reply is described below.
The lines that start with "[Joe Smith]" are my replies, to the original items in the original mail.
On 21 Feb 2013, at 09:03, Jon Doe wrote:
We need an effort estimation for thenew feature
[Joe Smith] It will be about 2 days
and additional resources needed
[Joe Smith] 2 new icons

Similar Messages

  • How can i add text to a photo in iphoto

    How can i add text to a photo in iphoto?

    Have a look at this discussions page.   ...
    how to add a text to a photo in iphoto?: Apple Support Communities
    Depends to some degree on what iPhoto version you are running but on the  whole this covers most.

  • How can i add text to photo in iphoto?

    How can I add text to photo in iphoto without having lion or mtn lion?

    You can't add text to a Photo in iPhoto. You need an external editor for that:
    In order of price here are some suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate. You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • How can I add text or title to a live video?

    Please, how can i add text or title to a live video (event or church service) am capturing and transmit or export my it to a screen for viewers to see?
    Message was edited by: Kevin Monahan Title was changed.

    Do you wish to add Titles to a live feed, in real-time?
    If so, then you will probably looking at a hardware mixing console/switcher, with character generation capabilities.
    Good luck,
    Hunt

  • How can i add addtional user defiend fields in infoset

    Hi,
    Can any one tell me how can i add addtional user defiend fields in infoset and make it availible in output screen.
    Also please tell me to create parameters through abap quary sq02 , as by default it creates select-option.
    With Thanks n Regards,
    Ranu

    Hi,
    As I said before it is not that straight forward.If you will decompile tcViewProfileAction .class using any java decompiler you will find out that data in setAccountProfile method is not getting set through formmetadata.xml . If you are well verse with struts then only you can achieve what you are trying to do.You need to extend tcViewProfileAction class and also tcViewProfileForm class and then you need to modify tjspViewProfileTiles.jsp .It will not be easy job.Usually in implementation we do not change action class until its absolutely required as oracle also do not recommend that so now its between you and your client to make a call if they want to go for such customization.I won't recommend you do that.
    Regards
    Nitesh

  • How can I add text to a pdf

    How can I add additonal text to a saved pdf?

    Hi remax13
    You Need Adobe Acrobat to Add Text to your PDf files. Two Ways to do this.
    1. Convert your PDf to Native file like word, Excel
    2. Make Changes in the output file
    3. Convert it back to PDF
    Or
    See the below link to use the Add Text and Edit Text Tool in Acrobat.
    http://help.adobe.com/en_US/acrobat/X/pro/using/WS2DE764BD-5706-4e3a-9360-5F2F968223AC.w.h tml

  • How can I have text from multiple fields on one layer, copy to one field on another layer?

    A little help please as it's been years since I've done any coding of any sort.
    So I have a 4 page document with various field types.  I have a document script that gets "TodaysDate" that works perfectly and a few other scripts as well.
    So what I'm trying to do is find a work around for the following:
    I have 3 fields - SURNAME, FIRSTNAME & dob.
    And I want what is typed into these fields to populate into 1 field.  And according to this tutorial (http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript) it's not exactly possible.  At least I think that's what it says.
    However I'm hoping that maybe I could have a Submit button at the end of that document that when clicked would copy the text from those 3 fields (that I would have on 1 layer) into 1 field on a 2nd layer.  Is that even possible??
    I'd also like to have the document Print, Save (using the text in the field on the 2nd layer as the file name), Email (using the text in the field on the 2nd layer as the subject line) and Export to a specific Excel spreadsheet. 
    I don't want much do I?
    I'm using Acrobat 9 Pro on a Windows PC but also have access to Acrobat 8 Professional.  And I'm going to want the form to run in Acrobat Reader X.
    So far I have for the 3 fields into 1 on another layer:
    function buttonClick(){
    if(buttonClick==false)
    event.value=this.getField("SURNAME"+"-"+"FIRSTNAME"+"-"+"dob").valueAsString;
    But I have no idea how to call the event.value from 1 layer to another or if any of that code above would even work at all.
    I have a script that I believe will work perfectly for the Save and Email function:
    Using the “doc.submitForm()” function
    // This is the form return e-mail. Its hardcoded
    // so that the form is always returned to the same address
    // Change address on your form
    var cToAddr = "[email protected]";
    // First, get the client CC e-mail address
    var cCCAddr = this.getField("ClientEmail").value;
    // Now get the beneficiary e-mail only if it is filled out
    var cBenAddr = this.getField("BennyEmail").value;
    if(cBenAddr != "") cCCAddr += ";" + cBenAddr;
    // Set the subject and body text for the e-mail message
    var cSubLine = "Form X-1 returned from client"; var cBody = "Thank you for submitting your form.\n" + "Save the mail attachment for your own records";
    //** Send the form data as an XML attachment on an e-mail
    // Build the e-mail URL
    var cEmailURL = "mailto:[email protected]?cc=" + cCCAddr + "&subject=" + cSubLine + "&body=" + cBody;
    this.submitForm({
                cURL: cEmailURL,
                cSubmitAs:"XML",
                cCharSet:"utf-8"
    I'll work out the Export to Excel thing later as I've seen many tutorials on that.  But can I do the 3 fields to 1 thing at all?
    Please Help!!!

    Sorry Gilad.  I hope I'm not getting on your nerves (too much) but as I said it's been a while since I did any formal code. And I'm trying to do this code for a work document but I'm doing it in amongst so many other things I do for my job that it's difficult to get the time to concentrate for longer than 5 mins.
    I didn't get a chance to try that code until just now.  I guess I asked again as I thought (from what I'd read) that it wouldn't be that simple.
    So I've added that code and I get no errors.  But it doesn't appear to be doing anything either.  I've added the code like this in the Custom calculation script of a separate field I've called FileName.  And on the Button i'm using I've added:  buttonClick()
    function buttonClick(){
    if(buttonClick==false)
              event.value=this.getField("SURNAME").valueAsString + "-" + this.getField("FIRSTNAME").valueAsString + "-" + this.getField("dob").valueAsString;
    So now I'm guessing that becasue i'm not getting an error or a result that I've screwed it up still.  Have I put the code in the correct area?  Have I assigned a the buttonClick() function correctly?

  • How can I add text to a reply message on Mac

    When replying to an email message via the Mail.app (on Mac), I would like my lines to have my name at the beginning of the line, and have it in a different font (similar to what Outlook does).
    I was thinking of writing an AppleScript that will insert my mail, and change its font. The script will be bound to some shortcut.
    1. Is there a script / option that is already doing it?
    2. If not - how can I insert specific text into the current place in an existing email, preferably not by writing it somewhere else and simulating command-v?
    Thanks

    Thanks for your reply. The line that you mention is added at the top of the message, and includes the original sender's email. I would like my name to appear, next to each line I add in the text of the original mail.
    For example:
    Assuming my name is Joe Smith, what I would like to have as the final reply is described below.
    The lines that start with "[Joe Smith]" are my replies, to the original items in the original mail.
    On 21 Feb 2013, at 09:03, Jon Doe wrote:
    We need an effort estimation for thenew feature
    [Joe Smith] It will be about 2 days
    and additional resources needed
    [Joe Smith] 2 new icons

  • In aperture, how can I add text on my picture

    In aperture, I want to add text ,or a messages to  a picture, How can I do this?

    What you seem to be referring to is Watermarking your photos. I offer a series of free PDF's on this issue including how to create watermarks in Pixelmator and add them to Aperture so you can export your images with a protective watermark.
    Daniel J. Cox
    www.naturalexposures.com
    picksme wrote:
    In aperture, I want to add text ,or a messages to  a picture, How can I do this?

  • Pdf files - how can I add text to a pdf file

    I want to allow my Google group to fill info out on a Numbers form, but the Mac users evidently don't have Numbers. I sent it to them as a pdf file, but text can't be added to it as a pdf file. There has got to be a way. I tried using Tools - annotate - add text, but that didn't really work. Any help?

    Because you are recent switcher to OS X I'd strongly recommend bookmarking and using these links, they're designed for those that have recent made the switch and for this considing it.
    Mac 101
    Switch 101
    Find Out How Video tutorials
    List of Useful URLs for switchers

  • How can I add text (eg a signature) to my images in Aperture

    Hi all.  I'm using Aperture 3.2.4  I want to add a signature or logo to my images for printing. How can I do this?  Do I need to use a plugin?  If so, which?

    In the Print dialog you can set metadata display options, to display text below the image, also add a watermark. I can only test this in Aperture 3.4.3 right now. I don't remember, if Aperture 3.2.4 could do this also: But look for these options n the Print panel:
    The most flexible control you'll have with the BorderFX plug-in. It will let you add formatted text to borders and/or watermarks or text directly on the image- Here is a link:
    http://www.iborderfx.com/borderfx/ This version requires MacOS X 10.7 or later. Google for an earlier version, if you have a different MacOS X version.
    And last, but not least: Aperture's file export (Flle > Export > Version) lets you add watermark images to the exported image. You set the watermark parameters by creating or editing export presets.
    Regards
    Leonie

  • How can I add my Sold to field in the infocube via transformation if it is a separate infoobject?

    Hello all,
    Really need your help...I want to include the Sold_to field in my Revenue BEx query but it is not available in the infocube I am sourcing from. It is however in BW as a separate infoobject. Is it possible to include the data in my infocube by adding a field to transformation and sourcing it from 0SOLD_TO? If so, how can it be related to the current data in the infocube (i.e. meaning how will it know which records are applicable to the said Sold to fields if there is no document number in the cube. 
    Please advise if possible or if there are better options which would not require updating the standard datasource 0CO_PA_1.
    Thanks!

    Hi,
    Sorry, Unable to understand your requirement....however below are options which probably may help you:
    1) Add Sold to Infoobject in Cube...Enhance your datasource write logic to populate the datasource field and map accordingly.
    2) Add Sold to Infoobject in Cube...Write Routine/Read Master data to populate in the cube....you should have logic and relationship to derive the same.
    Regards,
    Mayank

  • How can i add text in dreamweaver?

    I want to add text ot my page so i can edit my page in
    dreamweaver. I made my layout in Photoshop no wi want to add a
    "text box" or anything i can add text in, On top of the layout
    cell. Is it possible for me to do?
    -Bryan

    Got a url for us? It would, at first guess, seem you are
    missing an image -
    but we can't tell until your show us the url.
    Brendon
    "BryanRob" <[email protected]> wrote in
    message
    news:eln3rn$jg2$[email protected]..
    > When i try uplaoding my site all i get is ared x./ hwy
    is it doing this
    > what codes need ot be fixed?

  • How can I add text to a photo?

    Is there a way in iPhoto to add text directly to a photo being edited?  With my old PC I was able to add text with Microsoft dicital image suite software.  Thanks.........Allen

    Adding text to a photo is not a feature of iPhoto.
    You can do it with
    Preview - already on your machine
    BorderFX - a free plug-in. (http://www.iborderfx.com/iborderfx/)
    or an external editor.
    In order of price here are some suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • How can I add Text to my photos?

    I would like to add Text to my photos, save the image and upload to be printed at my local Camera and Print Shop.  How do I do this?  I have bought the lightroom 5 book (which is the version I have) but I only find how to add text prior to printing and not how to save the image and print elsewhere.

    OK - so will a Watermark appear on the photo itself?  Or - will it appear on the bottom (within the margins)?  Example - I took some photos of a client's son.  It was his 6 month photo shoot.  I would like to put something like "6 Months Old" in the template of the photo.  Not necessarily on the photo itself - is that possible.  What am I doing wrong?

Maybe you are looking for

  • Previewing page in IE on Mac

    Hi! I am new to Dreamweaver and need to know if Windows based Internet Explorer will work in Browser Preview if run on a Mac. I tried to download IE for Mac but found that it was discontinued. So before I will go and buy IE 7.0 can someone pls let me

  • When I delete an email in Mail, shouldn't it also delete it from the PoP and/or Web accounts also?

    More specifically, when I delete an email message in "Mail",  it still appears in  the POP (in this case Verizon) and/or the Web (MSN) accounts that I have. I then must redundantly delete the message again by going into each of those accounts.  And t

  • Is java servlet a good way for developing a website

    Hi, i am developing a website that has to download huge data and upload huge data .also money transactions through credit cards need to be involved.is java servlet a good way to do this or should i use an ejb or any other technology. Any help is appr

  • IOExceptions from java.io.File.getCanonicalFile()

    The javadoc for the java.io.File.getCanonicalFile() method says that it can fail with an IOException, saying: @ throws IOException If an I/O error occurs, which is possible because the construction of the canonical pathname may require filesystem que

  • Get the number of occurences in a text

    Hi, Is there any way by which i can check the number of occurences of a word in a text ??? for eg. i an have 'i am a good boy and i am a good man' i wnt to check the number of occurences of good in the above statemnt Ny way to do that.......... Thank