Create XML DocType element

Posted by Moro on Stack Overflow See other posts from Stack Overflow or by Moro
Published on 2010-05-18T08:53:07Z Indexed on 2010/05/18 9:10 UTC
Read the original article Hit count: 435

Filed under:
|

Hi all,

Please I am working with IBM message broker, and I want to know how to create (in java/esql) DOCTYPE element in a message as the following:

<!DOCTYPE COMMAND PUBLIC "any//DTD any//EN" "xml/command.dtd">
<COMMAND>
  ......
<COMMAND>

I tried:

MbElement root = outMessage.getRootElement().getLastChild();
MbElement xmlDocType = root.createElementAsFirstChild(MbXMLNSC.DOCUMENT_TYPE);
xmlDocType.setName("COMMAND PUBLIC");
xmlDocType.createElementAsLastChild(MbXMLNSC.Attribute, null, "any//DTD any//EN");

but no way :( it produces:

<!DOCTYPE COMMAND PUBLIC []>
    <COMMAND>
      ......
    <COMMAND>

Thanks in advance,

© Stack Overflow or respective owner

Related posts about messagebroker

Related posts about ibm