Trying to write 
 into XML document

Discussion in 'Java' started by JM, May 14, 2004.

  1. JM

    JM Guest

    Hi,

    I am trying to write the string
    into a UTF-16 XML document using
    javax.xml.parsers.DocumentBuilder and I can't get it to work. I have
    googled for a few days but cannot seem to find the solution. I am
    hoping someone here can point me in the right direction.

    Basically, I have a string containing /r/n that I am trying to write
    into a UTF-16 document as



    So far I have only got it to come out as actual carriage returns/line
    feeds or as 


    I must be missing something somewhere :(

    Any help would be greatly appreciated.

    Cheers,
    JM
    JM, May 14, 2004
    #1
    1. Advertising

  2. JM

    Gorf Guest

    <JM> wrote in message news:...
    > Hi,
    >
    > I am trying to write the string
    into a UTF-16 XML document using
    > javax.xml.parsers.DocumentBuilder and I can't get it to work. I have
    > googled for a few days but cannot seem to find the solution. I am
    > hoping someone here can point me in the right direction.
    >
    > Basically, I have a string containing /r/n that I am trying to write
    > into a UTF-16 document as


    >
    > So far I have only got it to come out as actual carriage returns/line
    > feeds or as &amp;#xD;&amp;#xA;
    >
    > I must be missing something somewhere :(
    >
    > Any help would be greatly appreciated.


    CDATA?


    --
    Gorf
    Gorf, May 14, 2004
    #2
    1. Advertising

  3. JM

    JM Guest

    On Fri, 14 May 2004 11:38:51 +0100, "Gorf" <>
    wrote:

    >> Basically, I have a string containing /r/n that I am trying to write
    >> into a UTF-16 document as


    >CDATA?


    Thanks for the reply.

    Sensible idea, but unfortunately that won't do. I have this
    application that stores its data as XML, and text entered in the
    application has it's /r/n's translated to

    , they don't use
    CDATA sections.

    I want to create the XML data files for that application via an
    automated import process, and therefore I am stuck with using the
    format they chose to use, i.e. with the converted newlines.

    Cheers,
    JM
    JM, May 14, 2004
    #3
  4. JM

    Chris Smith Guest

    JM <> wrote:
    > I am trying to write the string
    into a UTF-16 XML document using
    > javax.xml.parsers.DocumentBuilder and I can't get it to work.


    DocumentBuilder is for parsing an XML file into a document, not for
    creating an XML file from a document. What are you really trying?

    --
    www.designacourse.com
    The Easiest Way to Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, May 14, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xenia
    Replies:
    4
    Views:
    422
    Xenia
    Nov 25, 2003
  2. Tony Prichard
    Replies:
    0
    Views:
    712
    Tony Prichard
    Dec 12, 2003
  3. Manish Hatwalne
    Replies:
    1
    Views:
    390
    Martin Honnen
    Jul 13, 2004
  4. Greg Brant

    trying to document.write() a SSI

    Greg Brant, Jan 29, 2004, in forum: Javascript
    Replies:
    8
    Views:
    222
  5. jullag
    Replies:
    20
    Views:
    287
    Frances
    Sep 22, 2005
Loading...

Share This Page