Jaxp-Unable to remove an attribute permanently from document object

Hi
I have a requirement where I have to strip out an attribute called "xmlns" at the root element of my xml document.
for eg: <UserProfile xmlns="http://foo">
<ID>1234</ID>
<Name>Bob</Name>
</UserProfile>
I tried using API's
1) document.getDocumentElement.removeAttribute("xmlns")
After this my xml document look like this
<UserProfile >
<ID>1234</ID>
<Name>Bob</Name>
</UserProfile>
Also tried this..
2) Attr att=document.getDocumentElement().getAttributeNode("xmlns");
att.setValue("");
document.getDocumentElement().setAttributeNodeNS(att);
After this my xml document look like this
<UserProfile xmlns="">
<ID>1234</ID>
<Name>Bob</Name>
</UserProfile>
Irrespective of all this , when I gave the new xml document to Jaxb for processing , Jaxb complains that
unexpected root element
uri:http://foo
Though this attribute neither visible nor accessible using any DOM apis, still this attribute exists as part of this document.
Could somebody explains a little more about this behaviour or help me to resolve this..
Any feedback will be deeply appreciated,
Ranjith Pillai.

Ranjith,
I am facing the same problem and still not been able to figure out what's wrong with parsing.
Here is the XML document before cleaning
INFO: Clean CamMessage=
<?xml version='1.0' encoding='UTF-8'?>
<CamMessage>
<originator name="CLARIFYCRM" version="1.0"/><security><key>rO0ABXNyACFjb20uY2luZ3VsYXIuY2FtLmF1dGguU2VjdXJpdHlLZXkhdeFvAoQflwIABEoADGNy
ZWF0aW9uVGltZUoAB2V4cERhdGVMAApjbGllbnRUeXBldAARTGphdmEvbGFuZy9DbGFzcztMAAh1
c2VySW5mb3QAD0xqYXZhL3V0aWwvTWFwO3hwAAAA/HwfQv8AAAD8fDGSf3ZyACJjb20uY2luZ3Vs
YXIuY2FtLmNhcmUuYXV0aC5DU1JBdXRoAAAAAAAAAAAAAAB4cHNyABFqYXZhLnV0aWwuSGFzaE1h
cAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAx3CAAAABAAAAAH
dAAIUGFzc3dvcmR0AAtDTEFSSUZZQ1JNO3QAEm9yaWdpbmF0b3IudmVyc2lvbnQAAzEuMHQABFNp
dGV0AAMwMDF0AAZVc2VySWR0AApDTEFSSUZZQ1JNdAAKQ29tcGFueU5icnQAAjM1dAAPb3JpZ2lu
YXRvci5uYW1ldAAKQ0xBUklGWUNSTXQAD1Byb2Nlc3NPbkJlaGFsZnEAfgAPeA==</key></security><request action="Login"><select><field name="Password">CLARIFYCRM;</field><field name="Site">001</field><field name="UserId">CLARIFYCRM</field><field name="ProcessOnBehalfUserId">CLARIFYCRM</field><field name="CompanyNbr">35</field></select></request><response><resultSet/></response>
</CamMessage>
INFO: Clean CamMessage=
<?xml version='1.0' encoding='UTF-8'?>
<CamMessage>
<originator name="CLARIFYCRM" version="1.0"/><security><key>rO0ABXNyACFjb20uY2luZ3VsYXIuY2FtLmF1dGguU2VjdXJpdHlLZXkhdeFvAoQflwIABEoADGNy
ZWF0aW9uVGltZUoAB2V4cERhdGVMAApjbGllbnRUeXBldAARTGphdmEvbGFuZy9DbGFzcztMAAh1
c2VySW5mb3QAD0xqYXZhL3V0aWwvTWFwO3hwAAAA/HwfQv8AAAD8fDGSf3ZyACJjb20uY2luZ3Vs
YXIuY2FtLmNhcmUuYXV0aC5DU1JBdXRoAAAAAAAAAAAAAAB4cHNyABFqYXZhLnV0aWwuSGFzaE1h
cAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAx3CAAAABAAAAAH
dAAIUGFzc3dvcmR0AAtDTEFSSUZZQ1JNO3QAEm9yaWdpbmF0b3IudmVyc2lvbnQAAzEuMHQABFNp
dGV0AAMwMDF0AAZVc2VySWR0AApDTEFSSUZZQ1JNdAAKQ29tcGFueU5icnQAAjM1dAAPb3JpZ2lu
YXRvci5uYW1ldAAKQ0xBUklGWUNSTXQAD1Byb2Nlc3NPbkJlaGFsZnEAfgAPeA==</key></security><request action="Login"><select><field name="Password">CLARIFYCRM;</field><field name="Site">001</field><field name="UserId">CLARIFYCRM</field><field name="ProcessOnBehalfUserId">CLARIFYCRM</field><field name="CompanyNbr">35</field></select></request><response><resultSet/></response>
</CamMessage>
Code to unmarshal
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setValidating(false);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new File( "test.xml"));
//Document doc = db.parse(inMessage);
cmcamList = (CamMessage )unmarshaller.unmarshal( doc );
//test.xml is actually the clean xml message as above.
Appreciate any help in resolving the problem.
Thanks,
Nilesh

