Apostrope problem with xalan 2.7.0

Discussion in 'XML' started by Nirmal, Aug 29, 2006.

  1. Nirmal

    Nirmal Guest

    Hi everyone,

    While using xalan 2.1.0 and xerces 1.4.3 jars, the out file will have
    the "'" in place of
    " ' " Literal in input file.
    When we use the latest version of xalan 2.7.0 and xerces 2.8.0, it will
    result the same " ' " literal in out file,

    The classes and methods that we suspected regarding this conversion are


    OutputFormat format = new OutputFormat ("xml", encoding, indentResult);

    format.setOmitXMLDeclaration (true);

    serializer = new XMLSerializer (outputStream, format);



    We need "'" in output file, can anyone help me in this regard.


    Thanks and Regards
    Nirmal JS
    Nirmal, Aug 29, 2006
    #1
    1. Advertising

  2. Nirmal wrote:


    > While using xalan 2.1.0 and xerces 1.4.3 jars, the out file will have
    > the "'" in place of
    > " ' " Literal in input file.
    > When we use the latest version of xalan 2.7.0 and xerces 2.8.0, it will
    > result the same " ' " literal in out file,



    > We need "'" in output file, can anyone help me in this regard.


    Why? The only requirement to escape the single quote is if you have an
    attribute value delimited by single quotes where the value contains a
    single quote e.g.
    <element att1='&apos;'>
    Otherwise a literal single quote ' works just fine.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Aug 29, 2006
    #2
    1. Advertising

  3. In article <>,
    Nirmal <> wrote:
    >We need "&apos;" in output file, can anyone help me in this regard.


    You shouldn't rely on this. XML tools may produce any equivalent
    output (and &apos; is equivalent to an apostrophe), so you will always
    be at risk of getting the "wrong" thing if you demand &apos;.

    Of course, if you are processing the output as an XML document, it
    should work perfectly well whichever you get.

    -- Richard
    Richard Tobin, Aug 29, 2006
    #3
    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. Tobias Schierge

    Xalan document() memory problem

    Tobias Schierge, Feb 3, 2004, in forum: Java
    Replies:
    1
    Views:
    483
    Christian
    Feb 9, 2004
  2. Elpecek

    JBoss and Xalan problem ...

    Elpecek, Nov 2, 2004, in forum: Java
    Replies:
    3
    Views:
    1,179
    John C. Bollinger
    Nov 3, 2004
  3. Mark F
    Replies:
    0
    Views:
    451
    Mark F
    Mar 7, 2005
  4. Felix Engelhardt

    JAXP / Xalan / data-types problem

    Felix Engelhardt, Apr 17, 2006, in forum: Java
    Replies:
    1
    Views:
    628
    Felix Engelhardt
    Apr 18, 2006
  5. cvissy
    Replies:
    0
    Views:
    604
    cvissy
    Nov 16, 2004
Loading...

Share This Page