cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2362
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Maroun Baydoun on 22-07-2009 09:02:18 AM
Hello, how can I include a new line charater in an XML document. I tried using \n and other characters but they just show a is on the phone display. I need to know which character should be used to jump on a new line such as in a CiscoIPPhoneText

Subject: RE: XML new line character
Replied by: David Staudt on 22-07-2009 11:04:27 PM
You will use the new line character, i.e 0x0A.  In the raw XML, this appears as simply the byte value - no special escape sequence. 
 
As an example, if you are posting a CiscoIPPhoneText object via Push, the URL encoded XML string may look something like:
 
%3CCiscoIPPhoneText%3E%3CText%3Ethis%20is%0Atext%3C%2FText%3E%3C%2FCiscoIPPhoneText%3E

Subject: RE: XML new line character
Replied by: Maroun Baydoun on 23-07-2009 07:54:51 AM
Does that mean the XML should be encoded in order for this to work? Could you please explain that point more?

Subject: RE: XML new line character
Replied by: Steve Cox on 23-07-2009 03:22:27 PM
I have found \n works in java.  I have the following in a test jsp page:
 
out.print("XML=<CiscoIPPhoneText><Title>Messages</Title>Msg 4<Text>Message Number 4\nNext line of the message.\nYet another line.</Text><SoftKeyItem><Name>Next &gt;</Name><URL>"+basePath+"MessageManager.jsp&amp;msgId=4"+"</URL>SoftKey:Update</SoftKeyItem><SoftKeyItem><Name>&lt; Previous</Name><URL>"+basePath+"MessageManager.jsp&amp;msgId=2"+"</URL>SoftKey:Exit</SoftKeyItem></CiscoIPPhoneText>");
 
And I get mutliple lines.

Subject: RE: XML new line character
Replied by: Maroun Baydoun on 24-07-2009 06:39:02 AM
I am using Java,but I'm not using your method to generate the XML. Instead I'm using SAX to create a well-formed XML document.

Subject: RE: XML new line character
Replied by: Steve Cox on 03-05-2011 02:41:51 PM
I haven't done much with this lately.  Have you tried <p /> or <br />, like:

<Name>Lalit Jairath <p /> Communications</Name>
or
<Name>Lalit Jairath <br /> Communications</Name>

Subject: RE: XML new line character
Replied by: Steve Cox on 03-05-2011 03:02:58 PM
What about:
&#13; or &#10;

Subject: RE: XML new line character
Replied by: Lalit jairath on 03-05-2011 02:29:18 PM
We have started finding issues with "\n" on new phones 7942/7962 when upgraded Call Manager from 4.1(3) to 7.1(5).

What we have started seeing is that on 7942/7962 the value of "Name" tag for the "DirectoryEntry" tag gets truncated to the following with the last three characters "ath" replaced by "..."

- <DirectoryEntry>
  <Name>Lalit Jairath Communicati...</Name>
  <Telephone>58754</Telephone>
  </DirectoryEntry>

Note: the name on the phone screen should display as "Lalit Jairath Communications". The <Name> is coded as "Lalit Jairath" + "\n" + "communications". On phones 7942/7962 the Name below is displayed as intended:

- <DirectoryEntry>
  <Name>Lalit Jairath
              Communications</Name>
  <Telephone>58754</Telephone>
  </DirectoryEntry>


However, "\n" still works for both 7940/7960.

Phone firmware for 7940/60 is  8.1(2) and for 7942/62 is 9.1(1).

Does anybody experience the same and have any clue.

Thanks.
Lalit

Subject: RE: XML new line character
Replied by: Lalit jairath on 03-05-2011 02:55:33 PM
Thanks, Steve for prompt response. Like you said we've tried everything possible including <cdata> , "&#xA;" ,"&#xD;" as well as <p /> <br /> etc.

The display problem is only with 7942/7962. Phones 7940/7960 work fine.

Subject: RE: XML new line character
Replied by: Lalit jairath on 03-05-2011 03:10:51 PM
Tried those ones too...:o)
http://stackoverflow.com/questions/2004386/how-to-save-newlines-in-xml-attribute
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links