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

List:       xmlbeans-dev
Subject:    RE: Namespace remove
From:       "Don Stewart" <Don.Stewart () corizon ! com>
Date:       2005-03-18 16:22:05
Message-ID: C5DAE38EC9EA674AA3CE2A7BA4B884AF19EFDF () ORION ! corizon ! com
[Download RAW message or body]

David,
 
Thanks yeah I tried something awefully similar and even checked the
removeXml() return which indicated it had done it.
 
I'll go back and find the obvious mistake :o)
 
Don

________________________________

From: Baer, David M [mailto:D1Bw@pge.com] 
Sent: 18 March 2005 16:09
To: dev@xmlbeans.apache.org
Subject: RE: Namespace remove


Here's a code fragment that I haven't run in a while, but I believe it
does just what you're asking.  Hope it helps.
 
        XmlCursor c = x.newCursor();
        c.toNextToken();
        while (c.hasNextToken())
        {
            if (c.isNamespace())
            {   
                c.removeXml();
                break;
            }
        }
        c.dispose();


________________________________

From: Don Stewart [mailto:Don.Stewart@corizon.com] 
Sent: Friday, March 18, 2005 5:40 AM
To: dev@xmlbeans.apache.org
Subject: Namespace remove


Folks,
 
Can anyone suggest the easiest way to change
 
<s0:ResolveIP xmlns:s0="http://www.cdyne.com/">

to

<s0:ResolveIP>

 

I tried XmlCursor.removeAttribute(QName) from the START. I also tried
XmlCursor.deleteXml() on the Namespace ATTR.

Thanks

 

Don


[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.2180" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=256112116-18032005><FONT face=Arial 
color=#0000ff size=2>David,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256112116-18032005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=256112116-18032005><FONT face=Arial 
color=#0000ff size=2>Thanks yeah I tried something awefully similar and even 
checked the removeXml() return which indicated it had done 
it.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256112116-18032005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=256112116-18032005><FONT face=Arial 
color=#0000ff size=2>I'll go back and find the obvious mistake 
> o)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256112116-18032005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=256112116-18032005><FONT face=Arial 
color=#0000ff size=2>Don</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Baer, David M [mailto:D1Bw@pge.com] 
<BR><B>Sent:</B> 18 March 2005 16:09<BR><B>To:</B> 
dev@xmlbeans.apache.org<BR><B>Subject:</B> RE: Namespace 
remove<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff size=2><SPAN 
class=484020516-18032005>Here's a code fragment that I haven't run in a while, 
but I believe it does just what you're asking.&nbsp; Hope it 
helps.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff 
size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XmlCursor c = 
x.newCursor();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
c.toNextToken();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while 
(c.hasNextToken())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if 
(c.isNamespace())</FONT></DIV>
<DIV dir=ltr align=left><SPAN class=484020516-18032005></SPAN><FONT 
face="Courier New" color=#0000ff size=2>&nbsp;<SPAN 
class=484020516-18032005>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 {</SPAN><SPAN 
class=484020516-18032005>&nbsp;&nbsp;&nbsp;</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 c.removeXml();</FONT></DIV>
<DIV dir=ltr align=left><FONT size=+0><SPAN 
class=484020516-18032005></SPAN><FONT color=#0000ff size=2><FONT 
face="Courier New">&nbsp;<SPAN 
class=484020516-18032005>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 break;</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT size=+0><FONT size=+0><SPAN 
class=484020516-18032005></SPAN><SPAN class=484020516-18032005></SPAN><FONT 
face="Courier New" color=#0000ff size=2>&nbsp;<SPAN 
class=484020516-18032005>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 }</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
c.dispose();<BR></FONT></DIV></FONT></FONT><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Don Stewart 
[mailto:Don.Stewart@corizon.com] <BR><B>Sent:</B> Friday, March 18, 2005 5:40 
AM<BR><B>To:</B> dev@xmlbeans.apache.org<BR><B>Subject:</B> Namespace 
remove<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=322203813-18032005><FONT face=Arial 
size=2>Folks,</FONT></SPAN></DIV>
<DIV><SPAN class=322203813-18032005><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=322203813-18032005><FONT face=Arial size=2>Can anyone suggest 
the easiest way to change</FONT></SPAN></DIV>
<DIV><SPAN class=322203813-18032005><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=322203813-18032005><FONT face="Courier New" color=#0000ff 
size=3>
<P>&lt;</FONT><FONT face="Courier New" color=#ac30bd size=3>s0:ResolveIP 
</FONT><FONT face="Courier New" color=#d00020 size=3>xmlns:s0=</FONT><FONT 
face="Courier New" color=#000090 size=3>"http://www.cdyne.com/"</FONT><FONT 
face="Courier New" color=#0000ff size=3>&gt;</FONT></P>
<P><FONT face="Courier New" color=#0000ff size=3><SPAN 
class=322203813-18032005><FONT face=Arial color=#000000 
size=2>to</FONT></SPAN></FONT></P><FONT color=#0000ff><SPAN 
class=322203813-18032005><FONT color=#0000ff>
<P><FONT face="Courier New">&lt;</FONT></FONT><FONT face="Courier New"><FONT 
color=#ac30bd>s0:ResolveIP<SPAN 
class=322203813-18032005>&gt;</SPAN></FONT></FONT></P>
<P><FONT face="Courier New"><FONT color=#ac30bd><SPAN 
class=322203813-18032005></SPAN></FONT></FONT>&nbsp;</P>
<P><FONT face="Courier New"><FONT color=#ac30bd><SPAN class=322203813-18032005>I 
tried XmlCursor.removeAttribute(QName) from the START. I&nbsp;also tried 
XmlCursor.deleteXml() on the Namespace ATTR.</SPAN></FONT></FONT></P>
<P><FONT face="Courier New"><FONT face=Arial color=#000000 size=2><SPAN 
class=322203813-18032005>Thanks</SPAN></FONT></FONT></P>
<P><FONT face="Courier New"><FONT face=Arial color=#000000 size=2><SPAN 
class=322203813-18032005></SPAN></FONT></FONT>&nbsp;</P>
<P><FONT face="Courier New"><FONT face=Arial color=#000000 size=2><SPAN 
class=322203813-18032005>Don</SPAN></FONT><FONT 
color=#0000ff></P></FONT></FONT></SPAN></FONT></SPAN></DIV></BODY></HTML>



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

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