Author |
Message
|
FrBr |
Posted: Thu Feb 07, 2008 7:50 am Post subject: Adding xslt from DB |
|
|
Newbie
Joined: 07 Feb 2008 Posts: 4
|
I am trying to add a stylesheet to the XMLNSC tree. The stylesheet is retrieved from a database and is saved within an ESQL variable. This is done according the document "XML Transformation with WMB V6" using the following description:
Assuming that your stylesheet has been extracted from your database and stored in an ESQL variable called stylesheet, it has an id attribute defined, and your message is in the XMLNSC domain. The following ESQL statement will then let you identify it:
Listing 4. Finding a style sheet's id
DECLARE styleSheetID REFERENCE TO styleSheet.{'xsl:stylesheet'}.(XMLNSC.Attribute)id;
You can then create an embedded stylesheet name declaration for the embedded stylesheet and insert the stylesheet into the message using the following ESQL statements (assuming the name of your message body XML root is docRoot:
Listing 5. Creating an embedded style sheet name declaration and inserting a style sheet
IF LASTMOVE(styleSheetID) = TRUE THEN
-- Create embedded style sheet name declaration
SET OutputRoot.XMLNSC.(XMLNSC.ProcessingInstruction)"xml-stylesheet" =
'type="text/xsl" href="#' || styleSheetID || '"';
-- Insert style sheet
SET OutputRoot.XMLNSC.docRoot.{'xsl:stylesheet'} = styleSheet.{'xsl:stylesheet'};
END IF;[/i]
The only problem is that the data from the database is not treated as XML.
Any idea?
Thanks! |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 07, 2008 8:04 am Post subject: Re: Adding xslt from DB |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
FrBr wrote: |
The only problem is that the data from the database is not treated as XML.
|
What happens? Parser error? Any error messages? Any codes?
What level of broker?
What platform? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
FrBr |
Posted: Thu Feb 07, 2008 9:11 am Post subject: |
|
|
Newbie
Joined: 07 Feb 2008 Posts: 4
|
The error:
BIP5009E: XML Parsing Errors have occurred.
A trace-node before the transformer provides the following information:
(0x03000000):Format = ''
(0x01000000):mcd = (
(0x01000000):Msd = (
(0x02000000): = 'xmlnsc'
)
)
)
(0x01000000):XMLNSC = (
(0x01000400):XmlDeclaration = (
(0x03000100):Version = '1.0'
(0x03000100):Encoding = 'UTF-8'
)
(0x03000401):xml-stylesheet = 'type="text/xsl" href="#SHEET1"'
(0x01000000):SaleRoot = (
(0x01000000):SaleEnvelope = (
(0x03000000):Object_type = 'FRBR'
(0x03000000):Source_system = 'Client'
)
(0x03000000):xsl:stylesheet = '<xsl:stylesheet id="SHEET1" version="1.0" xmlns:xsl="http:/
/www.w3.org/1999/XSL/Transform"></xsl:stylesheet>'
Thanks! |
|
Back to top |
|
 |
kimbert |
Posted: Thu Feb 07, 2008 1:06 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You and several other users of this forum seem to have a problem getting good diagnostics from the product. I would appreciate it if you could answer a couple of questions.
Quote: |
The error:
BIP5009E: XML Parsing Errors have occurred. |
BIP5009 contains a lot more information than that. It always includes the full text of the exception reported by the internal XML scanner.
Q1 : Where did you find the text that you posted?
Q2: Was there any more text available?
Q3: If not, did it seem strange that the error message was so short?
Q4: Why didn't you take a user trace before posting this question?
Anyway, if you take a user trace you will see the full text of the exception, and you should then be able to work out what your problem is. |
|
Back to top |
|
 |
FrBr |
Posted: Fri Feb 08, 2008 12:47 am Post subject: Stylesheet from Database |
|
|
Newbie
Joined: 07 Feb 2008 Posts: 4
|
I can give the full contents of the trace but I think this won't help. It's clear that the message is causing this problem and the problem is caused by adding the stylesheet which comes from the database.
According the document (see url: http://www.ibm.com/developerworks/websphere/library/techarticles/0612_zhang/0612_zhang.html) it is possible to add a stylesheet to the message which comes from a database. This is done by adding the database contents to an ESQL variable. When I do this I am running into the parsing problem as mentioned.
1. How do I exactly add the contents of the database to an ESQL variable?
2. Do I need to do something special with the stylesheet before storing it into the database?
Thanks! |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 08, 2008 1:29 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
When I do this I am running into the parsing problem as mentioned. |
So far you have mentioned the problem, but you have not described the problem. Until we see the full text of BIP5009 we cannot help. Please take a user trace, and post the full text of BIP5009 ( please don't post the entire user trace ). |
|
Back to top |
|
 |
FrBr |
Posted: Fri Feb 08, 2008 2:23 am Post subject: |
|
|
Newbie
Joined: 07 Feb 2008 Posts: 4
|
Below the whole text of the error msg:
----------[2008-02-07 17:52:14.696509 5713 RecoverableException ]----------------------------
BIP5009E: XML Parsing Errors have occurred.
Errors have occurred during parsing of XML.
Review further error messages for an indication to the cause of the errors. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 08, 2008 2:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
FrBr wrote: |
Review further error messages for an indication to the cause of the errors. |
Which were....? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 08, 2008 3:01 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
FrBr : That is not the full text of BIP5009!! Have you taken a user trace yet? If not, why not?
( the other messages will be from higher-level components in message broker, and will not give the info that we need ). |
|
Back to top |
|
 |
|