ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » HTML within XML

Post new topic  Reply to topic
 HTML within XML « View previous topic :: View next topic » 
Author Message
Broady
PostPosted: Wed Sep 20, 2006 10:07 am    Post subject: HTML within XML Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Wed Sep 20, 2006 11:32 am    Post subject: Reply with quote

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
View user's profile Send private message
Broady
PostPosted: Fri Sep 22, 2006 12:27 am    Post subject: HTML within XML Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 22, 2006 3:24 am    Post subject: Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Fri Sep 22, 2006 4:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » HTML within XML
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.