Tab And New Line in XML data

I have a formatted text which I store as a text node. By default the new line char's are converted into white spaces. I read elsewhere on this forum, that we should use the charecter entity reference equivalent &#A; for new line. I did not understand this idea clearly, so I tried this out:
In my formatted string, I replaced all instances of '\n' with '&#A;'. I create my text node as follows:
script.replaceAll("\n","&#A;");
scriptElement = document.createTextNode(script);
As expected when the XML is written the &#A10; is further encoded into "&#A10". And when I read back my XML from the parser, I get my string back with all the "&#A10;". I again need to do a replace all to get the new line charecters back.
My question is : Is there any other standard solution to this problem or the bottom line is to replace the new line and tabs with "MUMBOJUMBO" or a standard charecter entity ref and look for the same while reading back.
Is there anyway I could tell my XMLwriter to convert '\n' into "&#A;" and get back '\n' when I parse the XML?

by default, all white spaces collapse: http://www.w3.org/TR/xsl/slice7.html#white-space-collapse
you can use xml:space="preserve" in your XML elements (tags) or
you can use <fo:block white-space-collapse="false" linefeed-treatment="preserve"> in XSL if you use XSL to format the XML.

Similar Messages

  • NEW CELL and NEW LINE

    Hi,
    I am not clear about NEW CELL and NEW LINE in The Main window -> Table -> Footer -> Output options -> Output Table.  Could any one help in explaining exactly what is the purpose of it.
    Thanks
    Ram

    when you are placing a text element, you need to specify whether you want this text element to be displayed in the next cell of the table. If the text element is to be displayed in the next line then you will have to check that as well. So, if you are displaying a list of fields in a row format then for the first field, you check both line and cell and for the rest of the fields you check just the cell.
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • B2CBasket- Sales Order  How to add Vendor partner and new line item of SO

    Hi,
    I want to add the following BEFORE the sales order creation process starts:
    Add a VENDOR partner
    Add a new line item to ORDERADM_I
    I suspect in BADI CRM_ISA_BASKET_ITEMS and CRM_ISA_BASKET_HEAD. I have user 'HEAD' to add extension fields but cant figure the creation of NEW partners and NEW line item.
    regards,
    Dave

    Thank you for feedback Shantoor,
    The CRM_ORDER_MAINTAIN need not be called as this FM is called immediately following almost all of the CRM_ISA_* BADI's.
    For clarification I just want to expand on the solution..
    In all of these BADI's SAP uses the CT_INPUT_FIELDS parameter. This is where you should enter WHICH fields you have made changes to in the exit. CRM_ORDER_MAINTAIN uses the same parameter.
    However the challenge is .. WHAT do you enter in the CT_INPUT_FIELDS. This is where you have to follow a strategy. I yused the following:
    1. Looked where the structure was used in programs/class to see how SAP used it
    2. Set breakpoints at the call of the BADI. Check what CT_INPUT_FIELDS content is (SAP uses same technique)and try and replicate for your new entries.
    I hope this helps those that, like me, battled a bit with the use of these BADI's.

  • How to provide space and new line to the text in AI Script

    how to provide space and new line to the text in AI Script

    ?? can you explain better, can you at least add another sentence?
    space
    var mySpace = " ";
    new line
    var newLine = "\n";

  • File sender  - carriage return and new line as endseparator

    Hi All,
    I'm stumbled with a problem to set carriage return and newline character as the endseparator (record delimiter)
    Scenario: The input file PI is receiving has got few fields which has text in it and the content in this text has got newline characters. So to identify record separator, at  the end of each record the combination of carriage return and new line is added.
    In file sender content conversion I've set the folllowing parameters to achieve this:
    Row.fieldSeparator :   ,  (comma)
    Row.endSeparator  :  '0x0D''0x0A'
    Problem: In my sample input file, the first row has a text field with a newline character. When executed PI is splitting the record at the newline character in the text field (instead of combination of carriagereturn and newline which is set in the endSeparator paramter).
    Pls advice on how to resolve this .
    Happy Holidays!!
    amar

    Rajesh..Thanks for your quick response
    I'm trying with the actual file being provided by the trading partner. I did not generate the file nor changed the file..
    Before identifying the combination of carraige return and new line, the adapter is splitting the record when encountered with new line character within one of the text fields.
    As you said it worked for you, you do have new line characters within fields in a record?..pls throw some light..let me know for any information..
    Thank you
    amar--

  • My firefox keeps opening new tabs and new windows, takes me to infected wedsites that my norton tells me. What can I do?

    Tabs and new windows keep opening. My norton tells me that I am accessing known infected websites.How can I fix this.
    Thank you

    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/viruses/disinfection/5350 Anti-Rootkit Utility - TDSSKiller]
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://general-changelog-team.fr/en/downloads/viewdownload/20-outils-de-xplode/2-adwcleaner AdwCleaner] (for more info, see this [http://www.bleepingcomputer.com/download/adwcleaner/ alternate AdwCleaner download page])
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Also, if this has been happening since you downloaded Firefox, and you did not download Firefox from the Mozilla website, please uninstall Firefox and download a new copy at:
    * https://www.mozilla.org/en-US/firefox/new/
    Or if you need a different localization:
    * https://www.mozilla.org/en-US/firefox/all/
    Did this fix your problems? Please report back to us!

  • CRMD_ORDER Item Details TAB one of line item setting date as 12/31/1899

    Hi Experts,
    We have 3 line item for order, we call it as main line, return line and replacement line item. When we select Return line item and go to Dates Tab it shows all the dates related to that.  Here Depot send the date via XML File and it is getting set as "Depot Received Date", But when some orders get cancelled as depot dosent received that order they send blank date in XML File, but it save the date as "12/31/1899 16:00" . I am not able to get how it is getting set.
    Please help me regarding this, Where should i check for this?
    Regards,
    Poonam

    Hi,
    This is unfortunately not possible with standards but you may try using Badi ME_PROCESS_PO_CUST => PROCESS_ACCOUNT.
    Regards

  • Tabs and following line indentions ?

    So if I tab the first line of a paragraph, in order to have the following lines of text align directly with the first line, I must select each paragraph, remove the tab and create an indent? Is there not a global setting I can select that says, "if the first line is tabbed then the following text will align with the first line text after tab?"
    Example:
    [TAB] 001. My first line is here and this
    second line represents the continuance
    of a paragraph as does this third line just
    to give an example of what I do not want.
    There is no left alignement of the following
    text lines to the tabbed first line.
    What I really want is:
    [-TAB-] 001. This is how I would like for the following
    [space] text to appear after a tab is inserted. The word
    [space] tab and space in brackets are acting as a
    [space] visual to indicate the alignment I want. Is there
    [space] not a global setting that does this?
    If you have followed me to this point, thanks for sticking with me. I know I can set a style and create the indent, but this means I will have to manually set over one hundered paragraphs to that style. It's not hard just time consuming.
    Thanks in advance!!

    Computers are not typewriters (which have no way to specify an indent other than hitting the tab key) and professional type is set without leading tabs, except for special cases using tabular type data where a particular row might be missing the first entry or the tab is required for special alignment (center aligned or decimal aligned, for example).
    This is not as big a deal as you make it out to be. Define the paragraph style you need with the correct indents and do a GREP search for ^\t(.) and change to $1 and set the change formatting to your new paragraph style. This expression looks for a tab character at the start of a paragraph and any character that follows it, then replaces the tab and following character with just the following character (essentially deleting the tab), and assigns the style of your choice inthe format options.

  • PHP MYSQL and DW Question: Invalid characters and new lines entry/viewing

    Hello all,
    I have followed David Powers' two php/dw/mysql books and I've
    set up PHP
    pages that insert, edit, delete, etc. listings. Everything
    works fine
    except for invalid characters being inserted into the
    database, and then
    displaying with a question mark in firefox.
    Is there a trick to cleaning up the data that a user may
    paste into a
    textbox on a web page for insertion in the database before
    the data is
    inserted or as it is inserted? Em dashes, en dashes, 'curly
    quotes' etc.
    are giving me problems.
    Also, when I enter new lines into the php page while I'm
    typing out
    information for a record, these new lines are not being
    displayed either
    in the database (using phpmyadmin to view) or on the
    resulting details
    pages, even though I'm using nl2br, etc. Is there a way to
    make this
    work reliably?
    Thank you for any help you may give me!
    -John

    Hello all,
    I have followed David Powers' two php/dw/mysql books and I've
    set up PHP
    pages that insert, edit, delete, etc. listings. Everything
    works fine
    except for invalid characters being inserted into the
    database, and then
    displaying with a question mark in firefox.
    Is there a trick to cleaning up the data that a user may
    paste into a
    textbox on a web page for insertion in the database before
    the data is
    inserted or as it is inserted? Em dashes, en dashes, 'curly
    quotes' etc.
    are giving me problems.
    Also, when I enter new lines into the php page while I'm
    typing out
    information for a record, these new lines are not being
    displayed either
    in the database (using phpmyadmin to view) or on the
    resulting details
    pages, even though I'm using nl2br, etc. Is there a way to
    make this
    work reliably?
    Thank you for any help you may give me!
    -John

  • Tab and next line characters in text area

    Hi,
    I have an issue with the textarea. The page is inserting /t and /n in the text I type in and everytime I save.
    I defined a text area like following in my jsp:
                   <textarea class="textarea_value" name="explanation" rows="5" cols="100">
                   <bean:write name="tiptrackerEditForm" property="explanation"/>
                   </textarea>
    css:
         .textarea_value {
              font-weight: normal;
              font-size: 12px;
         text-align: left;
         wrap: soft;
    When I type in a word in textarea, it saves without any /t or /n. But when retreive the data and load it into the form again, the page shows with an inserted tab (the word is moved to the right after inserting a tab). Everytime I save, it inserts a tab and /n characters. I know for the fact that the database or the form is doing this. It's in the jsp.

    Put the whole <textarea> element in a single HTML line without newlines and spaces.
    Thus, so:<textarea class="textarea_value" name="explanation" rows="5" cols="100"><bean:write name="tiptrackerEditForm" property="explanation"/></textarea>

  • Problem with CDATA and new line character

    I parse a xml document with org.w3c.dom, the document contain a CDATA section in which there are more lines of text, each line is terminated with the new line character (\n).
    Example:
    <nota>
    <[CDATA[
    first line
    second line
    third line
    ]]>
    </nota>
    When a parse this node:
    Text txt_nota=(Text)elm_nota.getFirstChild();
    String nota=txt_nota.getData();
    the value returned is one string with no new line characters, example:
    "first linesecond linethird line"
    what's wrong?

    Because i use the string nota into a jsp page and i print the string nota into a textarea and the text is with no newline, example:
    <textarea name="nota" rows="4" cols="60"><%= nota %></textarea>
    the text into textarea is:
    first linesecond linethird line
    but i want that the text displayed into textarea is equal the text into the CDATA section:
    first line
    second line
    third line

  • Enter Text in Multi Line TextBox and New Lines

    Hi Guys,
    I have a form that takes a users input and saves to an access
    database.
    The data is in turn drawn by a recordset and displayed on an
    ASP page using VBS.
    The form that takes the info has 1 textbox thats multi line
    and I want it to be a simple input box except when the user adds a
    line break by hitting return I want this to be reflected when the
    record is drawn to the detais page..
    Just now no matter how many times I hit return key when
    typing in the multi line text box and add paragraphs or simple
    sentances they all come out with no line breaks on the page when
    shown???
    Do I have to make my own rich text box editor? or is there
    something Im missing?
    Thanks in advance for any thoughts.
    Tag

    Tag2007 wrote:
    > Thanks Im on the site now and dont see the lite
    version?? Do you have a link to it please..
    InterAKT was acquired by Adobe in September and most of its
    products
    were discontinued. The full version of KTML is now part of
    the
    Kollection suite.
    The solution to your problem is very simple, though. I'm
    sorry I can't
    give you the exact coding, because I haven't used ASP for
    many years.
    However, all that you need to do is to create a function that
    searches a
    string for new line characters and replaces them with
    <br> (or <br />
    for XHTML).
    PHP has a built-in function (nl2br()) to do this, but in ASP
    you need to
    search for the new line character code.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Exporting string to csv keeping commas and new lines

    Hi there,
    I am exporting string to csv and have been removeing new lines and commas like so
    thing.toString().replace(/\n/g, '').replace(',','') ;
    how can I do this iwthout losing the line breaks and commas? I can't have them in atm because messes up the csv.

    JSON is for 'transfering' information that can be reassembled into number, string, array, object, etc. format afterwards.
    Excel can import CSV but it might not understand the complexity of the information. Tyically what you would do is serialize complex information with JSON, recieve it on the other side (wherever that might be) and then deserialize it. After you deserialize it using JSONs abilities to turn your information back into what is was (numbers, strings, arrays and object) it is up to you how you restructure the data for the format you choose.
    Your original intent of preserving CSV is best for Excel or OpenOffice Calc. You didn't mention your intent. JSON would package those (CRLF) \n's for you.

  • Put new tabs on new line

    hi,
    i have a question on tabs. i have a lot of tabs within my application. htmldb displays them all on one line so my app stretches to the right. is it possible to display couple of tabs on one line and then break to a new line to display more tabs? i know i could use the 2 level tab feature but that's really grouping tabs together and none of my tabs has anything to do with each other. thanks
    jim

    This will be possible with some configuration of templates and CSS.
    I presume when you say that the 2 level tabs "is really grouping tabs together" you are saying that they have different styles?
    If so, I'd possibly use a 2 level tab layout and change the styles for the 2nd level of tabs. This would be slightly less work.
    Regards
    Ben

  • 500k profile after disruption and new line install...

    Hello,
    Status: 
    I have an open fault logged with BT;  
    Phone line ok but broadband speed low, profile appears stuck at 500k.
    History: sporadic BBand connection and noisy phone line followed by outright failure of both.
    Engineers visited and confirmed line between street and master socket probably corroded - they put it on leg+leg to get it working while we waited for a new physical line to be installed.
    Pavement was dug up, new armoured cable run from street to house, and a proper master socket fitted (NT5 ? but no inbuilt ADSL filter).
    In effort to ensure low noise, ALL other sockets in the property disconnected.
    Digital phone (3 handsets off a single powered base) are run off the master socket using a filter.
    Router is business hub - 2700hgv; f/w 6.1.1.48.1-enh.tm ,  h/w 2701-100589-005 .
    Hub is connected to same master socket as phone (as it's the only socket now connected to the new line).
    New line was installed approx 18 days ago.
    Speed tests (speedtest.net) repeatedly show download of 480kbps, upload around 620kbps.
    No change since new line was installed and all but the master socket decomissioned.
    I use wireless to the router but also repeated tests with a Cat6 copper RJ45 cable and got same results.
    Have taken all wireless devices offline and removed electrical items near phone line power supply and cable path to reduce potential noise and repeated tests.
    I left the router on for two weeks and no increase in broadband speed.
    I rebooted it twice this weekend to see whether it picked up a different profile - but no change.
    BT speedtester repeatedly indicates a profile of 500k (full results further down).
    Last year I had speeds about 512k on a DrayTek router before switching to the 2700HGV. The change to the BT hub upped the download speed to around 1Mbps, which made a huge difference.
    I know I am "a long way from the exchange" but I've had 1Mbps last year and now have a new line into my property, so not much left that I can do to improve the situation.
    I'd like to know what can be done to get me at least 1Mb download again.
    I have an engineer visit due tomorrow but I believe that will be purely to finish putting paving slabs back over the armoured cable that's been installed (i.e. OpenReach dig team rather than line engineers).
    After those slabs are done, I expect the fault will be closed but I'll still have a 500k profile and will need to raise a new fault all over again - that fault was opened 5 weeks ago.
    Results of speedtester.bt.com run just now (1pm Sun 13th March 2011):
    Download speed achieved during the test was - 363 Kbps
     For your connection, the acceptable range of speeds is 100-500 Kbps.
     Additional Information:
     Your DSL Connection Rate :576 Kbps(DOWN-STREAM), 777 Kbps(UP-STREAM)
     IP Profile for your line is - 500 Kbps
    The throughput of Best Efforts (BE) classes achieved during the test is - 2.46:14.86:82.95 (SBE:NBEBE)
    Upload speed achieved during the test was - 638 Kbps
     Additional Information:
     Upstream Rate IP profile on your line is - 777 Kbps
    Router web interface shows:
    Rate:
    576 kbs
    778 kbs
    Max Rate:
    2621 kbs
    784 kbs
    Noise Margin:
    16.7 dB
    7.0 dB
    Attenuation:
    62.8 dB
    35.8 dB
    Output Power:
    16.1 dBm
    12.4 dBm
    Protocol:
    G.DMT2 Annex A
    Channel:
    Interleaved
    DSLAM Vendor Information
    Country: {46336} Vendor: {IFTN} Specific: {48753 }
    ATM PVC:
    0/38
    Rate Cap:
    2621 kbs
    Attenuation @ 300kHz:
    62.8 dB
    Uncanceled Echo:
    -14.8 dB
    Ok
    VCXO Frequency Offset:
    -2.0 ppm
    Ok
    Final Receive Gain:
    34.5 dB
    Ok
    Impulse Noise Comp. Tones:
    0
    Ok
    Excessive Impulse Noise:
    0
    Ok
    I hope that's the information that someone might need to help me at least get 1Mbps back on my line.
    Regards,
    BK

    Hi Bk1
    Welcome to the Community.
    Send me an email to the link in the about me section of my profile.
    I can have this looked into for you further.
    Cheers
    Stuart
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

Maybe you are looking for

  • P6 R8.2 Team Menber

    Guys, I tried to connect to localhost as well as, using IP address. Unfortunately I cannot login due to some error as shown below: I checked all the servers, I was wondering that State is "RUNNING" but I cannot coonect. Can anybody suggest what's the

  • How do I fax to pc 4500 series?

    How do I fax to my pc?

  • Finder crashing, can not be re-opened, unable to restart or shut down.

    I've experienced this a few times in the past two days. The Finder crashes and cannot be re-opened. Attempting to re-launch it bring the error: "The application Finder.app can't be opened. -10810" Each time this occurred it was while trying to connec

  • Adobe Media Crashes for Panasonic MXF HD Files

    I have been using Premiere Pro CS4 (ver 4.2.1) for several years on both a Win XP and recently on a Win 7 OS machine with good results for SD video. Recently I tried to encode some Panasonic P2 MXF 720P/60P HD video on the timeline to MPEG2 using the

  • MRP run in the background  ?

    Hi, I want to know how to run the MRP for the plant in the background ? thanks, elanchi.