Jdeveloper 10.1.3: JAXB - how to preserve whitespace in text element??

Dear all,
i am trying to use jaxb to do the xml <> java object conversion.
i meet a problem that the jaxb seems don't preserve the white space when xml to
java conversion (but java to xml is ok, the whitespace is preserved.)
for example:
an element with string type: <Address> with leading and trailing spaces </Address>,
in java code, obj.getAddress() return "with leading and trailing spaces", the spaces
are trimmed..
is there any configuration to make?
how can i preserve the whitespaces?
thank you
ping

Hi, Branislav,
That's great! It works!
I choose to use the first method. I have two project modules, both use the same data model. I opened the data model project's properties editor, highlighted the business components node, and the the Connection dropdown list is right there.
Thank you very much! You are always very helpful!
Newman

Similar Messages

  • Preserving whitespace in Run element

    When formatting a paragraph as so -
    <RichTextBlock><Paragraph xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>
    <Run></Run>
    <InlineUIContainer><TextBlock >Words here</TextBlock></InlineUIContainer>
    <Run xml:space="preserve"> </Run>
    <InlineUIContainer><TextBlock>More words here</TextBlock></InlineUIContainer>
    <Run xml:space="preserve"> Lastly some words here</Run>
    </Paragraph>
    </RichTextBlock>
    The <Run> element containing a single space is never displayed and ignore the space=preserve property. However the last run with a leading space is displayed correctly.
    How can I get a run containing a single space to display ?

    Hi BradStevenson,
    You can see the whitespace working principle in XAML from
    http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh758290.aspx.
    As we can see, “A space immediately following the start tag is deleted.”
    it should be removed by the system. But when we add whitespace before other characters, I think it is used as a string, because “If the type of the property is Object, then the inner text is parsed as a single String. If there are intervening element
    tags, this results in a XAML parser error, because the Object type implies a single object (String or otherwise).” When whitespace in inner text. You can find these explanation from the above link.
    So if you want to preserve the whitespace, use whitespace in string and make the system considering it as inner text.
    Feel free to let me know if you have any concerns.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • Preserve whitespace in XML element value

    I am trying to add XML element with value prefix with white space:
      ex_doc->create_simple_element(
          name = 'VALUEPART1'
          value = '          BQ/XWKB-99-5-9999-2'
          parent = lo_ele_e1bpparex_bape_vbak ).
    But when the XML is create, the white space is removed! How can I preserve the white space???
    <VALUEPART1>BQ/XWKB-99-5-9999-2</VALUEPART1>
    What i want is:
    <VALUEPART1>          BQ/XWKB-99-5-9999-2</VALUEPART1>
    Appreciate for any help

    Hi,
    if you had been using XSLT instead, I would have said 'remove the strip-space element or alter it according to your needs'...
    Please provide what class you are using, else it's too generic..
    regards, Lukas

  • Oracle XSLT Transformation not preserving space in text element

    If we have a BPEL process which is calling a XSLT transformation contains the code similar as below:
    for Populating an element with white space only
    <tns:TargetField>
    <xsl:text disable-output-escaping="yes"> </xsl:text> <!--Note the whitespace , also tried with disable-output-escaping =”no” -->
    </tns: TargetField>
    Our expected result / output would be:
    <tns:TargetField> </tns: TargetField> <!--Note the whitespace -->
    But, we get:
    <tns:TargetField/>
    Oracle XSLT is ignoring the white space even if we try with preserve space in XSD, or in XSLT this is not producing the expected output.
    This looks a BUG with Oracle XSLT Transformation .
    For a workaround solution we can use below XSLT snippet:
    *<tns:TargetField>*
    *<xsl:value-of select="string(' ')"/> <!--Note the whitespace -->*
    *</tns:TargetField>*
    This is returning Output:
    *<tns:TargetField> </tns:TargetField> <!--Note the whitespace -->*
    Any other work around do you find?
    Edited by: panks on Jul 29, 2011 12:37 PM

    The workaround only works with one white space, if one put more white spaces, it do not work.
    <tns:TargetField>
    <xsl:value-of select="string(' ')"/> <!--Note the whitespaces -->
    </tns:TargetField>
    This is returning Output:
    <tns:TargetField> </tns:TargetField> <!--Note the only one whitespace -->
    Edited by: user10697506 on Aug 10, 2011 3:27 PM

  • How do I Hide the text printed from a standard Text Element in SAP Script?

    Hi,
    I have created one SAP Script which gets printed from IW33 using a standard print program.
    In config the standrad SAP script is replaced by the zsap script.
    Since the Zscript is printed from a Standard print program, I had to keep all the text elements used by the original(standard) SAP script.
    I only kept the text elemets and commented out the printing part.
    But still some values are printing. How do I hide these text element values?
    I want to delete whatever its printing from these text element. Icant delete the standard text elemetns , otherwise the standard print program will give error.

    Hi,
    I am not printing any text under these text element in my zscript.
    I had to include these standard text elemets as they are called from the standard print program using which my zscript is getting printed.
    for example:
    /E OPERATION
    Under operation i didnot print anything. Still some values which are passed in text element Operation by the print program is being printed in the form. i want to hide/delete these values.
    how do I do that?

  • How can I set the width of a Text element?

    Hello! I have created a custom button with this class:
    import javafx.scene.Node;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.Cursor;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.LinearGradient;
    import javafx.scene.paint.Stop;
    import javafx.scene.effect.DropShadow;
    import javafx.scene.text.Text;
    import javafx.scene.input.MouseEvent;
    public class Button extends CustomNode {
        public var text: String;
        public var x: Integer = 0;
        public var y: Integer = 0;
        public var width: Integer = 90;
        var height: Integer = 25;
        override public function create(): Node {
            return Group {
                content: [
                    Rectangle {
                        cursor: Cursor.HAND;
                        x: this.x;
                        y: this.y
                        width: this.width;
                        height: this.height;
                        arcWidth: 15;
                        arcHeight: 15;
                        effect: DropShadow {radius: 6};
                        fill: LinearGradient {
                            startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                            stops: [
                                Stop {offset: 0.0, color: Color.WHITE}
                                Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMouseEntered: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.2, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMouseExited: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMousePressed: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.LIGHTGRAY}
                                    Stop {offset: 1.0, color: Color.WHITE}
                        onMouseReleased: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                    Text {
                        x: this.x + 5, y: this.y + 16
                        content: this.text
    }But, how can I set the Text element centered into the button?

    Stack {
                        layoutInfo: LayoutInfo {
                            width: bind width;
                            height: bind height;
                        content: [Rectangle {
                                width: bind width, height: bind height
                                //fill: bind color;
                                fill: Color.GREEN
                                arcHeight: 20; arcWidth: 20;
                            Text {
                                font: Font {
                                    size: 24
                                textAlignment: TextAlignment.CENTER;
                                wrappingWidth: width;
                                boundsType: TextBoundsType.VISUAL;
                                fill: Color.WHITE;
                                content: bind text;
                    }wrappingWidth: Sets the maximun width of the text
    boundsType: If you put the wrappingWidth var and you want to center a text you MUST set this var to VISUAL

  • How to prevent JaxB creation of 2 Interfaces for each Element?

    hi,
    does any body know how to prevent JaxB creation of 2 Interfaces for each Element (The Content Interface and the element interface)?
    I want to configure JaxB to use only one Interface and only one implementation Class.
    Thank's,

    I am sorry I can not answer your question, I have got the same problem. Could you please email me to
    [email protected] when you know the answer, please.
    I have a question for you. When and complex type is validated, I get the object which contains the error. ( or objects ).
    However. How do know the position in the actual parent object. basically. Is there a way to know exactly the position of that attribute in that object. I need to store errors strings.
    The first problem derives from this one:
    It is not possible to execute validate function for a primitive attribute inside an structure.
    I would appreciate your help.
    Thanks.
    Gustavo.

  • How To Preserve Spaces in Oracle Soa

    Good afternoon !
    I have a problem , I'm trying to do an UPDATE on a column in a particular table from my database . However , this column is of type CHAR ( 13 ) , and as I try to perform the UPDATE , it returns me an error stating that the Primary Key is already being used ..
    Well , I think I found the problem .
    The fact of the column is CHAR ( 13 ) , in the database my ID has 5 numbers , eg ( 12345 ) , but to be a char field it gets stored as ( 12345 ) to complete the 13 characters of CHAR , 5 + numbers 8 spaces.
    The solution is to pass , when the UPDATE , the id ( 12345 ) with spaces , but how can I preserve the spaces without the act of UPDATE spaces are automatically removed ?
    I tried using the tag <whiteSpace value="preserve"/> but did not work ..
    Follow my code below .
    <element name="pTipoAgente" minOccurs="0">
         <simpleType>
          base="string"> <restriction
           value="preserve"/> <whiteSpace
           <maxLength value="30"/>
          < / restriction >
         < / simpleType >
        < / element>
    Suggestions welcome , thank you !

    Well, post you question in the right forum (https://forums.oracle.com/places?filterID=all~objecttype~showall&query=soa)
    Timo

  • How to preserve manually maintained Hierachy?

    Gurus,
    How to preserve manually maintained Hierachy in parenth1. We are maintaining some much data manually for BPC only with hierarchy. Problem is every time when we load the hierarchy from BW system the manually maintained hierarchy gets wiped out.
    We don't want to maintain BPC only hierarchy as seperate parenth2. I read this article Understanding how to Preserve Manually maintained Alternate Hierarchies with the new BPC Data Manager Package to Load from BW Hierarchies but this is maintaining as seperate parenth2 or 3.
    Please suggest.
    Thanks.

    Hi,
    You can not maintain the hierarchy in BPC and load from BW, it will be wiped out every time.
    What we did was that we created a new custom hierarchy in BW with the extra nodes.
    Andy

  • JAXB: How to have my generated classes subclass some other outside class ?

    With my XJS and DTD, JAXB generates the following:
    public class FraisMessage
        extends MarshallableRootElement
        implements RootElement
    { etc...I would like it to generate this instead:
    public class FraisMessage extends MyOtherClass
        extends MarshallableRootElement
        implements RootElement
    { etc...MyOtherClass is another class outside the scope of JAXB
    How do I do this ? What do I have to put in my XJS to get this ?

    You cannot do that. TheJAVA language does not allow a class to "extend" more than one upper class.
    Typically, the solution is to modify your architecture a little bit. Just use the "has a" relationship instead of "is a". That means something like that:public class MyFraisMessage
        extends MyOtherClass
        private FraisMessage message;
      etc...You write an extension "MyFraisMessage" of your upper class "MyOtherClass", which has the JAXB generated object as an attribute. This structure is often useful, when you think you would need multiple inheritance.

  • How to preserve database user details before cloning

    Hi Experts,
    How to preserve database user details before cloning,
    I am cloning the test database with the prod database, so my concern is how to preserve the users details which they have in TEST database( like roles, privilges, profiles , passwords, etc.....). Because that all gone after cloning from PROD.
    Thanks
    Sam

    use the following script to take the backup of roles,pwd & other  details of DEV . after cloning  execute the scripts back in DEV to restore the old values....
    set head off
    set lines 200
    set pages 9999
    col owner for a20
    col db_link for a30
    col username for a15
    col host for a40
    col created for a12
    spool db_details.lst
    select * from global_name;
    select * from dba_db_links;
    select name from v$controlfile;
    select member from v$logfile;
    select file_name from dba_data_files;
    select file_name from dba_temp_files;
    spool off
    spool create_db_links.lst
    select 'create DATABASE LINK '||owner#||'.'||NAME|| ' connect to '|| userid || ' identified by '|| password || ' using '||''''|| host ||''''||'; ' FROM sys.link$ order by owner#;
    select username,user_id from dba_users where user_id in (select distinct owner# from link$);
    spool off
    spool alter_user.lst
    select ' alter user '||username||' identified by values ' || chr(39)||password||chr(39) || ';' from dba_users;
    spool off
    Set verify off
    Set space 0
    set feedback off;
    set echo off;
    set pages 1000;
    set lines 150;
    spool create_synonym.sql
    Select 'CREATE SYNONYM '||owner||'.'||synonym_name||' FOR '||table_owner||'.'||table_name||'@'||db_link||';' from dba_synonyms where db_link is not null and table_owner is not null;
    Select 'CREATE SYNONYM '||owner||'.'||synonym_name||' FOR '||table_name||'@'||db_link||';' from dba_synonyms where db_link is not null and table_owner is null;
    spool off;
    Spool profile.sql
    select ' alter user '||username||' profile '||PROFILE||';' from dba_users;
    spool off

  • How to preserve my chained backtrace

    Hi friends,
    This is a peculiar problem where in the websphere created stub file for my stateless session ejb is creating a
    copy of my app's exception(which has chained backtraces due to exception chaining)[i believe that it is doing this for
    portability purposes] and setting those backtraces to null, so that by the time i catch this exception in the web tier, i
    have no stack trace!
    In the stub file for my stateless session ejb auto-generated by websphere 5.1, inside the business method,
    Also, am using Local Communication, so the else gets executed.
    //if remote communication with ejbs,
    if (!Util.isLocal(this)) {
    else //if local communication with ejbs
    try {
    //some exception occurs...
    } catch (Throwable ex) {
    //The throwable "ex" which is being used to make a copy has chained tracebacks.
    //But now, the below statement is creating a copy of "ex" with all the tracebacks being set to null in the chain!
              Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
    if (exCopy instanceof myappException) {
    throw (myappException)exCopy; // throwing the copy with the tracebacks set to null to the web tier!
    throw Util.wrapException(exCopy);
    } finally {
    servantpostinvoke(so);
    //Inside the business implementation class for my stateless session ejb,
    public mybusinessmethod () throws myappException{
    try {
              //some exception occurs....          
    } catch (Exception e) {
                   throw new myappException(e);
    So, how to preserve my backtraces from being set to null by websphere's generated stub files and pass them to the web-tier??
    thanks a lot

    so um I'm moving my files from my computer to my mybook. And i unintentionally removed itunes in the process....so how do i recover all my music and playlists. I have a lot of music and for some reason i have a lot of duplicates. And i do not feel like sitting at my computer for 6 hours deleting every single duplicate and recreating all my playlists. Or do i have to it this way? any help would be great thanks.

  • How to preserve battery life ~ used to last all day, now it runs out by lunchtime

    How to preserve battery life ~ used to last all day, now it runs out by lunchtime

    I would advise updating to iOS 7. It might improve your battery and the bugs are worked out by now.
    If not wanting to update because of the new look, here are some tips:
    -Turn off bluetooth when not needed.
    -Connect to wifi and turn off cellular data when possible.
    -When not around wifi, turn wifi off.
    -Keep your screen at around 50% brightness.
    -Disbale certain apps or features in Settings<Privacy<Location Services if they are not necessary.
    -Close out of apps in the multitasking bar.
    -Enable airplane mode when you plan on not using your phone for a while.
    Hopefully these tips help you. If your battery does eventually get too bad, you can get it changed out by apple. If youve had your device for under a year, you can take it into an Apple store and theyll give you a new phone in return. Have a good night and good luck!

  • How to preserve or embedded history in photo when exporting?

    Does anyone know how to preserve a photo develop history when exporting to new folder so that editing can continue?

    Thanks Jim and DJ - perhaps my process needs to change. I use a folder structure within each photo shoot.  Capture (for all raw files) - Master (for working photos that are being edited / developed) - and finally an Output folder for photos being printed or posted to web etc. I export to each. I understand that you can always go back to the original raw capture or any point in the history but sometimes I want to compare different editions of develop settings for an image against each other while preserving both. When using a copy of an image the develop settings only start at time of copy and likewise when using an exported image the history starts from the export going forward
    What I want to do is take photos from the various Master folders that have develop changes to them and move or copy them to another folder; as example a "2015 Art Show folder" for an upcoming photo exhibit etc. and then do additional develop changes specific for the Art Show  - being able to see the previous develop settings would be useful during this edit phase and you could continue to work in the one folder without needing to hunt around to numerous folders all over Lightroom
    I hope that explains what I am trying to do, I appreciate any ideas you may have
    Thanks,
    Paul

  • How to preserve old dtd when using writetofile method

    Hi,
    I have one doubt.How to preserve the dtd of xmlfile before parsing it with the xml parser for pl/sql ,write this saved dtd to the document object and use to writofile method of the dom object.If this is possible then can anyone ,please give me suggestions.
    I illustrate the situation ,given below is the dtd of the file before parsing :-
    <!DOCTYPE family [
    <!ELEMENT family (member*)>
    <!ATTLIST family lastname CDATA #REQUIRED>
    <!ELEMENT member (#PCDATA)>
    <!ATTLIST member memberid ID #REQUIRED>
    <!ATTLIST member dad IDREF #IMPLIED>
    <!ATTLIST member mom IDREF #IMPLIED>
    ]>
    After parsing and using the writetofile method ,the dtd present below is the changed dtd of the new xml file.
    <!DOCTYPE family [
    <!ELEMENT member ANY>
    <!ATTLIST member memberid ID >
    ]>
    Can anyone say how to stop this.Any help would be great
    Regards
    gopal

    Hi, Kiran,
    As the others have said, the only way ^1^ to get the result set in any particular order is to use an ORDER BY clause.
    Here's the general way to do that in SQL in case of a UNION:
    WITH  union_results     AS
         select 'a' AS txt, 1 AS sort_key from DUAL
        union
         select 'd',        2             from DUAL
        union
         select 'b',        3           from DUAL
        union
         select 'c',        4           from dual
    SELECT    txt
    FROM       union_results
    ORDER BY  sort_key
    ;In SQL, you can only ORDER BY expressions that arei n the SELECT clause, so to avoid displaying sort_key, the sub-query is necessary. A lot of people don't use pure SQL for this; they have their front end hide the sort_key column. In SQL*Plus, for example, you can say COLUMN sort_key NOPRINT.
    ^1^ There is one exception, which does NOT apply to this case, or most others. CONNECT BY, even without ORDER BY, does impose a partial ordering.

Maybe you are looking for

  • Unusable 'Other' blocking up my iphone after update

    I have just updated my operating system to version5, but now I am unable to sync with my iphone from iTunes, or use any apps or store any music on my iphone.  I also have 11.5GB of unusable 'other' stuff in storage and cannot get access to it..... HE

  • Object id for BP Internal reconciliation and SPTN

    Hi expert, Can any one help, What is the Object id for BP Internal reconciliation SAP B1? We want to make SPTN notification if any BP reconciliation customer/supplier code are not matching then system block for reconciliation. Thanks in Advance. Rega

  • MouseListeners on Table and Header

    Hi ! Because registering a MouseListener on a JTable won't get MouseEvents from the header, I've registered two MouseListeners with my JTable (double-click calls method to open a document) and the JTableHeader (click calls method to sort table using

  • Backdated PO receipt and Invoice date in closed periods_Dropshipment

    The Business requirement is The OU gets the Bill of Lading/Air Way Bill document offline after some time let's say within 10 days of actual Bill of Lading/Airway Bill Date. We are executing Dropshipment process. The PO receipt to be done on back date

  • Java Paint Bucket Tool

    Hi. I�m working on a simple paint program and I�m having some trouble with the bucket or filling tool. This tool must fill any shape drawn by the user with the current color (the user clicks on a given point and the tool replaces the color of the are