Does trim replace some characters with control code versions in xml?

I am using trim to remove extra white space and linefeeds from xml files and it works fine except that occasionally it replaces xml close element symbols (>) with the control code > used to delineate a > symbol that is not to be interpreted as as the xml character. What gives here? I thought all trim did was eliminate leading and trailing characters whose code was greater than '\u0020'.
I am using Java 1.5 but this happened with 1.4 as well.

Yes,
                         <md.decideddate>20060612</md.decideddate>
apparently has the final '>' replaced by &gt.
This does not happen consistently and can only be seen when loaded to IE. The Framework that I am working with in Websphere sees the error but neither XMLSpy or Eclipse has a problem with the file.
Here's what I get when I load the file to IE:\
An invalid character was found in text content. Error processing resource 'file:///C:/Projects/Rex/testdata/input/content/R...
<md.dates><md.filedate>May 26, 2006</md.filedate><md.decideddate>20060526</md.decideddate&g...
I find this very strange.

Similar Messages

  • How to replace special characters with html code characters automatically?

    A colleague and I work on these html pages. They eventually end up as emails, but we have the cold fusion server to pre process them. One thing we are trying to do is eliminate problems caused by unencoded copyright, trademark and smart quote symbols.
    How could I create an array of find / replace commands in the header so it processes the HTML with correct character codes.
    I"m not cold fusion aware, so any kind of starter info would be great. Eventually I might add more replacements to the array.
    As an example TM (font character) would process to &trade; and a smart quote or apostrophe would process to a straight one. an en dash character would become &ndash;
    Because we copy paste from places, this often happens and it seems like cold fusion could solve the problem quickly and repeatedly all at once.
    thanks for any help
    -smick

    CF has a built in HTMLEditFormat function for handling <  &  > characters.  For handling trademark and smart quote characters you might try searching for a user defined function at http://cflib.org or writing a user defined function yourself that will handle the specific characters needed in your application.

  • Saving characters with ASCII codes (128 - 256) into txt file problem

    Hello,
    I am saving a query results into a text file (test.txt) with this procedure:
    BEGIN
    OWA_UTIL.mime_header ('application/octet', FALSE);
    HTP.p ('Content-Disposition: attachment; filename="TEST.TXT"');
    OWA_UTIL.http_header_close;
    for rec in (select sample_text from tmp)
    loop
    htp.prn ( chr(230) || rec.sample_text || utl_tcp.crlf);
    end loop;
    -- Send an error code so that the rest of the HTML does not render
    HTMLDB_APPLICATION.g_unrecoverable_error := TRUE;
    END;
    How can I save characters with ascii codes from 128 - 256 into the output file? If I use chr() function, characters are missing in the output file.
    Platform: Apex 4.2 on apex.oracle.com

    Hi 1010398,
    Some thoughts:
    I assume you've counted the characters in the output and/or used a "hex" text editor so you KNOW these characters are not being written. Are they not written at all, or are blanks being substituted or are NULLs being substituted?
    I couldn't find much documentation on htp.prn. Though, one place I found
    htp.prn (cbuf IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL);Do you suppose it's affected by the character set used?
    Howard

  • My one year warranty expired recently, a month ago my charger was replaced under warranty and it has only lasted a month and has broken again, does the replacement charger come with a new warranty or will i have to buy a new one?

    Bought the phone on contract last January (late in january), had my charger replaced just after christmas and now it has stopped working again, its been about a month and a half and the replacement charger is broken, does the replacement charger come with a new warranty or will I have to buy a new charger? And if so, is there a charger that doesn't break easily (my problem is the the wire at the phone end of the cable seems to bunch and twist etc.)
    thanks.

    a warranty replacement if the donor is out of warranty has a new 90 days warranty from exchange date 

  • Just want to replace some video with photos, but LEAVE AUDIO THERE. No way?

    Is there no simple way to just replace some video with other video or photos, but not affect audio? I have an interview, and they're talking about places, and I want to put in photos of the places. Pretty basic stuff.
    Thanks for whatever help...

    OK, yeah, CUTAWAY. But, I have the audio "purpled". Should it be? And my photo is sitting ABOVE the place where I want it. How do I get it to go down where it's supposed to? I really need a step-by-step here. I see how to manage the duration of the cutaway, but I don't see how to actually get it INTO the track, and how to "un-purple" the audio track.
    Thank you!

  • How do i replace an asset with a newer version?

    let's say i have an asset which is a Photoshop file, filename "v1". i want to replace the asset with a newer version of the Photoshop file, filename "v2".
    how do i replace the "v1" asset with the "v2" asset, so that all instances of "v1" in the project are changed to "v2"?
    thank you.
    rev B 20" iMac G5   Mac OS X (10.4.2)  

    let's say i have an asset which is a Photoshop file,
    filename "v1". i want to replace the asset with a
    newer version of the Photoshop file, filename "v2".
    how do i replace the "v1" asset with the "v2" asset,
    so that all instances of "v1" in the project are
    changed to "v2"?
    thank you.
    rev B 20"
    iMac G5 Mac OS X (10.4.2)
    I usually just write over the file with the same file name, often with DVDSP closed.
    If you're doing an m2v file and the duration has changed, just go the the end of the clip in the track and drag it right as far as you can. Otherwise it'll replace the asset but use the previous version's duration.
    G5 Dual 2GHz   Mac OS X (10.4.4)  

  • Replace ipad mini with a newer version

    I got my 2nd ipad mini replacement from apple service center here in the Philippines last January 31, 2014. Technically this is my 3rd ipad mini (from the 1st that i bought to the 1st and 2nd replacement). After two weeks of use i noticed that it has also the same defects as with my 1st ipad mini replacement. (What is the odd of having 3 defective ipad minis?!) Apple service center here replace defective ipad mini with brand new one instead of repairing the product if and only if the defects is caused by hardware problems. I am planning to take this back to apple service center. My question is, is it possible to replace my ipad mini with the newer version? (i am very sure that they will still replace this with a new one.) Their price difference is just about Php5,000. I can just add for their price difference.

    let's say i have an asset which is a Photoshop file,
    filename "v1". i want to replace the asset with a
    newer version of the Photoshop file, filename "v2".
    how do i replace the "v1" asset with the "v2" asset,
    so that all instances of "v1" in the project are
    changed to "v2"?
    thank you.
    rev B 20"
    iMac G5 Mac OS X (10.4.2)
    I usually just write over the file with the same file name, often with DVDSP closed.
    If you're doing an m2v file and the duration has changed, just go the the end of the clip in the track and drag it right as far as you can. Otherwise it'll replace the asset but use the previous version's duration.
    G5 Dual 2GHz   Mac OS X (10.4.4)  

  • I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding"

    I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding", so I have to force it to close. By the way, the SAVE botton stays the same even I change erverything in my document. Please, a have a work to finish, **** me. What I can do abou it?

    I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding", so I have to force it to close. By the way, the SAVE botton stays the same even I change erverything in my document. Please, a have a work to finish, **** me. What I can do abou it?

  • Hi support please help me to sync my ipod and iphone 5 . Since i have installed new itunes version 12 , i am not able to sync to transfer data to my devices through itunes.  I think there is some issue with tunes new version .kindly support ASAP.  Ra

    Hi support please help me to sync my ipod and iphone 5 . Since i have installed new itunes version 12 , i am not able to sync to transfer data to my devices through itunes.
    I think there is some issue with tunes new version .kindly support ASAP.
    Rachna khanna
    [email protected]

    you might need to buy a new cable from the apple store.

  • Some component with an unsupported version is trying to use NI Spy

    This problem is intermittent. In GPIB Configuration, Network settings, when I select the IP address of GPIB ENET/100, I get this NI Spy message: Some component with an unsupported version is trying to use NI Spy. Please contact National Instruments for an update. Do I need to update the firmware of GPIB/ENET100? The current version is B.9.

    Hello,
    Try uninstalling 488.2 driver, then uninstall MAX and then reinstall the 2.1 version for 488.2 from CurrentGPIB driver versions. Also make sure you are the administrator while you uninstall and reinstall.
    I have not seen this problem happen before so I hope uninstalling and reinstalling helps solve this problem.
    Please feel free to email me back incase you have further questions.
    Good luck and have a great day!
    Koninika
    National Instruments

  • My company software has some incompatibility with newer Firefox versions. They require me to downgrade to version 8. Where can I find the installer for v8?

    My company software has some incompatibility with newer Firefox versions. They require me to downgrade to version 8. Where can I find the installer for v8?

    Hi, sboyack
    '''Firefox (v8) - Windows -'''
    http://fileforum.betanews.com/download/Mozilla-Firefox_v8-for-Windows/1032985422/30
    '''Firefoc (v8) - Mac OS X -'''
    http://fileforum.betanews.com/download/Mozilla-Firefox_v8-for-Mac-OS-X/1032985422/29
    Sincerly,
    Michael
    '''''Follow these links at your own risk'''''

  • NSMutableString getCString misbehaves, does not show some characters

    Hi everyone,
    This is my first time here.
    I have written a small tool for Cocoa / MacOSX 10.5 and I am trying to save a text to a file, but some characters such as # appear as hex 0x0.
    Source: -----
    int len = [results length] * sizeof(char);
    char *buffer = malloc(len);
    [results getCString: buffer maxLength: len-1 encoding: NSWindowsCP1250StringEncoding];
    NSData *dt = [NSData dataWithBytes: buffer length: len];
    [fileManager createFileAtPath: @"/Volumes/MacBackup/results.sh" contents: dt attributes:nil];
    The # and the final 2-3 characters appear as 0x0 in a hex viewer. I have tried almost all encodings, but to no avail. Can anyone tell me how to make it work? Do I have to enter the # directly in the char buffer as ASCII char or am I missing something about the encoder?
    Btw, I am a newb at Mac programming, but I come from a solid Windows programming background, but please don't hold that against me :P.
    Message was edited by: TTDeath
    Message was edited by: TTDeath

    Hi TT, and welcome to the Dev Forum!
    TTDeath wrote:
    I have written a small tool for Cocoa / MacOSX 10.5 and I am trying to save a text to a file, but some characters such as # appear as hex 0x0.
    int len = [results length] * sizeof(char); // <-- need to add one here
    char *buffer = malloc(len);
    The NSString length method doesn't count a terminator; i.e. it's analogous to strlen(), so if you convert an ASCII C string to a NSString object, the return from [results length] will be the same as strlen(source). I'm not sure there wasn't something else going on at your end, since this length error only strips the trailing char from the source string. In any case, the following code should work for you:
    // made from MAC OS X->Command Line Utility->Foundation Tool template
    #import <Foundation/Foundation.h>
    int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    // insert code here...
    NSLog(@"Hello, World!");
    NSString *results = @"A string with # embedded
    int len = [results length] * sizeof(char) + 1; // <--
    char *buffer = malloc(len);
    BOOL bError = [results getCString: buffer
    maxLength: len encoding: NSWindowsCP1250StringEncoding];
    NSLog(@"getCString returns %d", bError);
    NSData *dt = [NSData dataWithBytes: buffer length: len];
    NSLog(@"dt=%@", dt);
    NSFileManager *fileManager = [NSFileManager defaultManager];
    // I don't recommend testing in a system directory -
    // remember to substitute your home dir name here:
    bError = [fileManager createFileAtPath: @"/Users/Ray/results.sh"
    contents: dt attributes:nil];
    NSLog(@"createFileAtPath returns %d", bError);
    [pool drain];
    return 0;
    // [Session started at 2009-12-05 16:47:41 -0800.]
    // 2009-12-05 16:47:41.045 TT[463:10b] Hello, World!
    // 2009-12-05 16:47:41.048 TT[463:10b] getCString returns 1
    // 2009-12-05 16:47:41.049 TT[463:10b] dt=<41207374 72696e67
    // 20776974 68202320 656d6265 64646564 0a00>
    // 2009-12-05 16:47:41.054 TT[463:10b] createFileAtPath returns 1
    // rays-imac:~ Ray$ cat results.sh
    // A string with # embedded
    - Ray

  • [SOLVED] What exactly does gcc's -Os do with the code?

    Hey all,
    The application that sets my statusbar in DWM, written in C, recently starting segfaulting after I changed the code (commit). I initially traced it down to being that I specify -Os to gcc in the Makefile (without that, it runs fine) and then I traced it to the perc variable in get_battery. If I stop sprintf'ing that into buf, it also doesn't segfault.
    This made me start digging through the gcc documentation and now I'm stuck with two questions:
    1. What does -Os do exactly with my code? I.e., does it only reduce the size of the binary (how?) or does it also do some optimization as -O1/2/3?
    2. Is another optimizer (-O3) "better" than -Os? The code runs fine with this, for example.
    Thanks in advance for your insights!
    Last edited by Unia (2013-10-12 20:35:05)

    @Karol: yes, I read that, but it doesn't really clarify (to me at least) what it does with the code or why this could cause a segfault.
    @Hiciu: Here is the output:
    Starting program: /home/jente/projecten/dwmst/./dwmst
    warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
    warning: Could not load shared library symbols for linux-vdso.so.1.
    Do you need "set solib-search-path" or "set sysroot"?
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/usr/lib/libthread_db.so.1".
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff75c2320 in XChangeProperty () from /usr/lib/libX11.so.6
    (gdb) bt
    #0 0x00007ffff75c2320 in XChangeProperty () from /usr/lib/libX11.so.6
    #1 0x00007ffff75df584 in XStoreName () from /usr/lib/libX11.so.6
    #2 0x000000000040133b in ?? ()
    #3 0x00007ffff6658bc5 in __libc_start_main () from /usr/lib/libc.so.6
    #4 0x00000000004013a5 in ?? ()
    (gdb) print perc
    No symbol table is loaded. Use the "file" command.
    It doesn't seem to be segfaulting with perc, but rather in my call to XStoreName... strange. Especially strange because before I restructured my code, it never segfaulted with -Os. I will double check my commit to see if I changed something...
    @Trilby: Indeed I think it's there from when I forked this from you - at least, I don't remember adding it myself. I'm also questioning now why one would have that, if it doesn't optimize the program anyway.
    @jdarnold: Yes, I compile my code with both -Wall and -Wextra. Here are all the options I pass to gcc in the Makefile:
    CFLAGS = -Os -pedantic -Wall -Wextra -Wno-format-zero-length
    Those -Wno-format-zero-length I added just to supress warnings about sprintf'ing an empty string into buf, when for example I have no music player running.
    I guess I will just remove -Os, but I'm still curious as to why it is causing a segfault.

  • Some errors with the code

    hello all!
    i am trying to write simple code but have some errors.
    DECLARE
    id NUMBER;
    BEGIN
    id:=SELECT id from technician where salary=(select MIN(salary) from technician);
    DBMS_OUTPUT.put_line(id);
    END;

    Your simple program becomes complex! As pointed out, it will blow up if your query returns more than one row. If you're just doodling with your code, you can add "and rownum=1" to your where clause. That will prevent the "too many rows returned" exception. Of course, it is basically randomly picking one of several values in the DB, so it's not good for production code.
    For real code, there are at least two common options:
    (1) Use your select to create a cursor, which lets you loop through each matching row. Good when multiple rows are normal and you really want to use them all.
    (2) Create an integer variable, such as row_count. Select count(*) into row_count ... from technician t where salary....
    If row_count = 1 then use the assignment you were going to do. Otherwise, stop processing and log an error (too many or too few rows returned...).
    This is good when you expect EXACTLY one technician to have that salary, and anything else is an error.
    Andy

  • Does Apple replace an iPhone With after damage at a discounted price?

    Does Apple replace an iPhone 5 with water damage at a discounted price?

    Apple will give you a replacement at a discounted price from the full retail price of the iPhone whether or not you have AppleCare. If you have AppleCare+ coverage, you will pay only the "deductible"; check the terms for your plan. If you do not have AppleCare+ on your iPhone, see:
    http://www.apple.com/support/iphone/repair/
    Regards.

Maybe you are looking for