Author |
Message
|
ydsk |
Posted: Wed Apr 04, 2007 7:31 am Post subject: newline in a xml tag value |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Hi,
Is it possible to create a tag like <tag>AB \n CD</tag> , where \n is a newline ?
Not sure how the target system would interpret that but I am trying to know if such a thing is even possible in ESQL..
Pls reply.
thanks.
ydsk. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 04, 2007 7:39 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You'd need to include the \n as markup, in the same way if you need a < in an XML tag you'd need to mark it up as <.
There's a list of valid markup in the W3C XML standards doc. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 04, 2007 7:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can add a newline to any ESQL value by enclosing a newline in single-quotes.
Or you can cast the appropriate hex values to characters, and use that.
Vitor - newlines are not significant in XML, there's no entity for it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 04, 2007 7:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
Vitor - newlines are not significant in XML, there's no entity for it. |
No, you're right, they're not. You have to include them as hex values (&#A) if they're included.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 04, 2007 7:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
In element content, it's perfectly fine to use plain newlines (whatever one considers to be a plain newline).
One may or may not reasonably expect them to be preserved as such, however.
In element names, one should a) not use newlines, b) not expect them to be preserved. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jsware |
Posted: Wed Apr 04, 2007 8:49 am Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
Vitor wrote: |
You'd need to include the \n as markup, in the same way if you need a < in an XML tag you'd need to mark it up as <.
There's a list of valid markup in the W3C XML standards doc. |
In ESQL you should be able to use something like:
Code: |
set OutputRoot.XML.MyElement = '<'; |
And it gets marked up into:
Code: |
<MyElement><</MyElement> |
for you.
Lets not start the debate about XML being deprecated - pleeasse  _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
|