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 » special character...

Post new topic  Reply to topic
 special character... « View previous topic :: View next topic » 
Author Message
stebu
PostPosted: Tue Nov 08, 2005 2:42 am    Post subject: special character... Reply with quote

Newbie

Joined: 11 Oct 2004
Posts: 7
Location: Germany

hi,

i'm trying to convert a BLOB into a XML message.

1) BLOB (XSLT-File with special characters like ',&,...) read with compute-node from DB2

SET Environment.Variables.DBResult =
THE (SELECT TOGBO.XSLT AS xslt
FROM Database.PAIADM.TOGBO AS TOGBO
WHERE TOGBO.ID=1);

2) convert the database result into xml

CREATE FIRSTCHILD OF Environment.Variables.DBxslt DOMAIN 'XML'
PARSE(CAST(Environment.Variables.DBResult.*[1] AS BLOB CCSID 1208));

SET OutputRoot.XML.ASBO1=Environment.Variables.DBxslt;
_________________________________________________________
PROBLEM:
my outputmessage don't contain any special characters

1) INPUT --> XSLT ( the BLOB i read from DB):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" id ="style">
<xsl:template match="ASBO1">
<GBO>
<Person>
<Name>
<xsl:value-of select="substring-after(/ASBO1/Name,',')"/>
</Name>
<Vorname>
<xsl:value-of select="substring-before(/ASBO1/Name,',')"/>
</Vorname>
</Person>
...

2) the generated outputmessage:
<ASBO1>
<XML>
<xsl:stylesheet>
<xmlns:xsl>http://www.w3.org/1999/XSL/Transform</xmlns:xsl>
<version>1.0</version>
<id>style</id>
<xsl:template>
<match>ASBO1</match>
<GBO>
<Person>
<Name>
<xsl:value-of></xsl:value-of>
</Name>
<Vorname>
<xsl:value-of></xsl:value-of>
</Vorname>
</Person>
....

have anybody a solution for this problem? i need the special characters in my Output XML-Message.

thanks

stebu
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Nov 08, 2005 3:21 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi stebu,

You want the output to be XML then why are u casting it as BLOB ?? Also the data you got from DB is BLOB...then why the cast ?? Did you try without the cast function....what happened ??

Can you tell us what u are expecting in the ouput ?

The special characters fail due to CCSID problems, you could map the input CCSID itself as I dont think & and ' are any special, special characters

Regards.
Back to top
View user's profile Send private message Send e-mail
stebu
PostPosted: Tue Nov 08, 2005 3:42 am    Post subject: Reply with quote

Newbie

Joined: 11 Oct 2004
Posts: 7
Location: Germany

oh, the cast... i copied an old example, sorry

Code:

CREATE FIRSTCHILD OF Environment.Variables.DB DOMAIN 'XML'
      PARSE(Environment.Variables.DBResult.*[1]);
SET OutputRoot.XML.ASBO1=Environment.Variables.DB;

i expect the following output message:
Code:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" id ="style">
<xsl:template match="ASBO1">
<GBO>
<Person>
<Name>
<xsl:value-of select="substring-after(/ASBO1/Name,',')"/>
</Name>
<Vorname>
<xsl:value-of select="substring-before(/ASBO1/Name,','))"/>
</Vorname>
</Person>
...

but i get this one:
Code:

<ASBO1>
 <XML>
  <xsl:stylesheet>
   <xmlns:xsl>http://www.w3.org/1999/XSL/Transform</xmlns:xsl>
   <version>1.0</version>
   <id>style</id>
   <xsl:template>
    <match>ASBO1</match>
    <GBO>
     <Person>
      <Name>
       <xsl:value-of></xsl:value-of>
      </Name>
      <Vorname>
       <xsl:value-of></xsl:value-of>
      </Vorname>
     </Person>
     ...
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Nov 08, 2005 3:57 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi stebu,

I have not worked with xslt from DB so i'm not sure if you have stored one BLOB string in the environment variables or u have a tree structure ?

If you have a tree structure, then you need to know that attributes dont get copied properly in the Environment (something that I learnt from the post )

http://www.mqseries.net/phpBB2/viewtopic.php?t=25089&highlight=environment+parser

If not, then look at your debug message, or put a trace and show us too....as I find a huge difference in the output from what your code seems to do...for example where do u get the first tag as ASBO1 etc....and there is much more than just your special characters missing(comparing your expected and actual ouptut)

Regards.
Back to top
View user's profile Send private message Send e-mail
jhosie
PostPosted: Tue Nov 08, 2005 7:50 am    Post subject: Reply with quote

Apprentice

Joined: 12 May 2005
Posts: 28

Hi, I think the problem is caused because you are copying from one parser (the Root parser) to another (the XML parser).
By default, the tree is owned by the root parser, untill you create a parser to own part of the tree.
For the Message Tree (OutputRoot), the parser is created implicitly to own the children of root e.g. SET OutputRoot.XML.a.b.c='something'; will implicitly create an XML parser.

For Environment, you need to explicitly create the parser.
Your CREATE FIRSTCHILD statement with the PARSE clause explicitly creates the XML parser to own that part of the Environment tree.
However, your copy is from Environment.Variables.DB which is owned by the Root parser. Only the child that you created, and everything below, is owned by the XML parser.

So to get a like for like copy, you should change your code to ...
Code:

SET OutputRoot.XML.ASBO1=Environment.Variables.DB.XML;


This should produce an output like...
Code:

<ASBO1>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" id ="style">
<xsl:template match="ASBO1">
<GBO>
<Person>
<Name>
<xsl:value-of select="substring-after(/ASBO1/Name,',')"/>
</Name>
<Vorname>
<xsl:value-of select="substring-before(/ASBO1/Name,','))"/>
</Vorname>
</Person>
</GBO>
</xsl:template>
</xsl:stylesheet>
</ASBO1>



You could go one step further and avoid the copy.
You can parse the bitstream straight into the Message by having the following code...
Code:


CREATE LASTCHILD OF OutputRoot DOMAIN 'XML'
                  PARSE(Environment.Variables.DBResult.*[1]);


This will produce the following output...

Code:


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"version="1.0" id ="style">
<xsl:template match="ASBO1">
<GBO>
<Person>
<Name>
<xsl:value-of select="substring-after(/ASBO1/Name,',')"/>
</Name>
<Vorname>
<xsl:value-of select="substring-before(/ASBO1/Name,','))"/>
</Vorname>
</Person>
</GBO>
</xsl:template>
</xsl:stylesheet>
Back to top
View user's profile Send private message
stebu
PostPosted: Wed Nov 09, 2005 12:51 am    Post subject: Reply with quote

Newbie

Joined: 11 Oct 2004
Posts: 7
Location: Germany

thanks jhosie, that's the solution of my problem

stebu
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 » special character...
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.