Similar Messages

  • Unable to remove additional attribute/ category from product

    I am using SAP CRM 4.0 and in order to add additional attributes on a product created a attribute 'test_attribute' created a set type ' test_attribute_set' and attached the attribute to it. Then I created a hierirch and and inside it created a category 'test_category' which was assigned 'test_attribute_set'. This test category was then attached to my two products. All is fine till here, but now when I try to detach this catagory from product it does not give an option to select the category and remove from the general tab of product. Can some one please help me on this?

    I am using SAP CRM 4.0 and in order to add additional attributes on a product created a attribute 'test_attribute' created a set type ' test_attribute_set' and attached the attribute to it. Then I created a hierirch and and inside it created a category 'test_category' which was assigned 'test_attribute_set'. This test category was then attached to my two products. All is fine till here, but now when I try to detach this catagory from product it does not give an option to select the category and remove from the general tab of product. Can some one please help me on this?

  • Can I remove some applications permanently from my PowerBook?

    When I don't play or use some applications on my iPhone, I just uncheck the application on iPhone > Applications of iTune, and syncing to remove from iPhone. But is there a way to remove the applications permanently from my iPhone > Applications of iTune on my PowerBook?
    Thanks in advance for help.

    Select the app, tap the delete key on your keyboard or use the iTunes Edit menu -> delete. Select the "keep files" button if you want to keep the app in your iTunes mobile applications folder, otherwise select "Move to Trash".

  • How to get attribute value from an object inside an object in Xpress

    Does anyone know how to get an attribute value from an object in Xpress in a workflow? I have an object structured as follows:
    <ResourceInfo accountId='mj628' tempId='3483372b787ce7dd:-5d99a0c5:130cb238483:-3600'>
    <ObjectRef type='Resource' name='Google Apps'/>
    </ResourceInfo>
    I need if possible to get the name='Google Apps', which is inside the ObjectRef, so I guess its an attribute value of an object inside an object.

    If the ResourceInfo object is accessible in a variable, i.e. named "myResInfo", you just have to check the Java API and call the relevant method:
    <invoke name='getResourceName'>
      <ref>myResInfo</ref>
    </invoke>

  • "EQG-31210:Missing security attribute value from document" for crawl CDB

    I am using Secure Enterprise Search to crawl Content Database. But the crawler throws the following exception for all the document the crawler crawled.
    13:18:24:424 INFO     filter_1          submitting doc http://dvod1.cn.oracle.com:7778/content/dav/cn/mtblog/t/te/TEST1/2007/06/only_a_test.html with status: 200
    13:18:24:425 INFO     filter_1          Processing http://dvod1.cn.oracle.com:7778/content/dav/cn/mtblog/t/te/TEST1/2007/06/only_a_test.html
    13:18:24:425 ERROR     filter_1     EQG-31210: Missing security attribute value from document: http://dvod1.cn.oracle.com:7778/content/dav/cn/mtblog/t/te/TEST1/2007/06/only_a_test.html oracle.search.crawler.WebCrawlerException     oracle.search.crawler.URLAccess:processUrlEntry:2759     oracle.search.crawler.CrawlingThread:submitForProcessing:7183     oracle.search.plugin.ocs.cservices.CSBrowse:submit:1727     oracle.search.plugin.ocs.cservices.CSBrowse:processDocument:1334     oracle.search.plugin.ocs.cservices.CSBrowse:processNextItem:1083     oracle.search.plugin.ocs.cservices.CSBrowse:browse:1170     oracle.search.plugin.ocs.cservices.OCSCSPlugin:crawl:154     oracle.search.crawler.CrawlingThread:run:1443

    Hi Juwan,
    Which SES are you using ?
    we had seen such exception in SES 10.1.8 if we try to submit a public document .

  • I am unable to remove an empty folder from the bookmarks toolbar

    Window 7
    Firefox 6.0.2
    I have an empty folder on my bookmarks toolbar that I am unable to remove. I delete it and it comes back. I have been able to delete other folders from the toolbar, but not this one.

    Any help??? Please!!

  • How to get File  object from Document Object . ?

    In conventional Dom Parsing we pass file to DocumentBuilder to get Document Object .
      File file = new File("c:\\MyXMLFile.xml");
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.parse(file); // gOT Document here . My problem is how do i get File object back from Document . If i have Document object with mi.
    Please consider above code as example i dont have File object in my code . i am using Xhive DB API where i get Document directly from API method .
    I need to convert this Document to File to get size of file
    Please suggest solution on this
    Edited by: AmitChalwade123456 on Dec 5, 2008 6:10 AM

    Hello Guys any views on this topic

  • Unable to remove apple software update from PC

    I am unable to update my i tunes as there is a problem with the apple software update. I have uninstalled everything else to try and rectify the issue but it has now made it worse as everything has gone but the apple software update. It cant be removed from my PC any ideas how I can get rid of it?

    You lost me.  Do you have a new computer that you want to sync your new iPad with?

  • Removing a user permanently from screen sharing and changing password

    In 10.6 I want to do two things.
    First change the password of a user that is allowed to log in as a person to share the screen.
    Next permanently remove one completely out of all files and storage.
    how does one do this?

    If you added a user for screensharing - they'll be shown in System Preferences - Accounts, from where the password can be reset, or the account removed altogether. The user may also be removed individually from ... Sharing - Screensharing/filesharing etc

  • Unable to remove recycle bin entries from user_constraints table

    When I do select * from user_constraints table I get few entries like BIN$HY86N3B2RQi/1ODAiR9CTw==$0.
    I have tried purging the recycle bin many times but these entries are still there. When i try to read the database information from my code(JDBC Connection) these keys are being read and generating erroneous results.
    One more important thing. When i tried to rename these keys, they are getting generated again. Any help on this issue will be very helpful to me. Thanks in advance.

    >
    When i tried to rename these keys, they are getting generated again
    >
    What does this mean? Show us the statement you used to do the rename.
    >
    its not present in the recycle bin but it is present in the table user_constraints only. when i do a select * from user_constraints i get two entries where the constraint_name is like this BIN$.........
    >
    Exactly - once you flashback the table the constraints aren't in the recycle bin so you can't purge them from it. But you can rename these if you own them. You don't have to be SYS.
    See the 'Notes on Flashing Back Dropped Tables in the SQL reference
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9012.htm
    >
    Notes on Flashing Back Dropped Tables The following notes apply to flashing back dropped tables:
    •Oracle Database retrieves all indexes defined on the table retrieved from the recycle bin except for bitmap join indexes. (Bitmap join indexes are not put in the recycle bin during a DROP TABLE operation, so cannot be retrieved.)
    •The database also retrieves all triggers and constraints defined on the table except for referential integrity constraints that reference other tables.
    The retrieved indexes, triggers, and constraints have recycle bin names. Therefore it is advisable to query the USER_RECYCLEBIN view before issuing a FLASHBACK TABLE ... TO BEFORE DROP statement so that you can rename the retrieved triggers and constraints to more usable names.
    •When you drop a table, all materialized view logs defined on the table are also dropped but are not placed in the recycle bin. Therefore, the materialized view logs cannot be flashed back along with the table.
    •When you drop a table, any indexes on the table are dropped and put into the recycle bin along with the table. If subsequent space pressures arise, then the database reclaims space from the recycle bin by first purging indexes. In this case, when you flash back the table, you may not get back all of the indexes that were defined on the table.
    >
    Just rename the constraints since they are in your own schema.

  • Unable to remove "Untitled CD 2" from Finder

    While other people have found a fix for removing these, I haven't been able to get it to work properly.
    Finder, in both 10.6 and now in 10.7, had listed "Untitled CD" and "Untitled CD 2" in the sidebar, with a burn icon next to them. They were completely unselectable.
    Other threads mentioned that inserting a blank CD and then selecting them would work, and it did, but only for the first "Untitled CD", so I'm left with "Untitled CD 2".
    I've tried a different blank CD, but to no avail.
    Anyone know what to do?

    Thank you so much Eric. I have been haunted by this problem (a DVD actually) and wasted hours trying to get rid of it. Your trick worked perfectly and earned the "*** Didn't I Think of That Award" 8^)

  • Unable to get VO attribute values from CO extension

    Hi All,
    I have extended a standard controller. Screen has view link. There are fields updatable in both master and child VOs'.
    If i change these fields (messageTextInput), Im able to get the modified values of master VO.
    But Child VO gives me the database value and not the modified value.
    this is the code im using to get values.
    OAViewObject vo = (OAViewObject)am.findViewObject("PosViewLinesVO");
    OAViewObject vo1 = (OAViewObject)am.findViewObject("PosViewShipmentsVO");
    Row row = vo.first();
    while(row != null)
    Number poLineId = (Number)row.getAttribute("PO_LINE_ID");
    Number lineTotal = (Number)row.getAttribute("Total");
    Row row1 = vo1.first();
    while(row1 != null)
    Number poLineId1 = (Number)row1.getAttribute("PoLineId");
    if(poLineId1.equals(poLineId))
    Number lineLocId = (Number)row1.getAttribute("LINE_LOCATION_ID");
    Number price = (Number)row1.getAttribute("NewPrice");
    row1 = vo1.next();
    row = vo.next();
    Please help. Am i missing sometihng.
    Thanks in advance

    are you getting any null pointer ??
    and check OAViewObject vo = (OAViewObject)am.findViewObject("PosViewLinesVO");// is this PosViewLinesVO or PosViewLinesVO1
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                               

  • How to Remove the Entity usage from View object at runtime

    Hi,
    A ViewObject can be created dynamically based on the Existing ViewObject Defintions. The newly created dynamic ViewObject will have all the defintion including Attributes, its structure along wtih Entity usage of the existing ViewObject definition.
    My requirement is i don't want to have the Entity usage alone whereas Remaining structure need to be retained.
    Can any body suggest on how to do it.
    regards.

    Hi,
    design time or runtime? At designtime, have you tried to just remove the entity reference? Given the disadvantage of removing the entity (and the changed behavior associated with it) what is the use case for which you want to disable the entity reference?
    Frank

  • I am unable to attach a PDF file from Documents

    I am unable to access and attach a PDF file from Documents

    I assume you are trying to attach a PDF to an email. I can perform this task several ways.
    With a Finder window open and the PDF showing in that window, drag the PDF to the Mail app icon on the dock. This creates a new email and attaches the PDF to it. (PDFs tend to attach in inline view mode, that is you can see the entire document. To see it as a file icon right click on the PDF text and select View as Icon.)
    I can drag the PDF directly into an open new email message if both the email message and the PDF file can be seen.
    There's an icon on the Mail toolbar that looks like a paper clip. Click on it to get a file selector and drill down until you see the PDF. Select it and click OK.
    Select Attachments from the Edit menu and choose Attach file to end of message

  • Framemaker v11 Books unable to clear all change bars from documents

    I have converted all Framemaker v10 documents to v11 by opening and saving. However when opening the Book v11 for these documents and applying the 'clear all change bars' option a book error log message advises that the documents cannot be opened as they are in a previous version! When performing the same function on the individual documents outside of the Book this works fine. But unable to clear all change bars within a book when selecting all the files in one go. Is there a bug with Books in v11?

    My version is FM11.0.0.380 so I will install the patches. I did open all documents up from within the book and then individually saved them, then i applied the 'clear all change bars' and this worked. It just does not seem right that you can clear the change bars from the documents from outside the book but when you try it from within the book it says cannot open document as it was created with a previous version. I have managed to get it working but would be good to know if it is a book bug or not. I will try it on another Book when I have upgraded to the latest patch.

Maybe you are looking for