OX Mapping attributes

Hi,
Could someone tell me how to map the value from an object attribute to a xml attribute when using 10.1.3 to perform ObjectXML.
I am able to get my XML Unmarshalled, make changes and Marshal it, but it appears the tag attributes are not coming through
eg
i get
<phone-number>12345</phone-number>
<phone-number>67890</phone-number>
and i want
<phone-number type="home">12345</phone-number>
<phone-number type="work">67890</phone-number>
how do i do it?
Thanks

Hi Martyn,
Mapping an object attribute to XML attribute is similar to mapping an object attribute to an XML text node. The difference is in the XPath specified. To indicate an XML attribute append an "@" to the attribute name when specifying the XPath (see the code example below).
XMLDescriptor desc = new XMLDescriptor();
desc.setJavaClass(PhoneNumber.class);
desc.setDefaultRootElement("phone-number");
XMLDirectMapping typeMapping = new XMLDirectMapping();
typeMapping.setAttributeName("type");
typeMapping.setXPath("@type");
desc.addMapping(typeMapping);
XMLDirectMapping numberMapping = new XMLDirectMapping();
numberMapping.setAttributeName("number");
numberMapping.setXPath("text()");
desc.addMapping(numberMapping);This mapping can also be created in the TopLink Mapping Workbench by selecting the XML attribute using the XPath Chooser GUI.
If your mapping is correct and you are still not seeing the attribute when you marshal the object to XML there are 2 possible causes:
1. You have marked the mapping as read only. In this case TopLink will read the attribute value during the unmarshal operation but will not write the attribute value during the marshal operation.
2. The corresponding value in the object model is null, null values in the object model are not written out when the object is marshalled to XML.
-Blaise

