The "replaceAll" method of the String Class can't work, if a "?" character is in the value of an att

Discussion in 'Java' started by Ed, Sep 13, 2007.

  1. Ed

    Ed Guest

    Hi All,

    The sample code below doesn't work, but if you take out the Question
    Mark character, "?" in front of the value "Print" of the "action"
    attribute, it does work!

    Does anyone here know an other workaround? Thanks in advance!


    ////////////////////////////////////////////////////////////Sample
    code ////////////////////////////////////////////////////////
    public class Questionmark_TEST{

    public Questionmark_TEST(){}


    public static void main(String [] args){


    String XMLString="<?xml version=\"1.0\" encoding=\"UTF-8\"?
    ><categories><NodeOne action='Print?'/></categories>" ;


    String OldNode = "<NodeOne action='Print?'/>";
    String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";


    XMLString = XMLString.replaceAll(OldNode,NewNode);
    System.out.println("new XMLString : "+XMLString.toString());

    }

    }
    //////////////////////////////////////////Sample
    code ///////////////////////////////////////////////////////////////////////////////////////////////
     
    Ed, Sep 13, 2007
    #1
    1. Advertising

  2. Ed

    Ed Guest

    Hi All,

    The sample code below doesn't work, but if you take out the Question
    Mark character, "?" in front of the value "Print" of the "action"
    attribute, it does work!


    Does anyone here know an other workaround? Thanks in advance!





    ///////////Sample code //////////////////

    public class Questionmark_TEST{


    public Questionmark_TEST(){}


    public static void main(String [] args){


    String XMLString="<?xml version=\"1.0\" encoding=\"UTF-8\"?



    ><categories><NodeOne action='Print?'/></categories>" ;



    String OldNode = "<NodeOne action='Print?'/>";
    String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";

    XMLString = XMLString.replaceAll(OldNode,NewNode);
    System.out.println("new XMLString : "+XMLString.toString());



    }
    }

    ///////Sample code /////////////////
     
    Ed, Sep 13, 2007
    #2
    1. Advertising

  3. Ed

    Lew Guest

    Re: The "replaceAll" method of the String Class can't work, if a"?" character is in the value of an attribute of a XMLString!

    Ed wrote:
    > The sample code below doesn't work, but if you take out the Question
    > Mark character, "?" in front of the value "Print" of the "action"
    > attribute, it does work!
    >
    > Does anyone here know an other workaround? Thanks in advance!


    You need to watch where line breaks go in source posts to Usenet. You got a
    stray greater-than character ('>', a.k.a., "right angle bracket") that
    belonged with the xml PI, but was somehow moved to a different line.

    Also, the variable "XMLString", being a variable, should start with a
    lower-case letter, by convention.

    > public class Questionmark_TEST{
    > public Questionmark_TEST(){}
    >
    > public static void main(String [] args){
    > String XMLString =
    > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"

    +
    > "<categories><NodeOne action='Print?'/></categories>";
    >
    > String OldNode = "<NodeOne action='Print?'/>";
    > String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";
    >
    > XMLString = XMLString.replaceAll(OldNode,NewNode);
    > System.out.println("new XMLString : "+XMLString.toString());
    > }
    > }


    Did you read the Javadocs on the replaceAll() method?
    <http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAll(java.lang.String,%20java.lang.String)>

    The first argument is a regular expression, in which the question mark has
    special significance.

    --
    Lew
     
    Lew, Sep 13, 2007
    #3
  4. Ed

    Roedy Green Guest

    Re: The "replaceAll" method of the String Class can't work

    > XMLString = XMLString.replaceAll(OldNode,NewNode);

    replaceAll is not a simple string function. It is a regex function.
    replace is probably what you want - a literal replace-all.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Sep 13, 2007
    #4
  5. Ed

    Ed Guest

    On Sep 12, 11:35 pm, Lew <> wrote:
    > Ed wrote:
    > > The sample code below doesn't work, but if you take out the Question
    > > Mark character, "?" in front of the value "Print" of the "action"
    > > attribute, it does work!

    >
    > > Does anyone here know an other workaround? Thanks in advance!

    >
    > You need to watch where line breaks go in source posts to Usenet. You got a
    > stray greater-than character ('>', a.k.a., "right angle bracket") that
    > belonged with the xml PI, but was somehow moved to a different line.


    Come on, dude! Are you so stupid, to not understand that the code
    works, and you may need to move the bracket, where it supposes to be,
    when running it!

    >
    > Also, the variable "XMLString", being a variable, should start with a
    > lower-case letter, by convention.


    Where did you get that rule, Mr. Conformist!
    Don't lecture to anyone here, your nonsense rule! Try to think out of
    the box sometime!


    > > public class Questionmark_TEST{
    > > public Questionmark_TEST(){}

    >
    > > public static void main(String [] args){
    > > String XMLString =
    > > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"

    > +
    > > "<categories><NodeOne action='Print?'/></categories>";

    >
    > > String OldNode = "<NodeOne action='Print?'/>";
    > > String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";

    >
    > > XMLString = XMLString.replaceAll(OldNode,NewNode);
    > > System.out.println("new XMLString : "+XMLString.toString());
    > > }
    > > }

    >
    > Did you read the Javadocs on the replaceAll() method?
    > <http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAl...)>
    >
    > The first argument is a regular expression, in which the question mark has
    > special significance.
    >


    But you never answered my question though! Take a look what Roedy
    replied to me! That's kind of an answer, I was looking for!
     
    Ed, Sep 13, 2007
    #5
  6. Ed

    Ed Guest

    Re: The "replaceAll" method of the String Class can't work

    On Sep 13, 12:13 am, Roedy Green <>
    wrote:
    > > XMLString = XMLString.replaceAll(OldNode,NewNode);

    >
    > replaceAll is not a simple string function. It is a regex function.
    > replace is probably what you want - a literal replace-all.
    > --
    > Roedy Green Canadian Mind Products
    > The Java Glossaryhttp://mindprod.com


    Thanks, Roedy! The "replace" method did it for me!
     
    Ed, Sep 13, 2007
    #6
  7. Ed

    kcwong Guest

    On Sep 13, 3:27 pm, Ed <> wrote:
    > On Sep 12, 11:35 pm, Lew <> wrote:
    >
    > > Ed wrote:
    > > > The sample code below doesn't work, but if you take out the Question
    > > > Mark character, "?" in front of the value "Print" of the "action"
    > > > attribute, it does work!

    >
    > > > Does anyone here know an other workaround? Thanks in advance!

    >
    > > You need to watch where line breaks go in source posts to Usenet. You got a
    > > stray greater-than character ('>', a.k.a., "right angle bracket") that
    > > belonged with the xml PI, but was somehow moved to a different line.

    >
    > Come on, dude! Are you so stupid, to not understand that the code
    > works, and you may need to move the bracket, where it supposes to be,
    > when running it!
    >
    >
    >
    > > Also, the variable "XMLString", being a variable, should start with a
    > > lower-case letter, by convention.

    >
    > Where did you get that rule, Mr. Conformist!
    > Don't lecture to anyone here, your nonsense rule! Try to think out of
    > the box sometime!
    >
    >
    >
    > > > public class Questionmark_TEST{
    > > > public Questionmark_TEST(){}

    >
    > > > public static void main(String [] args){
    > > > String XMLString =
    > > > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"

    > > +
    > > > "<categories><NodeOne action='Print?'/></categories>";

    >
    > > > String OldNode = "<NodeOne action='Print?'/>";
    > > > String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";

    >
    > > > XMLString = XMLString.replaceAll(OldNode,NewNode);
    > > > System.out.println("new XMLString : "+XMLString.toString());
    > > > }
    > > > }

    >
    > > Did you read the Javadocs on the replaceAll() method?
    > > <http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAl...)>

    >
    > > The first argument is a regular expression, in which the question mark has
    > > special significance.

    >
    > But you never answered my question though! Take a look what Roedy
    > replied to me! That's kind of an answer, I was looking for!


    Tsk.

    Lew's reply contain the same information as Roedy's post. To be fair,
    Lew's reply contains *more* information than Roedy's. Lew notified
    you, politely, about the use of regular expression in
    String.replaceAll(), netiquette of using usenet, and globally accepted
    Java coding convention, while Roedy simply pointed you to what you
    need without much explanation (nothing wrong with Roedy's answer...
    but you won't really learn why unless you act by going to his site and
    read).

    And you chose to thank Roedy and spit in Lew's face.
     
    kcwong, Sep 13, 2007
    #7
  8. Ed wrote:
    ...
    >Come on, dude! Are you so stupid, to not understand that the code
    >works, and you may need to move the bracket, where it supposes to be,
    >when running it!


    Are you so stupid as to think any of us care enough to
    fix your broken(-ass) code?

    Perhaps you need a help-desk. Please be sure to mention
    how much you intend hindering them at helping you, so they
    might charge the appropriate rate.

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200709/1
     
    Andrew Thompson, Sep 13, 2007
    #8
  9. Ed

    Ed Guest

    On Sep 13, 2:17 am, "Andrew Thompson" <u32984@uwe> wrote:
    > Ed wrote:
    >
    > ..
    >
    > >Come on, dude! Are you so stupid, to not understand that the code
    > >works, and you may need to move the bracket, where it supposes to be,
    > >when running it!

    >
    > Are you so stupid as to think any of us care enough to
    > fix your broken(-ass) code?
    >
    > Perhaps you need a help-desk. Please be sure to mention
    > how much you intend hindering them at helping you, so they
    > might charge the appropriate rate.
    >
    > --
    > Andrew Thompsonhttp://www.athompson.info/andrew/
    >
    > Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200709/1


    **** off, idiot!
     
    Ed, Sep 13, 2007
    #9
  10. Ed

    Ed Guest

    On Sep 13, 2:08 am, kcwong <> wrote:
    > On Sep 13, 3:27 pm, Ed <> wrote:
    >
    >
    >
    >
    >
    > > On Sep 12, 11:35 pm, Lew <> wrote:

    >
    > > > Ed wrote:
    > > > > The sample code below doesn't work, but if you take out the Question
    > > > > Mark character, "?" in front of the value "Print" of the "action"
    > > > > attribute, it does work!

    >
    > > > > Does anyone here know an other workaround? Thanks in advance!

    >
    > > > You need to watch where line breaks go in source posts to Usenet. You got a
    > > > stray greater-than character ('>', a.k.a., "right angle bracket") that
    > > > belonged with the xml PI, but was somehow moved to a different line.

    >
    > > Come on, dude! Are you so stupid, to not understand that the code
    > > works, and you may need to move the bracket, where it supposes to be,
    > > when running it!

    >
    > > > Also, the variable "XMLString", being a variable, should start with a
    > > > lower-case letter, by convention.

    >
    > > Where did you get that rule, Mr. Conformist!
    > > Don't lecture to anyone here, your nonsense rule! Try to think out of
    > > the box sometime!

    >
    > > > > public class Questionmark_TEST{
    > > > > public Questionmark_TEST(){}

    >
    > > > > public static void main(String [] args){
    > > > > String XMLString =
    > > > > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    > > > +
    > > > > "<categories><NodeOne action='Print?'/></categories>";

    >
    > > > > String OldNode = "<NodeOne action='Print?'/>";
    > > > > String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";

    >
    > > > > XMLString = XMLString.replaceAll(OldNode,NewNode);
    > > > > System.out.println("new XMLString : "+XMLString.toString());
    > > > > }
    > > > > }

    >
    > > > Did you read the Javadocs on the replaceAll() method?
    > > > <http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAl...)>

    >
    > > > The first argument is a regular expression, in which the question mark has
    > > > special significance.

    >
    > > But you never answered my question though! Take a look what Roedy
    > > replied to me! That's kind of an answer, I was looking for!

    >
    > Tsk.
    >
    > Lew's reply contain the same information as Roedy's post.


    According to you?!?


    > To be fair,
    > Lew's reply contains *more* information than Roedy's.


    I don't need more info! If I need more info, I could have spent hours
    surfing the internet, and reading all about the String class and the
    XML specification.
    I am not a Student and don't have a time, I am a Programmer, and
    wanted to resolve my current task!

    > Lew notified
    > you, politely, about the use of regular expression in
    > String.


    Nope, he was not polite! But Roedy was polite, the other guy was kind
    of arrogant, and stupid conformist!


    > replaceAll(), netiquette of using usenet, and globally accepted
    > Java coding convention,


    Globally accepted java coding convention?!?!? Sometimes, you need to
    break stupid nonsense rules!
    I am a Programmer and I care less of those little nonsense rules which
    are not that big deal at all to me, and to anyone who is not too much
    conformist!

    > while Roedy simply pointed you to what you
    > need without much explanation (nothing wrong with Roedy's answer...
    > but you won't really learn why unless you act by going to his site and
    > read).


    No, Roedy explained intelligently, in a few words, what replaceAll
    method is all about, and the other guy, fucking mine as he is, he just
    started tell
    me the code I copied and pasted did not end with a bracket and the
    bracked was on the next line! What a stupid and arrogant answer! And
    he went on, pasting a link and telling me to read the link, and spend
    hours reading all those shit, while I don't have even enough time, to
    finish my current task!


    >
    > And you chose to thank Roedy and spit in Lew's face.- Hide quoted text -
    >
    > - Show quoted text -
     
    Ed, Sep 13, 2007
    #10
  11. Andrew Thompson, Sep 13, 2007
    #11
  12. Ed

    Roedy Green Guest

    On Thu, 13 Sep 2007 02:26:57 -0700, Ed <> wrote,
    quoted or indirectly quoted someone who said :

    >**** off, idiot!


    Unfortunately the people who are most helpful are also the most
    obsessed with details. It helps to recall you are on stage in a
    newsgroup. This is not personal mail. People are talking to the
    audience, not just to you. Letting anything slide is encouraging
    newbies to code that way.

    With only one exception, I don't plonk people who drive me nuts with
    their snarky comments. They have information I find useful, and they
    keep me on my toes.

    The disadvantage to venting is you encourage these folk you put you
    their killfiles. Without these irritating folk starting conversations
    about your problems, they can be left without response.

    P.S. Your comments in anger express an attitude that will really get
    backs up. This is a discussion forum. It's purpose is not to rapidly
    serve customers. Its purpose is to discuss and learn about Java. You
    are not _entitled_ to any sort of response at all. As soon as you
    start ordering people around as to how they are permitted to respond
    to you, tempers will flare.

    "Poor planning on your part does not constitute an emergency on my
    part."
    ~ Tee shirt slogan
    http://www.zazzle.com/your_poor_planning_not_my_emergency_tee_shirt-235372231155069406
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Sep 13, 2007
    #12
  13. Ed

    Nigel Wade Guest

    Ed wrote:

    > On Sep 13, 2:08 am, kcwong <> wrote:
    >> On Sep 13, 3:27 pm, Ed <> wrote:
    >>
    >>
    >>
    >>
    >>
    >> > On Sep 12, 11:35 pm, Lew <> wrote:

    >>
    >> > > Ed wrote:
    >> > > > The sample code below doesn't work, but if you take out the Question
    >> > > > Mark character, "?" in front of the value "Print" of the "action"
    >> > > > attribute, it does work!

    >>
    >> > > > Does anyone here know an other workaround? Thanks in advance!

    >>
    >> > > You need to watch where line breaks go in source posts to Usenet. You

    got a
    >> > > stray greater-than character ('>', a.k.a., "right angle bracket") that
    >> > > belonged with the xml PI, but was somehow moved to a different line.

    >>
    >> > Come on, dude! Are you so stupid, to not understand that the code
    >> > works, and you may need to move the bracket, where it supposes to be,
    >> > when running it!

    >>
    >> > > Also, the variable "XMLString", being a variable, should start with a
    >> > > lower-case letter, by convention.

    >>
    >> > Where did you get that rule, Mr. Conformist!
    >> > Don't lecture to anyone here, your nonsense rule! Try to think out of
    >> > the box sometime!

    >>
    >> > > > public class Questionmark_TEST{
    >> > > > public Questionmark_TEST(){}

    >>
    >> > > > public static void main(String [] args){
    >> > > > String XMLString =
    >> > > > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    >> > > +
    >> > > > "<categories><NodeOne action='Print?'/></categories>";

    >>
    >> > > > String OldNode = "<NodeOne action='Print?'/>";
    >> > > > String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";

    >>
    >> > > > XMLString = XMLString.replaceAll(OldNode,NewNode);
    >> > > > System.out.println("new XMLString : "+XMLString.toString());
    >> > > > }
    >> > > > }

    >>
    >> > > Did you read the Javadocs on the replaceAll() method?
    >> > >

    <http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAl...)>
    >>
    >> > > The first argument is a regular expression, in which the question mark

    has
    >> > > special significance.

    >>
    >> > But you never answered my question though! Take a look what Roedy
    >> > replied to me! That's kind of an answer, I was looking for!

    >>
    >> Tsk.
    >>
    >> Lew's reply contain the same information as Roedy's post.

    >
    > According to you?!?


    and me.

    >
    >
    >> To be fair,
    >> Lew's reply contains *more* information than Roedy's.

    >
    > I don't need more info! If I need more info, I could have spent hours
    > surfing the internet, and reading all about the String class and the
    > XML specification.


    So, you're lazy and can't be bothered to do the necessary research yourself. You
    come to Usenet, ask a poorly worded question and when you get politely
    corrected you become offensive. You are Twisted AICMFP.

    That really is not the way to behave if you with to get help in future.

    > I am not a Student and don't have a time, I am a Programmer, and
    > wanted to resolve my current task!


    You're a programmer? Really?

    and you think we should use our time to help lazy people who can't be bothered
    to help themselves?

    >
    >> Lew notified
    >> you, politely, about the use of regular expression in
    >> String.

    >
    > Nope, he was not polite! But Roedy was polite, the other guy was kind
    > of arrogant, and stupid conformist!


    Yes he was polite. But you can't see that.

    >
    >
    >> replaceAll(), netiquette of using usenet, and globally accepted
    >> Java coding convention,

    >
    > Globally accepted java coding convention?!?!? Sometimes, you need to
    > break stupid nonsense rules!


    Fine, be stupid and break the "stupid" rules. Don't expect any help here.

    > I am a Programmer and I care less of those little nonsense rules which
    > are not that big deal at all to me, and to anyone who is not too much
    > conformist!


    I doubt very much you really are a programmer. Maybe a programmer wannabe, but
    if you really were a programmer those "little nonsense rules" would be quite
    important to you.

    >
    >> while Roedy simply pointed you to what you
    >> need without much explanation (nothing wrong with Roedy's answer...
    >> but you won't really learn why unless you act by going to his site and
    >> read).

    >
    > No, Roedy explained intelligently, in a few words, what replaceAll
    > method is all about, and the other guy, fucking mine as he is, he just
    > started tell
    > me the code I copied and pasted did not end with a bracket and the
    > bracked was on the next line! What a stupid and arrogant answer! And
    > he went on, pasting a link and telling me to read the link, and spend
    > hours reading all those shit, while I don't have even enough time, to
    > finish my current task!


    So, once again you tell us how lazy you are, and expect that we should do your
    work for you.

    I think not.

    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
     
    Nigel Wade, Sep 13, 2007
    #13
  14. Re: The "replaceAll" method of the String Class can't work, if a"?" character is in the value of an attribute of a XMLString!

    Quick reminder to all: This is a good time to review
    http://catb.org/~esr/faqs/smart-questions.html
    .... and to remember that when someone's getting excessively angry,
    arguing with them is generally not going to improve matters.

    (Killing the thread.)

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Sep 13, 2007
    #14
  15. Ed

    Ed Guest

    On Sep 13, 3:27 am, Roedy Green <>
    wrote:
    > On Thu, 13 Sep 2007 02:26:57 -0700, Ed <> wrote,
    > quoted or indirectly quoted someone who said :
    >
    > >**** off, idiot!

    >
    > Unfortunately the people who are most helpful are also the most
    > obsessed with details.


    No, he was not helping me that much, but he wanted to be mine to me,
    when talking about the bracket issue! Tell me, how could the bracket
    bother him so much, till he wanted to tell me about it! Don't you
    sometimes have a problem, when coping and pasting the code to the
    newsgroup?

    > It helps to recall you are on stage in a
    > newsgroup.


    He will need to be have them!



    >This is not personal mail. People are talking to the
    > audience, not just to you.


    So people are being arrogant here, and I should let it go, without
    responding to them?!?!

    > Letting anything slide is encouraging
    > newbies to code that way.


    I can understand this, but he was little bit of arrogant toward me!

    > With only one exception, I don't plonk people who drive me nuts with
    > their snarky comments. They have information I find useful, and they
    > keep me on my toes.
    >
    > The disadvantage to venting is you encourage these folk you put you
    > their killfiles. Without these irritating folk starting conversations
    > about your problems, they can be left without response.
    >
    > P.S. Your comments in anger express an attitude that will really get
    > backs up. This is a discussion forum. It's purpose is not to rapidly
    > serve customers. Its purpose is to discuss and learn about Java. You
    > are not _entitled_ to any sort of response at all. As soon as you
    > start ordering people around as to how they are permitted to respond
    > to you, tempers will flare.


    Come on, Roedy! his bracket response bothered me a lot, and still
    wonder if he never had any problem coping and pasting code to a
    newsgroup!

    > "Poor planning on your part does not constitute an emergency on my
    > part."
    > ~ Tee shirt sloganhttp://www.zazzle.com/your_poor_planning_not_my_emergency_tee_shirt-2...
    > --
    > Roedy Green Canadian Mind Products
    > The Java Glossaryhttp://mindprod.com
     
    Ed, Sep 13, 2007
    #15
  16. Ed

    Ed Guest

    On Sep 13, 5:04 am, Nigel Wade <> wrote:
    > Ed wrote:
    > > On Sep 13, 2:08 am, kcwong <> wrote:
    > >> On Sep 13, 3:27 pm, Ed <> wrote:

    >
    > >> > On Sep 12, 11:35 pm, Lew <> wrote:

    >
    > >> > > Ed wrote:
    > >> > > > The sample code below doesn't work, but if you take out the Question
    > >> > > > Mark character, "?" in front of the value "Print" of the "action"
    > >> > > > attribute, it does work!

    >
    > >> > > > Does anyone here know an other workaround? Thanks in advance!

    >
    > >> > > You need to watch where line breaks go in source posts to Usenet. You

    > got a
    > >> > > stray greater-than character ('>', a.k.a., "right angle bracket") that
    > >> > > belonged with the xml PI, but was somehow moved to a different line.

    >
    > >> > Come on, dude! Are you so stupid, to not understand that the code
    > >> > works, and you may need to move the bracket, where it supposes to be,
    > >> > when running it!

    >
    > >> > > Also, the variable "XMLString", being a variable, should start with a
    > >> > > lower-case letter, by convention.

    >
    > >> > Where did you get that rule, Mr. Conformist!
    > >> > Don't lecture to anyone here, your nonsense rule! Try to think out of
    > >> > the box sometime!

    >
    > >> > > > public class Questionmark_TEST{
    > >> > > > public Questionmark_TEST(){}

    >
    > >> > > > public static void main(String [] args){
    > >> > > > String XMLString =
    > >> > > > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    > >> > > +
    > >> > > > "<categories><NodeOne action='Print?'/></categories>";

    >
    > >> > > > String OldNode = "<NodeOne action='Print?'/>";
    > >> > > > String NewNode = "<NodeOne action='Print?'>empty</NodeOne>";

    >
    > >> > > > XMLString = XMLString.replaceAll(OldNode,NewNode);
    > >> > > > System.out.println("new XMLString : "+XMLString.toString());
    > >> > > > }
    > >> > > > }

    >
    > >> > > Did you read the Javadocs on the replaceAll() method?

    >
    > <http://java.sun.com/javase/6/docs/api/java/lang/String.html#replaceAl...)>
    >
    >
    >
    > >> > > The first argument is a regular expression, in which the question mark

    > has
    > >> > > special significance.

    >
    > >> > But you never answered my question though! Take a look what Roedy
    > >> > replied to me! That's kind of an answer, I was looking for!

    >
    > >> Tsk.

    >
    > >> Lew's reply contain the same information as Roedy's post.

    >
    > > According to you?!?

    >
    > and me.
    >
    >
    >
    > >> To be fair,
    > >> Lew's reply contains *more* information than Roedy's.

    >
    > > I don't need more info! If I need more info, I could have spent hours
    > > surfing the internet, and reading all about the String class and the
    > > XML specification.

    >
    > So, you're lazy and can't be bothered to do the necessary research yourself. You
    > come to Usenet, ask a poorly worded question and when you get politely
    > corrected you become offensive. You are Twisted AICMFP.
    >
    > That really is not the way to behave if you with to get help in future.
    >
    > > I am not a Student and don't have a time, I am a Programmer, and
    > > wanted to resolve my current task!

    >
    > You're a programmer? Really?
    >
    > and you think we should use our time to help lazy people who can't be bothered
    > to help themselves?
    >
    >
    >
    > >> Lew notified
    > >> you, politely, about the use of regular expression in
    > >> String.

    >
    > > Nope, he was not polite! But Roedy was polite, the other guy was kind
    > > of arrogant, and stupid conformist!

    >
    > Yes he was polite. But you can't see that.
    >
    >
    >
    > >> replaceAll(), netiquette of using usenet, and globally accepted
    > >> Java coding convention,

    >
    > > Globally accepted java coding convention?!?!? Sometimes, you need to
    > > break stupid nonsense rules!

    >
    > Fine, be stupid and break the "stupid" rules. Don't expect any help here.
    >
    > > I am a Programmer and I care less of those little nonsense rules which
    > > are not that big deal at all to me, and to anyone who is not too much
    > > conformist!

    >
    > I doubt very much you really are a programmer. Maybe a programmer wannabe, but
    > if you really were a programmer those "little nonsense rules" would be quite
    > important to you.
    >
    >
    >
    > >> while Roedy simply pointed you to what you
    > >> need without much explanation (nothing wrong with Roedy's answer...
    > >> but you won't really learn why unless you act by going to his site and
    > >> read).

    >
    > > No, Roedy explained intelligently, in a few words, what replaceAll
    > > method is all about, and the other guy, fucking mine as he is, he just
    > > started tell
    > > me the code I copied and pasted did not end with a bracket and the
    > > bracked was on the next line! What a stupid and arrogant answer! And
    > > he went on, pasting a link and telling me to read the link, and spend
    > > hours reading all those shit, while I don't have even enough time, to
    > > finish my current task!

    >
    > So, once again you tell us how lazy you are, and expect that we should do your
    > work for you.
    >
    > I think not.
    >
    > --
    > Nigel Wade, System Administrator, Space Plasma Physics Group,
    > University of Leicester, Leicester, LE1 7RH, UK
    > E-mail :
    > Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555- Hide quoted text -
    >
    > - Show quoted text -


    An other idiot speaks! Go to hell, stupid!
     
    Ed, Sep 13, 2007
    #16
  17. Ed

    Nigel Wade Guest

    Ed wrote:

    > An other idiot speaks! Go to hell, stupid!


    Ah, now I see your wit and knowledge are boundless. I bow to your superior
    intellect and realise that I am not worthy to provide assistance to you in
    future.

    Plonk.

    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
     
    Nigel Wade, Sep 13, 2007
    #17
  18. Ed

    Lars Enderin Guest

    Re: The "replaceAll" method of the String Class can't work, if a"?" character is in the value of an attribute of a XMLString!

    Ed skrev:
    > On Sep 13, 3:27 am, Roedy Green <>
    > wrote:
    >> On Thu, 13 Sep 2007 02:26:57 -0700, Ed <> wrote,
    >> quoted or indirectly quoted someone who said :
    >>
    >>> **** off, idiot!

    >> Unfortunately the people who are most helpful are also the most
    >> obsessed with details.

    >
    > No, he was not helping me that much, but he wanted to be mine to me,
    > when talking about the bracket issue! Tell me, how could the bracket
    > bother him so much, till he wanted to tell me about it! Don't you
    > sometimes have a problem, when coping and pasting the code to the
    > newsgroup?


    The problem with the bracket was that if it starts a line, the line is
    interpreted as part of a citation, and in my newsreader and many other
    newsreaders, it is shown as a (coloured) vertical bar, not as ">". Lew
    did not tell you about it to be *mean* ("mine" is another word entirely,
    and I did not understand what you meant with it until your last post).
    You are not coping well with English. The word is "copying".

    >> It helps to recall you are on stage in a
    >> newsgroup.

    >
    > He will need to be have them!


    (behave then)
    He did behave. You don't behave very well, to say the least.

    >
    >
    >> This is not personal mail. People are talking to the
    >> audience, not just to you.

    >
    > So people are being arrogant here, and I should let it go, without
    > responding to them?!?!


    Nobody but you has been arrogant.
     
    Lars Enderin, Sep 13, 2007
    #18
  19. [OT]: Communication on Internet Forums

    Ed wrote:
    >> It helps to recall you are on stage in a
    >> newsgroup.

    >
    > He will need to be have them!
    >

    You mean behave, right?
    Well, the same goes for you, and as far as I recall, you were the one to
    open the curseword-toolbox.


    >> This is not personal mail. People are talking to the
    >> audience, not just to you.

    >
    > So people are being arrogant here, and I should let it go, without
    > responding to them?!?!
    >

    Yep. If someone insults you, he is a what? An idiot, right. Idiots don't
    have a clue and are bound to not get one, either. So why waste your time
    on arguing with clueless people who, by large, are not gonna change?

    (Which brings up an interesting point: You mentioned having no time,
    because you're a busy programmer. All the more reason to just let slip
    stuff that doesn't help you.)

    And if you really, *really* must duke these things out you can always do
    it in private email.


    >> Letting anything slide is encouraging
    >> newbies to code that way.

    >
    > I can understand this, but he was little bit of arrogant toward me!
    >

    Thats clearly a matter of personal opinion. The word "personal" implying
    that this is not to be discussed in public.


    > Come on, Roedy! his bracket response bothered me a lot, and still
    > wonder if he never had any problem coping and pasting code to a
    > newsgroup!
    >

    OK, granted. But computer people generally *are* anal. You will just
    have to live with that. Measured by the general tone on this group, I
    don't feel he was impolite. Believe me, there are raving assholes out
    here; you will have read from them, I'm sure. Lew, while certainly not
    the biggest sugartongue, is clearly one of the more helpful types around
    here.
    People who know stuff tend to get cocky, just accept it. It's not gonna
    change just because someone vents. So far it hasn't, so it probably
    never will. Therefore: Save your breath.

    /W
    (I will say this clearly: I didn't mean to attack you with this message.
    If you feel insulted by me, you really have a problem with your
    reception of written communication. Which by the way a lot of people on
    the internet seem to have.)
     
    Wildemar Wildenburger, Sep 13, 2007
    #19
  20. Ed

    Ian Wilson Guest

    Re: The "replaceAll" method of the String Class can't work, if a"?" character is in the value of an attribute of a XMLString!

    Ed wrote:
    > So people are being arrogant here, and I should let it go, without
    > responding to them?!?!


    I find it useful to read this occasionally -
    http://www.catb.org/~esr/faqs/smart-questions.html#keepcool


    > Come on, Roedy! his bracket response bothered me a lot, and still
    > wonder if he never had any problem coping and pasting code to a
    > newsgroup!


    By prefixing the code with ">" symbols you do make it a tiny bit harder
    for people who want to help you. Speaking for myself, when posting
    problems, I expend extra effort to try and make it easy for people to
    help me.

    Just my EUR 0.02 worth.
     
    Ian Wilson, Sep 13, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mladen Adamovic
    Replies:
    0
    Views:
    777
    Mladen Adamovic
    Dec 4, 2003
  2. Mladen Adamovic
    Replies:
    3
    Views:
    14,775
    Mladen Adamovic
    Dec 5, 2003
  3. Douglas Reith
    Replies:
    11
    Views:
    1,124
    Micah Cowan
    Oct 1, 2003
  4. Ed
    Replies:
    41
    Views:
    1,820
  5. Csaba  Gabor
    Replies:
    2
    Views:
    130
    Csaba Gabor
    May 4, 2006
Loading...

Share This Page