XML to the respect of the average carriage returns

Hello

I started a project where I bind a text box to a string, which included \n for carriage returns. This worked OK.

However, I now use a http service call to access an XML file and fill the text boxes. Some text boxes are long and I always want to have carriage returns / new lines.

Because the data is now coming via XML, the "\n" is not respected.

I'm not sure if I should use the new text layout framework for formatting incoming data for paragraphs OR use htmlText of the old mx: component OR another approach. In total there are six areas to separate the text that will display the data in the form of paragraphs, I'm looking for so the most efficient / cleaner to do this.

I use Flash Builder 4.

Thanks in advance,

Niall

In your xml, try using:

< br >

.. and assign the text to the htmlText property.

Tags: Flex

Similar Questions

  • end of the document carriage return

    Hi, I'm new in Indesign Scripting,

    How to read and understand if there is a '\r' at the end of my document?

    Thank you

    You can set the story with a variable, for example. selecting a block of text of this story:

    var myStory = app.selection[0].parentStory;
    

    Now you have access to for example all InsertionPoints and all the characters in this story.

    You could ask the last character and its content (the chain not formatted this character):

    if(myStory.characters[-1].contents == "\r"){
        myStory.characters[-1].remove();
        }
    

    Or, if you want to add a character (a paragraph return) at the end of a story, you can see:

    if(myStory.characters[-1].contents !== "\r"){
        myStory.insertionPoints[-1].contents = "\r";
        }
    

    Be careful when you add special characters.

    See the list here:

    Adobe InDesign CS6 (8,0) object model JS: SpecialCharacters

    Assignment of a special character is like the assignment of a string for the content:

    myStory.insertionPoints[-1].contents = SpecialCharacters.COPYRIGHT_SYMBOL;
    

    Hope that helps!

    Uwe

  • Lightroom Import carriage returns in the IPTC captions

    I use Lightroom 3.3 with Windows.  When I import pictures that have the IPTC caption field created in another program (ThumbsPlus or IrfanView), in the original carriage returns do not appear in Lightroom.  Anyone know why or what to do about it?  I would like to import a lot of photos with existing captions, and some have carriage returns, I would like to keep.

    Windows LR 3 has a bug of long date in the treatment of the line breaks in the metadata.  LR represents always returns to the line in the metadata with a single character (the Unix/Linux/Mac ' \n', Ctrl + J, ASCII decimal 10).  It will preserve the preexisting line breaks in the metadata (even if edit you it), and if you enter a line break in the metadata pane using Ctrl-J or Ctrl + Enter, this new line is going to get written correctly as a single character. However, LR does not correctly display the pre-existing line breaks - they get silently élidés.

    So if you enter a new line in the caption area of the metadata pane using Ctrl + Enter, this new line is displayed correctly.  If you then save the metadata to a file, the line break is properly registered as a single character.  But if you then reread the metadata in LR with reading metadata file, the line break appears more correctly (it will be kept).

    This is a bug of elementary programming caused by the differences between Mac (which uses a single character to represent returns on line) and Windows (which uses the two characters, Ctrl-Ctrl-M-J, although many modern Windows applications accepts a representation).

  • JavaScript to calculate the average of a column

    I have my PDF file I'm trying to calculate the average in a column of fields.

    My problem is that there are 7 areas, but all 7 can be omitted, so I think I need some sort of statement 'if' that would only count the number of fields containing values.  Then, somehow working in the rest of my calculation...

    That's what I have so far...

    (function () {}

    Get all the field values, as numbers
    var v1 = + getField("column.0").value;
    var v2 = + getField("column.1").value;

    var v3 = + getField("column.2").value;

    var v4 = + getField("column.3").value;

    V5 var = + getField("column.4").value;

    var V6 = + getField("column.5").value;

    v7 var = + getField("column.6").value;

    var V8 = + getField("column.7").value;

    Calculate the result and the value of this field
    Event.Value = (v1 + v2 + v3 + v4 + v5 + v6 + v7) / the number of fields that have been filled;

    })();

    I'm pretty new to javascript. Any help would be greatly appreciated! Thank you

    First of all, I woul write this function withou field reference to make it more universal, and then I have a funcion of document level so it could be used more than once in a PDF document and easily put into another PDF file.

    function Avg() {}
    average computer of the last non-empty field names
    var sum = 0; sum of the fields
    var number = 0; meter for non-empty fields
    for (i = 0; i< arguments.length;="" i++)="">
    iField var = arguments [i]; get the element of arguments passed
    var fField = this.getField(arguments[i]).value;
    If (!) isNaN (fField)))) {}
    field is a number
    If (fField.ToString ()! = ") {}
    field is not null or empty
    sum += Number (fField); Add to the sum
    Count ++; County of increment
    } / / do not blank end
    } / / end of number
    } / / end of loop iterative arguments
    If (count! = 0) {}
    calculate the average if there is one or more items on average
    to return the sum / count; Returns the average
    } else {}
    return ";
    } / / no end no average calculated
    } / / end of function Avg

    Your custom calculation script would then become:

    Event.Value = Avg ("column. 0', 'column.1', 'column.2', 'column.3', 'column.4', 'column.5', 'column.6', 'column.7');

  • Delete tagged text carriage return

    Hello

    I'm trying to score a few points, but I have some difficulty. I would like to mark all paragraphs of a textframe.

    I do it like this and works like its supposed to:

    var paragraphs:Array = indesignTools.getParagraphsForTextFrame(currentTextframe.id);
    
    for (var j:uint = 0 ; j < paragraphs.length ; j++) {
        var currentParargraph:Paragraph = paragraphs[j];
        if (currentParargraph.isValid) {
            InDesign.app.activeDocument.xmlElements.add("section", currentParagraph);
        }
    }
    

    Now, the problem I have is that, if the paragraph has a cart at the end, this carriage return should not get tag,

    so I should finish with a paragraph labeled, NOT to mention the last return transport.

    How do I change my code if I can mark all paragraphs without the last carriage return?

    Still waiting for a few comments of thanks or a useful on the post on the recovery of the properties of a "nil" style of characters but anyway...

    Why not just replace

    var currentParargraph:Paragraph = paragraphs[j];

    with something like

    var currentParargraph:Paragraph = paragraphs[j].characters.itemByRange(0,-2)

    It does not test, but should work.

    Don't forget to tell your little.

    Trevor

  • CFFILE READ xml file removes the carriage returns

    When I use CFFILE to READ a XML file (in order to get to the XMLPARSE step), it deletes all the outside between the carriage returns.

    My simple order of action CFFILE = 'read' file variable = "" #tempFile # "="XMLData"results, of course, in the XMLDATA variable." When I've got CFOUTPUT this value, all the transport returns have disappeared.

    In the original raw XML file, there is a section as such:

    < inspection_comment comment_type = '0' > missing tag.

    Channelled to the rear. d < / inspection_comment >

    In other words, there are in fact two combinations of chr (13) chr (10).  Yet, after the CFFILE READING, I find myself with

    Missing tag. Channelled to the rear. (d)

    and no carriage returns whatsoever.   It is a natural phenomenon, because it is an XML file, or I just don't hold my tongue right?

    Thank you!  RLS

    Carriage returns are not visible in html. Make sure that you use

    balises ou quelque chose de similaire.

  • How do you configure vi at the exit of the average of data?

    Hello

    I'm trying to configure my vi to calculate the average, as the data are read by the computer. I tried storing the data in a table, then using the statistics option to calculate the average of arithmentic without success. I have the vi, set up for the output data, as we read on the screen. It seems that the table is not store data, instead, I get the same value of the average with respect to the data.

    Any ideas?

    Thank you

    Sumit.

    You not save the data in a table. You convert the scalar you get from the pulse function in a table 1 d with a single element. You do also very confusing and complicated way. All these conversions of/Dynamics/1 d/2D/Dynamics/1 d are all simply ridiculous. Whenever the loop goes through, get you a whole new table 1 d with a single element. For good build a table, you would need a change of registry with a function of table building connected to it. You can also use the PtByPt function mean cable directly to the exit of scalar measures pulse.

  • Store XML in the schema issue generated tables and XML Validation against the schema.

    Hello friends,

    I am facing a problem where to store xml in a saved schema generated from tables.

    It's my diagram

    --

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < xs: schema xmlns:ds = ' http://www.w3.org/2000/09/xmldsig# "" xmlns: XS = " " http://www.w3.org/2001/XMLSchema "xmlns =" " http://www.ABC.inf.in/test "targetNamespace =" " http://www.abc.inf.in/test" elementFormDefault = "qualified" attributeFormDefault = "unqualified" > "

    < xs: include schemaLocation = "abc.xsd" / >

    < xs: element name = "project" type = 'student' >

    < xs: annotation >

    < Intention > it is a Documentation < / intention >

    < / xs: annotation >

    < / xs: element >

    < / xs: Schema >

    -This is my xml document

    "< project versão ="2.00"xmlns ="http://www.abc.inf.in/test">."

    "< test xmlns ="http://www.abc.inf.in/test">."

    " < intest version ="2.00"Id ="testabc"xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "  >

    < ide >

    < cUF > 35 < / cUF >

    < cNF > 59386422 < / cNF >

    < natOp > This is post < / natOp >

    < indPag > 1 < / indPag >

    < mod > 55 < / mod >

    < set > 1 < / series >

    < / ide >...

    .....................

    Giving not complete because it is too long.

    1. I registered successfully of the schemas in the database

    2. then I generate the saved schema table

    2. in my java code I have validated the document XML schema compared and it's valid successfully.

    3 but when I recorded this XML file in the generated table there me gives error

    As:

    INSERT INTO XMLTABLE

    VALUES

    (XMLTYPE (bfilename('MYDIR','testabc.xml'), NLS_CHARSET_ID ('AL32UTF8')))

    Error report:

    SQL error: ORA-31061: error XDB: XML error event

    ORA-19202: an error has occurred in the processing of XML

    LSX-00333: literal '94032000' is not valid with regard to the model

    And I have to store this xml in tables of this so what I have to do?

    Thanks for your reply odie_63.

    I got this my solution for the error. My XML document is not well structured based on my registered XML schema.

    Average in My XML Document is an invalid value and which do not match my schema model so it gives this error

    SQL error: ORA-31061: error XDB: XML error event

    ORA-19202: an error has occurred in the processing of XML

    LSX-00333: literal '94032000' is not valid with regard to the model

    For the Solution, we have two ways

    1. I changed this literal value "94032000" in my xml file, then save it.

    2.

    -To delete this schema can

    -We need to change the schema for the particular element model

    like: -.

    -then to store xml in the database, it works...

    Thank you.

  • Ability to add the carriage return character

    Hi all

    I have to add the characters return at the end of each paragraph.  I found insertTextAsContent (using: {String |}) SpecialCharacters} ( position: XMLElementPosition), but do not know how to use this function. I think that in this method only accepts the position as an XML element.

    How to use this feature to accomplish my task?

    Use: InDesign CS4/Javascript/Windows.

    Kind regards

    Karpanai

    you could do: string = "\r";

    \r is a carriage return, and \n is a newline

  • Calculate the average per slot?

    Hi Chaps,

    I am a beginner on numbers (almost everything on Mac I would say) and I need help to calculate average values.

    These are calculated values (column 2) taken on a specific time of the day (column 1).
    I managed to create a third using a built-in function to get the time slot (column 3).

    14:58:42

    235

    14

    14:59:42

    274

    14

    15:00:50

    7937

    15

    15:01:55

    5157

    15

    16:02:57

    1822

    16

    16:03:57

    207

    16

    Can please somebody see me step by step how to calculate the average by time slot as below?

    14

    254,5

    15

    6547

    16

    1014,5

    Kind regards

    Stone

    This can help you

    Assuming you data in a table named 'Data' and the information is summarised in another table (right) named "Summary".

    Select cell B1 in the summary table and then type (or copy and paste from here):

    = SUMIF(Data::C,a1,Data::B) ÷COUNTIF (Data::C, a1)

    shortcut for this is:

    B1 = SUMIF(Data::C,a1,Data::B) ÷COUNTIF (Data::C, a1)

    Select cell B1, copy

    Select column B, paste

  • What does the letter 'e' in the average square in my music?

    What does the letter 'e' in the average square in my music?

    Explicit

  • What is the average lifetime of a MacBook (early 2013) Pro HD?

    What is the average lifetime of a MacBook Pro (early 2013 model) HD?

    Details of the model:

    2 x 4 GB RAM (8 GB TOTAL)

    15 "display (no retinal)

    iCore 5 (I think)

    Running El Capitan - wouldn't do most recent update

    Slow summer months.

    512 GB HD - failed just left Monday.

    Attended from Apple Store and advised irreparable. This is a major failure, that I would not have expected so early in his life.

    MacBook Pro NEVER let fall. Kept in a hard case that is attached to the beginning. A travel bag well padded laptop computer and to Uni 3 times a week and then kept on the desk at the rest house of the time.

    Less than 3-1/2 years battery life doesn't seem fair when the system was so well groomed. Backup Time Machine has been religious, who have so.

    Used mainly for photos and photo editing and University study.

    Recently migrated all THE photos and video on an external 1 TB drive (Seagate backup slim) plu.

    Any ideas or advice GREATLY appreciated.

    Hard drives, like any other mechanical device, are prone to failure. That's why you kept backups.

    Don't forget that 'medium' no means half has no sooner. There is no need to compare an average to any specific device.

    Your defective hard disks. You have a backup. Move.

  • 8.1 for Windows and Firefox 36.0.1 the text in the forms box has no carriage return. Earlier versions, as forms of work. Is there any solution for this?

    Before this version of Firefox 36.0.1, the < textarea > HTML worked in my forms. View Cart returns. In the version of 36.0.1 that they no longer work correctly. However, when I enter a carriage return, it displays a space instead of a line break. I went to test basic textarea
    < textarea > name = cols 'comments' = 20 rows = 10 < / textarea >
    to make sure that I was not introducing anything with other languages.
    I use Windows Pro 8.1. I drove back to 35.0 Firefox and everything works fine. I installed 36.0.1 and it stops working.
    I have access to another laptop also running the same version of windows and Firefox and it seems to be done as well strange things. I'm suspicious because I started to notice this immediately after a windows update last night. The laptop also known issues that he immediately after a windows update last night.
    I still have another computer running a different version of windows and Firefox and it works very well. It seems that the issue is where there are windows Pro 8.1 and Firefox 36.0.1.
    Guys do you have an idea what is happening here?
    Thank you
    JMRAUPE57

    The current version supports the white-space for a text box property and it is possible that the Web site uses spaces: pre instead of spaces: pre wrap.
    The former will prevent Firefox of text wrapping.

    You can check that out in the Inspector via the context menu.

    See:

    The white-space property is currently working on HTML < textarea > (bug 82711) elements.

    See also:

  • How do the average of the last 5 values of a column as new values automatically entered?

    If the issue is not clear for you, here's a site I found that teaches you how do it on excel. ml https://www.extendoffice.com/documents/Excel/2533-Excel-average-last-5-values.HT    I can't find the corresponding method on the good numbers. Thank you for your response in advance :-)

    Hi Z_J,

    This number approach pulls the last 5 (low) values of table 1 in another table where the average can be calculated.

    Step 1. Add line numbers in column A of table 1. This gives a way for table 1-1 to extract the last 5 values.

    Formula in A2 (and fill down

    = ROW()

    Step 2.

    In table 1-1, the formula in A6 estimated the maximum line in table 1

    = MAX (Table 1::A)

    The formula in A5 (and filling up)

    = A6−1

    Formula in B2 of table 1-1 (and fill down) using VLOOKUP to find a match for each line number in table 1-1 and get the value out of this line in table 1.

    = VLOOKUP(A2,Table 1::A:B,2,FALSE)

    Step 3.

    Now add another row (and insert a new value) to the lower part of table 1

    Lines 3 to 7 are now drawn.

    Ranger by hiding some columns

    Kind regards

    Ian.

  • Find the average of a set of times

    Hi all

    I have a spreadsheet with 52 pages (weeks of the year, sort of a planner) and every day I type in my wake-up time. Until the end of the week there are 7 times, then a column that has successfully made the average at that time. (see below) using this formula: AVERAGEIF(A3:G3,">5:59",A3:G3)

    I intentionally do include only periods after 05:59 in the formula.

    As you can see it does that very well. All the averages for each week are then sent to an "annual" table on another page (see below)

    The problem when coming to this second table, each average weeks appears in the average annual table always shows the last time which was received (in this case, 09:22). In other words, it does not indicate the average. The formula I use for this table is: AVERAGEIF(C2:BC2,">5:59",C2:BC2)

    So what on earth am I doing wrong?

    Thank you :-)

    I can't read anything in the second table you have posted... it's too small.

    Perhaps to show how the weekly averages go weekly table at the annual table.

Maybe you are looking for

  • Use of the CPU maxed out

    adobe_plugin.exe is to eat all 4 cores of the processor, I found a mozilla site using IE, that said to make this about: config then set dom.ipc.plugins.enabled. to false. Fact. Restarted checked my use of CPU nothing running except for the stuff that

  • Will not download updates for Windows 7

    My machine tells me there are 17 downloads available, but when I try to download the green progress bar tells me something's happening, but nothing ever happens

  • using windows media 11 to put the CD on mp3 player then delete PC and keep MP3

    Hi I'm putting CDs on my mothers via the windows media player 11 mp3 player, IM having the problem, is that its hard drive is nearly full, so I need to remove the music after it's on mp3 player, but when I do delete and go for the next cd on the mp3

  • Outlook of the sidebar calendar

    How can I put the outlook calendar in the sidebar of Vista instead of the gagets.

  • left / right scrolling with 8800 Simulator

    Hello I'm trying to change an application that uses the scroll left / right to change icons.  Works fine on a device, but I can't understand the combinations of keys to scroll left / right in the Simulator.  I tried ctrl, alt, shift etc when scrollin