Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Apostrope problem with xalan 2.7.0

Reply
Thread Tools

Apostrope problem with xalan 2.7.0

 
 
Nirmal
Guest
Posts: n/a
 
      08-29-2006
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

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      08-29-2006


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/
 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      08-29-2006
In article <(E-Mail Removed) .com>,
Nirmal <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JAXP / Xalan / data-types problem Felix Engelhardt Java 1 04-18-2006 03:16 PM
Xalan, Xerces Problem finding Default Provider Mark F Java 0 03-07-2005 07:02 PM
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM
JBoss and Xalan problem ... Elpecek Java 3 11-03-2004 11:13 PM
Xalan document() memory problem Tobias Schierge Java 1 02-09-2004 08:43 AM



Advertisments