Author |
Message
|
Broady |
Posted: Wed Sep 20, 2006 10:07 am Post subject: HTML within XML |
|
|
 Novice
Joined: 16 Apr 2004 Posts: 23 Location: Halifax, West Yorkshire, England
|
I am using WBIMB v5 on UNIX AIX 5.3.
How do I include a HTML document within my XML?
Would I use a Message Set or code it in ESQL?
The data is arriving in an XML message (non MRM), and then I need to output an XML message housing a HTML layout, in addition to it being in Base 64.
But I don't know where to start producing the HTML.
An example layout is..
<REQUEST
BusArea="9"
Brand="1"
PTS="1270"
Process="176"
Index1=" D/1234567"
BBU=""
AllowMultpleCaseUpdate="FALSE"
SiteCode=""
DiaryDays=""
DiaryDate=""
CompleteCase="FALSE">
<DATACAPTURE/>
<HISTORY Category=""/>
<DOCUMENTS>
<DOCUMENT xmlns:dt="urn:schemas-microsoft-com:datatypes"
dt:dt="bin.base64"
Type="MSG"
DocType="NAMEADD"
Format="HTML"
StyleSheet="">[here is the Base 16 BINARY DATA that was HTML]
</DOCUMENT>
</DOCUMENTS>
</REQUEST> _________________ Alan Broadbent |
|
Back to top |
|
 |
kimbert |
Posted: Wed Sep 20, 2006 11:32 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
How do I include a HTML document within my XML? |
It's definitely a good idea to base64-encode the HTML ( so you're on the right track there). I would do it this way:
- Create a message set with an XML physical format.
- In the XML message set properties, find the 'Root Tag Name' property and set it to empty string ( it defaults to 'MRM' in v5 ).
- Create a message definition which includes an element of type 'base64' at the appropriate position. Let's call the base64 element 'Layout'
- Ensure that the 'Encoding' property in the XML settings for element 'Layout' is set to 'base64'
- In your message flow, construct the output message tree. Your element 'Layout' should be a BLOB containing the HTML text.
- Make very sure that the output message tree exactly matches the structure of your message definition
- Set OutputRoot.Properties.MessageDomain/MessageSet/MessageType/ MessageFormat to match your definitions. You can use an RCD node if you want to.
- Send the message to an output node and let the MRM do the base64 encoding for you. |
|
Back to top |
|
 |
Broady |
Posted: Fri Sep 22, 2006 12:27 am Post subject: HTML within XML |
|
|
 Novice
Joined: 16 Apr 2004 Posts: 23 Location: Halifax, West Yorkshire, England
|
Thanks, as that answers a Base 64 translation question.
But my initial question is how to create the HTML in WBIMB v5?
I need to produce an HTML layout to a given template and add in the runtime data from an XMl message.
The HTML will be within an XML ouput message as I pictured previously.
Are there special MRM settings for this, or plugin nodes? Simply put what coding would I use? _________________ Alan Broadbent |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Sep 22, 2006 3:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I guess I would store the HTML template in a database or something, fetch it with ESQL as a big STRING and use Overlay to replace known template strings with XML values.
But that's only because I'm too stubborn to use XSLT. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Sep 22, 2006 4:19 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Let me check that I understand your requirements:
1. You will receive an XML message containing some data
2. You will use that data to populate an HTML template, producing a HTML document. I'm assuming that your template is a string containing inserts which need to be replaced with real data.
3. You then want to wrap the HTML document within an XML output message, enoding it as base64.
Assuming that those assumptions are correct:
1. is easy
2. I suspect that either XSLT or a Java Compute Node will be the best approach. There are probably Java libraries for this kind of thing.
3. See previous post. |
|
Back to top |
|
 |
|