Author |
Message
|
MBLearner |
Posted: Tue Jul 04, 2006 11:06 pm Post subject: line wrap in xml file |
|
|
Novice
Joined: 20 Jan 2006 Posts: 23
|
Hi,
I would to like to create one xml file where values will be separated using line wrap. For example, in the following xml file the field <Data> will have '123' and '456' separated by line break, as follows
<Data>
123
456
</Data>
How do I achieve this using esql ?
SET OutputRoot.XML.Data = '123' || <br> || '456' is not working. The <br> tag is being displayed by the browser. Any suggestion? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 04, 2006 11:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Question: Why?
XML is not intended to be directly displayed & if it is there are many way to transform it (XSLT being an obvious choice) into HTML or another display format.
Please give more details of your requirement  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jul 05, 2006 1:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
values will be separated using line wrap |
Please bear in mind that the XML specification is very clear about line breaks. They are always normalised to a single 0x0A. I hope that's the kind of line break you need  |
|
Back to top |
|
 |
MBLearner |
Posted: Wed Jul 05, 2006 11:31 pm Post subject: |
|
|
Novice
Joined: 20 Jan 2006 Posts: 23
|
Thanks for the reply.
I am not sure how to implement line break in XML file using single 0x0A. Everything I write it's treated as character. Any help? |
|
Back to top |
|
 |
shalabh1976 |
Posted: Wed Jul 05, 2006 11:50 pm Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Use CAST( <HexValue> AS CHAR CCSID value) _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
MBLearner |
Posted: Thu Jul 06, 2006 12:01 am Post subject: |
|
|
Novice
Joined: 20 Jan 2006 Posts: 23
|
I tried with that also. Always taking char value of the Hex. Please note that this is within the XML message, not any TDS or CWF flat file message. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 06, 2006 12:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I'm still not clear what you're trying to achieve...?
(There may be a different & easier way of achieving the same effect you see) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 06, 2006 12:33 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
When I said this:
Quote: |
Please bear in mind that the XML specification is very clear about line breaks. They are always normalised to a single 0x0A. I hope that's the kind of line break you need |
...I was not instructing you to insert 0x0A into your XML character stream ( although you can if you want to). I was simply pointing out that if you insert any other kind of line break, the next XML processor to parse the document will replace it with 0x0A.
If you still don't understand my point, read this: http://www.w3.org/TR/REC-xml/#sec-line-ends |
|
Back to top |
|
 |
MBLearner |
Posted: Thu Jul 06, 2006 2:00 am Post subject: |
|
|
Novice
Joined: 20 Jan 2006 Posts: 23
|
I would like to insert a line wrap in the xml document. It may not appear as normal line wrap like other editors (XSL or HTML) but from esql i would like to insert CARRIAGE RETURN (#xD) and LINE FEED (#xA) in one of the XML fields. For example, If I have two strings like '123' and '456', I just would like to append these two strings in a xml field with a Carriage Return and Line Feed using the ESQL. How can that be achieved? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 06, 2006 2:02 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MBLearner wrote: |
I would like to insert a line wrap in the xml document. It may not appear as normal line wrap like other editors (XSL or HTML) but from esql i would like to insert CARRIAGE RETURN (#xD) and LINE FEED (#xA) in one of the XML fields. For example, If I have two strings like '123' and '456', I just would like to append these two strings in a xml field with a Carriage Return and Line Feed using the ESQL. How can that be achieved? |
Okay, but I still don't see the purpose of control characters in the body of an XML tag.
Maybe I'm just being thicker than normal  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|