[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    RE: How to delete a Child element in an XMLBeans application?
From:       "Radu Preotiuc-Pietro" <radu.preotiuc-pietro () oracle ! com>
Date:       2009-01-06 2:18:13
Message-ID: 20090105211813109.00000001196 () RADUP02
[Download RAW message or body]

I haven't looked at your Schema, but for optional elements/attributes, XMLBeans will \
generate unsetXXX() methods, which will remove the element/attribute rather than \
setting it to null.  
Radu


________________________________

	From: Ritesh Shah [mailto:ritesh101@gmail.com] 
	Sent: Wednesday, December 24, 2008 12:06 AM
	To: dev@xmlbeans.apache.org; xmlbeans-dev@xml.apache.org
	Subject: How to delete a Child element in an XMLBeans application?
	
	
	How to delete a child element in Java beans style of handling XML document in an \
XMLBeans based Java application? I can't find way to deleting a child element using \
Java types created by XMLBeans based on the XML Schema. I know of doing it using \
XMLCursor interface.   

	I have attached XML Schema SchemaDel.xsd, its input data InputDel.xml, and XMLBeans \
java application Delete_XmlBeans.java. This Java application logic wants to remove \
the "childElement1". However, output shows that childeElement1 is set to nil with \
xsi:nil="true". I was hoping for actual output to have "childElement1" disappeared \
completely. How can I do that?  
	Thanks in advance.
	Ritesh
	


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3395" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=375581602-06012009><FONT face=Arial 
color=#0000ff size=2>I haven't looked at your Schema, but for optional 
elements/attributes, XMLBeans will generate unsetXXX() methods, which will 
remove the element/attribute rather than setting it to null.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=375581602-06012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=375581602-06012009><FONT face=Arial 
color=#0000ff size=2>Radu</FONT></SPAN></DIV><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> Ritesh Shah [mailto:ritesh101@gmail.com] 
  <BR><B>Sent:</B> Wednesday, December 24, 2008 12:06 AM<BR><B>To:</B> 
  dev@xmlbeans.apache.org; xmlbeans-dev@xml.apache.org<BR><B>Subject:</B> How to 
  delete a Child element in an XMLBeans application?<BR></FONT><BR></DIV>
  <DIV></DIV>How to delete a child element in Java beans style of handling XML 
  document in an XMLBeans based Java application? I can't find way to deleting a 
  child element using Java types created by XMLBeans based on the XML Schema. I 
  know of doing it using XMLCursor interface. <BR>
  <DIV class=gmail_quote><BR>I have attached XML Schema SchemaDel.xsd, its input 
  data InputDel.xml, and XMLBeans java application Delete_XmlBeans.java. This 
  Java application logic wants to remove the "childElement1". However, output 
  shows that childeElement1 is set to nil with xsi:nil="true". I was hoping for 
  actual output to have "childElement1" disappeared completely. How can I do 
  that?<BR><BR>Thanks in advance.<BR><FONT 
  color=#888888>Ritesh<BR></FONT></DIV><BR></BLOCKQUOTE></BODY></HTML>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic