Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Appendix C Creating XML Documents : Customizing XML Declarations

Customizing XML Declarations
This section shows you how to customize the XML namespaces that are based on the function XMLDOCNAMESPACE called from the rule XMLSTART4 to produce the soap:Envelope portion of the XML request message. See the following figure.
 
Here is the procedure:
1.
Create a copy of the BOOKS XML document and name it BOOKS_XMLNS.
2.
Delete all the consumption rules and define a new preprocess production rule BOOKS_XMLNS_PRE. Leave all the other settings unchanged.
The resulting XML document looks like this:
 
3.
Create a rule BOOKS_NAMESPACE that contains the required SOAP envelope element in NEW_FIELD_VALUE, which will be used in the XMLDOCNAMESPACE rule, as illustrated here:
 
4.
Create a rule BOOKS_XMLNS_PRE, which sets a local variable NSRULE to enable BOOKS_NAMESPACE to run, as illustrated here:
 
5.
Run the XML document BOOKS_XMLNS_PRE. The result looks like this:

 
End message:
OK
 
<?xml version="1.0" ?>
<!-- XMLDocName=BOOKS_XMLNS -->
<!-- Generated By ObjectStar Integration Gateway V2.5 - Code Level 1.00 -->
<bookstore xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<book KEY="1">
<bktitle genre="Classics">The Odysey</bktitle>
<price>2.98</price>
<Name>
</Name>
</book>
<book KEY="2">
<bktitle genre="Literature and Fiction">Pride and Prejudice</bktitle>
<price>4.80</price>
<Name>
<author_fn author_ln="Austin">Jane</author_fn>
</Name>
</book>
<book KEY="3">
<bktitle genre="Science Fiction">Stranger In A Strange Land</bktitle>
<price>7.99</price>
<Name>
<author_fn author_ln="Heinlein">Robert A</author_fn>
</Name>
</book>
<book KEY="4">
<bktitle genre="Science Fiction">I, Robot</bktitle>
<price>5.99</price>
<Name>
<author_fn author_ln="Asimov">Isaac</author_fn>
</Name>
</book>
...

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved