You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Jesse Pelton <js...@PKC.com> on 2003/03/19 21:34:56 UTC

RE: keep \n character

You might need to provide more details as to what you're doing, what you
expect the result to be, and what's actually happening. Code and documents
help. For instance, what do you mean "the tree doesn't keep them?" Are you
inspecting nodes in memory, serializing to disk, and/or building a tree by
parsing a document? Are you looking for <CR><LF> pairs, which XML specifies
should be normalized to <LF> (I think)?
 
-----Original Message-----
From: Pablo Yabo [mailto:pyabo@2vias.com.ar]
Sent: Wednesday, March 19, 2003 3:35 PM
To: xerces
Subject: keep \n character


Hi,
I'm creating a tree and when I add some text nodes that contains '\n'
characteres the tree doesn't keep them.
How can I keep that characteres in the tree?
 
Pablo

Re: keep \n character

Posted by Pablo Yabo <py...@2vias.com.ar>.
I didnt put my code because it's quite simple:

// var value has here several '\n' and node is a DOMNode

  XMLCh *valueCh = XMLString::transcode(value);

  // if the node is not TEXT_NODE, the content is in the child TEXT_NODE

   node->setNodeValue(valueCh);


and now if I serialize to a formtarget the tree, the '\n' doen't appear.


  ----- Original Message ----- 
  From: Jesse Pelton 
  To: 'xerces-c-dev@xml.apache.org' 
  Sent: Wednesday, March 19, 2003 5:34 PM
  Subject: RE: keep \n character


  You might need to provide more details as to what you're doing, what you expect the result to be, and what's actually happening. Code and documents help. For instance, what do you mean "the tree doesn't keep them?" Are you inspecting nodes in memory, serializing to disk, and/or building a tree by parsing a document? Are you looking for <CR><LF> pairs, which XML specifies should be normalized to <LF> (I think)?

  -----Original Message-----
  From: Pablo Yabo [mailto:pyabo@2vias.com.ar]
  Sent: Wednesday, March 19, 2003 3:35 PM
  To: xerces
  Subject: keep \n character


  Hi,
  I'm creating a tree and when I add some text nodes that contains '\n' characteres the tree doesn't keep them.
  How can I keep that characteres in the tree?

  Pablo