IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Unicode ampersand

    Posted Tue October 24, 2006 10:57 AM

    Hi,

    Using the JDOM method element.setText all ‘&’ are changed to ‘& amp ;’
    But in case of an unicode character inserted like ‘& # 123 ;’ this is not useful.

    What I’m doing:
    ContentElement is a String that I get from a html form which can contain an unicode character like ‘& # 123 ;’
    In document the unicode string is changed to ‘& amp ; # 123 ;’ by setText.
    After that I insert the document as TXMLObject in tamino.

    TXMLObjectAccessor accessor = con.newXMLObjectAccessor (...) ;
    
    Element root = new Element("Rootelement");   
    Document document = new Document(root);
    root.addContent(new Element("FirstElement").setText(ContentElement));
    
    TXMLObject xo = TXMLObject.newInstance (document);
    accessor.insert(xo);

    How can I prevent the change of an ampersand in an unicode term?
    Is there a possibility to change in document or in TXMLObject from '& amp ; # ’ to '& # ’ ?


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods


  • 2.  RE: Unicode ampersand

    Posted Tue October 24, 2006 07:06 PM

    From what I’ve seen you can’t keep JDOM from escaping the ampersand. What you need to do is translate the character reference from your input string into the correct Unicode character before invoking the setText method.


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs