Combination View Flat View Tree View
Threads [ Previous | Next ]
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

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

Does that mean the XML should be encoded in order for this to work? Could you please explain that point more?

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.

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.

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

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>

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.

What about:
&#13; or &#10;

Tried those ones too...:o)
http://stackoverflow.com/questions/2004386/how-to-save-newlines-in-xml-attribute