Similar Messages

  • How to set "Image Map" attribute to "Polygon" via javascript in Illustrator CS5

    Ok, so I have this little script I've written that I want to use to go through a bunch of paths in a document and give each path a url for use in an image map. I want each link to be a Polygon because, well, let's face it, "Rectangle" is useless 99% of the time. Obviously, the way you would do this manually would be to open the Attributes panel and set the Image Map attribute to Polygon and type a URL in the URL field. Fine. Easy enough. However, when scripting the process, it seems one can only set the URL (or the uRL [sic] as documented in the javascript reference) of the PathItem. In other words:
    pathItem.uRL = "http://someurlfor.me";
    Unfortunately, this defaults the "Image Map" attribute to "Rectangle" (which we already know is useless 99% of the time.) SO, anyone out there know how to change that attribute to "Polygon?"
    Btw, I'm on Illustrator CS5 and have been using this reference:
    http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/illustrator/scrip ting/illustrator_scripting_reference_javascript_cs5.pdf
    Thanks,
    -Matt

    We found that with the following setting, the problem is almost solved :
    theme.setQueryWindowMultiplier(1);
    theme.enableAutoWholeImage(true);
    We still have a problem : a portion of the base map appears black most of the time, on Blackberry only (Opera Mini) ... like 1/5 of the map ... the right side ... any idea ?
    Thanks,
    JP

  • Mapping attributes between two resources

    Hi All,
    Is there a way to map attributes of one resource to another?
    If so let me know how it can be done?
    regards,
    Zebra8

    Hi,
    Can you please be more clear in your reply. I am not able to get what you want to say.
    Thanks,
    Shankar

  • URLATTRIBUTE Mapped Attribute

    Hello All,
    Has anyone successfully used the URLAttribute Mapped attribute in BPM 11g (PS4FP)? I believe it generates a clickable URL in the BPM worklist or workspace. Is that how its supposed to work? There is no documentation on this anywhere.
    thanks,
    Vikram
    Edited by: Vikram Bailur on Mar 19, 2012 12:24 AM

    bump.

  • Cannot modify datatype of mapped attribute

    com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(DisplayEmpLeave.Year): must not modify the datatype of a mapped attribute
    IWDAttributeInfo attinfo=wdContext.getNodeInfo().getAttribute("Year"); ISimpleTypeModifiable modinfo=attinfo.getModifiableSimpleType();
    IModifiableSimpleValueSet valset=modinfo.getSVServices().getModifiableSimpleValueSet();

    Hi,
    It is not possible to map the this variable to a controller.
    So if u remove the mapping, the code will work.
    For that, right click the atrribute <b>"Year"</b>->Delete Context Mapping.
    If u want to pass the value to controller, create one context variable of type string, map it to controller and get the value from the variable <b>Year</b> to this
    Regards
    Fahad Hamsa

  • Non-mapped attributes not merging!!

    I found this on webgain's web site (http://www.webgain.com/download/toplink/patches/toplink_301.html). This is exactly what I am talking about. Can somebody help with this? I have a case where I actually make a change to a mapped value, but the unmapped values are lost.
    26601
    Non-mapped attributes not merged in UnitOfWork. Previously, the UnitOfWork would merge non-persistent attributes on commit.
    With the introduction of ChangeSets in 3.0, if changes were made to only non-mapped attributes, then this was considered no change - no merge would take place and no PostMerge event would be thrown. This has been changed back to the TopLink 2.5.1 behaviour - non-mapped attributes will now be merged, and will trigger PostMerge events.

    Nate,
    I first off want to clarify that TopLink does not manage un-mapped attributes in any way. The change-set calculation and merge from the working copy into the shared cache copy only applies to mapped attributes.
    If you would like to have un-mapped attributes carried through your UnitOfWork interactions you will need to implement a DescriptorEventListener and register it with the descriptor's event manager (typically in an after-load method).
    The patch mentioned was for the handling of these events. If you have implemented such a listener and are not seeing the correct method calls then we have an issue. In this case let us know what version of TopLink you are using and what the specific scenario where you are not getting the behavior you expect.
    Doug Clarke

  • Mapping attributes not under nodes

    Hi
    If I create an attribute in the component controller wihtout a node, then can it be mapped to a view?
    On trying to do so it gives an error.
    Thanks
    Pushpraj

    Hi Pushpraj,
    You cant map those attributes to a view from the component controller. You can only map node and its attributes
    Regards
    Sarath

  • Mapping attributes to elements

    Hi,
    I have a file that looks similar to this...(I've simplified it for the post)
    <XPacket>
       <XField Type="integer" Name="SerialNumber">13781</XField>
       <XField Type="string" Name="Mfr">Johnson</XField>
       <XField Type="XPacket" Name="Counters">
          <XField Type="XPacketArray" Name="Metrics" ArraySize="20">
            <XElement Type="XPacket" Index="0">
               <XField Type="integer" Name="position">7</XField>
               <XField Type="integer" Name="value">523</XField>
            <XElement Type="XPacket" Index="1">
               <XField Type="integer" Name="position">9</XField>
               <XField Type="integer" Name="value">62</XField>
           </XElement>
         </XField>
       </XField>
    </XPacket>
    First of all there's a problem defining a data-type for the mapping; it's ugly, but I've been able to do that using 'occurs' for each of the duplicated elements.
    I need to map this to a file that looks like this.
    <Output>
      <SerialNumber>13781</SerialNumber>
      <Mfr>Johnson</Mfr>
      <Counters>
        <Metrics>
          <Reading0>
            <position>7</position>
            <value>523</value>
          </Reading0>
          <Reading1>
            <position>9</position>
            <value>62</value>
          </Reading1>
        </Metrics>
      </Counters>
    </Output>
    Essentially, I need to convert the NAME attribute value (where it exists) to an element and fetch the associated value.
    I've tried a few different approaches with graphical mapping, but I reckon that's the wrong choice and it seems to me that an XSLT mapping is the best approach. With help from w3schools, I'm getting close, but I'm having trouble with the complex elements (where an element has a child element).
    Any help would be gratefully accepted !!
    Thanks,
    Guy

    in   CREATE OBJECT lr_choice the object id have to refer to name of node.
      CREATE OBJECT lr_choice
         EXPORTING
           id = 'CHOICE'.

  • Mapping attributes at time of Xellerate User Recon.

    Hi All,
    I am doing mapping in process from for xellerate User and one of the field for mapping is "identity" . I am not sure what this field indicate and when it is used.Also, there is no field called "Password" in mapping. I am doing trusted reconciliation.
    Thanks,
    Ankit

    Thanks.
    but when I do reconciliation and map some attribute to identity as password , I can't log on with that attribute value.
    Not sure how it work if I need to set password at recon. Any solution for that?
    - Ankit

  • Mapping attributes to configurator attributes

    Hi, I'm trying to find an example of how I can map pricing attributes to configurator attributes so that I can use the configurator attributes withing pricing formulas.
    I can create the pricing attributes ok, it's the specific entry in the attribute mapping screen I can not figure out.
    Does anyone have an example I coulkd use for reference?
    Thanks

    could u explain in detail waht exactly r u looking for.
    Are u looking ot create a database or connecting/inserting data in to the relational database

  • Example of mapping Attributes to columns

    hi,
    i have a Customer class with an Adress object as Attribute.
    i am looking for an example or proposals how i can map all this in a rational databse .
    thank you.
    znouri

    could u explain in detail waht exactly r u looking for.
    Are u looking ot create a database or connecting/inserting data in to the relational database

  • Mapping Attribute Dim in Essbase

    Hi,
    I think this is bit funky requirement part of my enhancement project.V 11.1.2.1
    i have an essbase cube with a hierarchy called Product where the level 0 is PartNumber. I have an attribute dimension call ProdType which is coming from a different mapping table and different source with PC(Product Code) which is level 1 in my hierarchy and my requirement is to map that attribute to one level down with corresponding PartNumber.
    Product
    -------PS(Level 2)
    ----PC(Level 1)
    ---PN(Level 0)
    ---PN1(Level 0)
    File1 Extract gives me the full product hierarchy so i am building the hierarchy using Build Rule where as second file(File2) i am getting has only PC(level1) of product hierarchy with attribute column ProdType. BUt my requirement is to map the attribute value to all the PartNumber under that ProductCode as Attribute can not be mapped to upper level members. Is their a way in essbase to puss the attribute mapping to level0 where as the file has level1 mapping.
    Note: we do not want to make any change from DWH side so trying to achieve this in Hyperion
    any thought or way to achieve this?
    -KP

    Got some idea and that is working for me if i am mapping manually , there is something call Association where we can map the Attribute dimension member to any level of base dimension. I am still working on how to map the association using Dimension Build Rule. i can see the Field properties to map as UDA,formula etc but don't see Association in that window.
    any suggestion will be helpful.
    -KP

  • Must not modify the datatype of a mapped attribute

    Hi!
    I have an inputfield in my WD with extended value help (countryKey and CountryName, coming from R/3). The selected country should be passed to a bapi import parameter mapped in a model, but the problem is that an exception occurs stating that I cannot change the data type of the context attribute because it is mapped to a model.
    How is this usually done?
    Thanks,
    faB
    ContextException: AttributeInfo(SearchView.Iv_Land1): must not modify the datatype of a mapped attribute

    Hi,
    1. Create sub-node under your model node with cardinality 1..1 (non-singleton used in sample below)
    2. In this sub-node create calculated attribute with the same primitive type as desired attribute has (say, string).
    3. In setter / getter write code that will modify original attribute:
    /* getter */
    return element.node().parentElement().getAttributeValue("OriginalModelAttr");
    /* setter */
    element.node().parentElement().setAttributeValue("OriginalModelAttr", value);
    4. Rebind your input field to newly created attribute, and apply any value set modifications to it.
    VS

  • Unable to map attributes

    Hello,
    I try to map the following portal attributes with external x500 attributes.
    � IwtUserInfoProvider-NotesServerName=mailHost
    � IwtUserInfoProvider-NotesPortName=mailType
    � IwtUser-SMTPServerName=mailHost
    � IwtUser-IMAPServerName=mailHost
    When submitting the form, I got the following error message : "Profile not changed : invalid attribute or privilege name".
    What to do ?
    Thanks in advance.
    (I use a v3.0 sP4 portal server)

    The mapping can happen only with another ldap server.
    You might wanna look at this article ..
    http://knowledgebase.iplanet.com/ikb/kb/articles/4650.html

  • Map attributes of XML file to ABAP table, using a XSLT program

    Hi dear Gurus.
    I have to transfer the information from the XML's element attributes to abap internal tables and store that information.
    Somebody has a clear sample to do this data transfer.
    I found a clas iXML, do you have a sample to read the elements and attributes using this class?
    Thanks in advance.
    Regards.

    hello ,
    search for BCCIIXM* in se38.
    regards
    Prabhu

Maybe you are looking for

  • IDOC to and from eternal system

    Hi All, I've following scenario: Sender SAP R/3 system is sendind IDOC of type say A to XI system, XI system is mapping IDOC of type A to say IDOC B, then finally XI is sending IDOC B to receiver SAP R/3 system [External system} Note: Reverse scenari

  • Xsan 1.4 First Look & Stability Report

    Immediately installed Xsan 1.4 with a client that's been suffering under the FCP render issues introduced with 1.3. I'm happy to report that with a reasonable sized installation (12 seats & 22 seats) both have been running flawlessly all day and have

  • Hitting F11 in the form does not change the colour to blue

    Hi All, Hitting F11 in the form does not change the colour of the queryable fields to blue. Those fields remain white in color. The query functionality is working properly. The problem is only with the color not changing to blue. Is there any form pr

  • Decentral Adapter Engine

    Currently documentation only indicates the ability to create a single decentralized adapter engine.  (1) Is this in addition to the existing central adapter engine or do I have to choose which one I will use?  (2) Does the decentralized adapter engin

  • Javascript error throws the portal theme configuration page

    General Description: Javascript error and jump to the portal theme configuration page EP: NW04s SP12 including KMC We have a problem when we entry to the portal, a javascript error happens and immediately jumps to the portal theme configuration page.