FWIW, this is how I would approach the problem:

1. Turn the "dot-syntax" expression into an Xpath. If your Schema
doesn't have a target namespace, then this is trivial: replace the "."s
with "/"s. If it does, then it's a bit more complicated, because you
need to do something with localName(), I don't know Xpath well enough;

2. use XmlObject.selectPath() to find the node that you want to delete;

3. use XmlObject.newCursor().removeXml() to eliminate the node.

Hope this helps,
Radu

> -----Original Message-----
> From: janbanan [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 20, 2007 10:56 AM
> To: [email protected]
> Subject: Re: Remove node from "dot-syntax"
> 
> 
> Hi,
> 
> It has minoccurences to 0 so it should be "deleteable".
> I just dont know how to navigate to the node och remove it 
> given only the "person.address.zip"-string...
> possible some sort of xquery?
> 
> 
> 
> Jacob Danner-2 wrote:
> > 
> > How is the type defined in your xsd? You may want to check your 
> > minOccurs or nillable attributes on teh xsd
> > 
> > On Dec 20, 2007 6:31 AM, janbanan <[EMAIL PROTECTED]> wrote:
> >>
> >> Hi,
> >>
> >> I trying to work with an xmlbean from a "dot-syntax" property 
> >> (lacking a better word..).
> >>
> >> What I have to go on is a string "person.address.zip" and 
> an xmlbean 
> >> Person corresponding to the xml below.
> >> What I want to do is delete the "person.address.zip" 
> element from the 
> >> bean.
> >> With beanutils I can easily get the value and change the 
> value to null.
> >> However the element would still be there, just empty...
> >>
> >> is this completely undoable? feel that way :( any input 
> appreciated!
> >> thanks
> >>
> >> <person>
> >>  <address>
> >>    <name>asdasd</name>
> >>    <street>main street</street>
> >>    <zip>12345</zip>                  <-- want to remove this
> >> completely...
> >> </address>
> >> </person>
> >>
> >> --
> >> View this message in context:
> >> 
> http://www.nabble.com/Remove-node-from-%22dot-syntax%22-tp14437537p14
> >> 437537.html Sent from the Xml Beans - User mailing list archive at 
> >> Nabble.com.
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> 
> --
> View this message in context: 
> http://www.nabble.com/Remove-node-from-%22dot-syntax%22-tp1443
> 7537p14442647.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to