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
Expand all | Collapse all

update using xquery - newline

  • 1.  update using xquery - newline

    Posted Thu September 23, 2004 10:29 AM

    Hi there,

    I would like to update an XML document using XQuery.

    I have got the following xquery statement:
    String updatestring = “update for $a in input()/molecule/string[@title = ‘NSC’] where $a = '”+number+“’ do insert “+include+” following $a”;

    include contains another .

    Then I do:
    TXQuery query = TXQuery.newInstance(updatestring);
    TResponse response = accessor.xquery(query);

    That works, the only problem is that I dont get
    <string …>…old…
    <string …>…new…
    but
    <string …>…old…<string …>…new…

    So there is no newline included!
    I tried a lot of different approaches, like \n or
    String newline = System.getProperty(“line.separator”);
    but the result is always the same.

    Does anybody have an idea??
    Thank you very much!


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


  • 2.  RE: update using xquery - newline

    Posted Thu September 23, 2004 06:43 PM

    I think Tamino will always strip whitespace between sibling elements unless the parent is defined as mixed content in the schema (and you might even have to specify xml:space=“preserve”). If this sort of thing is important you may be better off running query results through some sort of ?pretty printer? filter.


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