Emmanouil Batsis wrote:
When using org.apache.xml.serialize.XMLSerializer, attributes come out
unqualified (no namespace prefix) when their parent element belongs to the
same namespace. The parent element however, does come out qualified.
It works correctly if i specify the qname (before i was
Found what was causing this.
When using setPreserveSpace(false) in the OutputFormat the serializer
converts '\n' to ' '.
What is the rationale for this?
John
> -Original Message-
> From: John Hughes [mailto:[EMAIL PROTECTED]
> Sent: 25 February 2004 11:30
> To: [EMAIL PROTECTED]
> Subje
3.
Cheers
-Original Message-From: Joseph Kesselman
[mailto:[EMAIL PROTECTED]Sent: 06 May 2003 14:30To:
[EMAIL PROTECTED]Subject: RE: XMLSerializer attributes
and carriage returns - bug?>The resulting XSLT is then misinterpreted by Xalan (matching a
space rather >than a CR o
On Tue, 2003-05-06 at 23:39, Simon Kitching wrote:
> Do you mean that you have done:
>
> Element someElement = doc.createElement("e");
> someElement.setAttribute("foo", "abc\ndef");
>
> then tried to serialize a document containing the above attribute,
> hoping to get this?
>
>
>
> but inst
On Tue, 2003-05-06 at 22:34, Thomas Greenwood wrote:
> I have an XML document that contains carriage returns and line feeds in
> attributes. When I serialize this document with XMLSerializer these
> carriage returns and line feeds appear in the output as exactly that - but
> this then causes probl
>The resulting XSLT is then misinterpreted
by Xalan (matching a space rather
>than a CR or LF)
You still haven't shown us the relevant
portion of the document. If these characters appear in an Attribute value,
that's correct parser operation per XML's rules. See http://www.w3.org/TR/REC-xml#AVNo
> When I
serialize this document with XMLSerializer these
> carriage returns and line feeds appear in the output as exactly that
- but
> this then causes problems using the document as an XSLT
It's hard to offer specific advice without seeing
a specific example, but:
1) Remember that XML normali
se functions never do anything different for attribute or element text.
Cheers
-Original Message-
From: Constantine Georges [mailto:[EMAIL PROTECTED]
Sent: 06 May 2003 13:52
To: [EMAIL PROTECTED]
Subject: Re: XMLSerializer attributes and carriage returns - bug?
Have you tried setting
Have you tried setting preserve space to true in the OutputFormat object?
I thought that XMLSerializer normalized space unless you told it otherwise.
It also truncates long lines unless you tell it otherwise. I know that
line truncation is by design, so I'm assuming that space normalization is
a
6:10
> To: [EMAIL PROTECTED]
> Subject: Re: XMLSerializer: Escaping of single quotes
>
>
> Hi Thomas,
>
> Thomas Börkel wrote:
> > The XMLSerializer escapes single quotes ('). Why? If I want
> to transfrom the string back into a Document object,
> un-escaped si
Hi Thomas,
Thomas Börkel wrote:
> The XMLSerializer escapes single quotes ('). Why? If I want to transfrom the
> string back into a Document object, un-escaped single quotes work pretty
> well. Escaping <, > and & is OK, but why '?
I believe this is done to avoid the problems in HTML (which Jo
Could you provide an example where you think single quotes are being escaped unnecessarily? I haven't seen an instance of this...
In text content of an element, we shouldn't have to escape them.
In the value of an attribute, we may have to if the value is quoted with ' characters -- but Xalan no
schke"
gmx.de> cc:
Subject: RE: XmlSerial
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 28, 2002 11:47 PM
> To: [EMAIL PROTECTED]
> Subject: RE: XmlSerializer putting xmlns="" on children of root element
>
>
>
> > Hmmm.
>
> > If you don't want the
> Hmmm.
> If you don't want the "foo" prefixes, why do you specify them? Note: it's
> perfectly OK not to specfiy a prefix when using createElementNS().
Maybe that is my problem? My understanding from the javadoc and what else I
could find to read was that, the second argument to createElementNS
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 28, 2002 10:51 PM
> To: [EMAIL PROTECTED]
> Subject: RE: XmlSerializer putting xmlns="" on children of root element
>
>
>
> Based on Neil Graham's comments, I'm cur
xception
{
throw new SAXException("Parse warning: " + se.getMessage() + " at
line " + se.getLineNumber() + " col " + se.getColumnNumber());
}
} // inner class ErrorHandler
} // class FooTest
"J
IBM Toronto Lab
Phone: 905-413-3519, T/L 969-3519
E-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED] on 02/28/2002 03:53:58 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: RE: XmlSerializer putting xmlns="" on children of root element
Then why does Xerces (and
002 03:47 cc:
PM Subject: RE: XmlSerializer
putting xmlns="" on children of root element
Please respond
NOT validate with Xerces2. The
foo prefixes on the attributes at least are a problem, though the prefixes
on the elements is not. Having prefixes on neither (which I'm trying to
get) validates also.
"Julian Reschke"
(which I'm trying to
> get) validates also.
>
>
>
>
>
>
>
>
>
> "Julian Reschke"
>
><[EMAIL PROTECTED]>
> gmx.de> cc:
>
>
"Julian Reschke"
gmx.de> cc:
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 28, 2002 6:22 PM
> To: [EMAIL PROTECTED]
> Subject: RE: XmlSerializer putting xmlns="" on children of root element
>
>
>
> What I want to end up with is a document that does not
gmx.de> cc:
cc:
AM Subject: Re: XmlSerializer
putting xmlns="" on children of root element
]
[EMAIL PROTECTED] on 02/28/2002 11:33:58 AM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: Re: XmlSerializer putting xmlns="" on children of root element
Thanks. But that doesn't seem to be the correct URL...
[
PM Subject: Re: XmlSerializer
putting xmlns="" on children of root element
Please respond
t
To create elements that are in a particular namespace, you *need* to use
createElementNS(). Using createElement() and then trying to attach a
namespace attribute is not going to work (or if it does, it's a bug and not
DOM-compliant).
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto
Hi Eric,
What version of Xerces are you using? A number of serializer bugs have
been fixed recently, so it might pay to do a CVS extract to obtain the most
recent code. (Or you can obtain recent jars from http://gump.covalent.net,
if I have the URL correct.)
Cheers,
Neil
Neil Graham
XML Parser
22, 2002 3:40 PM
To: [EMAIL PROTECTED]
Cc: Elena Litani
Subject: Re: [Fwd: RE: XMLSerializer problem]
Hi Cirip,
After struggling for more than an hour, Elena and I finally found the cause
of the problem. And it turned out to be a very interesting one: it doesn't
occur on JDK 1.2.2, and does o
fully when you download
the new jar files next week (or tomorrow), you'll see the fix.
Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]
Original Message
Subject: RE: XMLSerializer problem
Date: Thu, 21 Feb 2002 14:20:46 -0500
From: Cirip Tom
-Original Message-
From: Elena Litani [mailto:[EMAIL PROTECTED]
Sent: Thursday, Febr
Hi,
I could not reproduce your problem with the newest jars:
http://gump.covalent.net/jars/latest/xml-xerces2/
Can you verify that it is fixed in the new version?
Thank you!
Elena
Cirip Tomas wrote:
>
> Hi,
>
> I am trying to use XMLSerializer to write XML document to a file. In the
> result
Hi Mario,
I'm afraid I didn't quite understand you. String or DOM interface are
represenations of XML. They are used for different purposes. You don't need
DOM to generate output as String, you need to traverse through XML nodes.
But if you already have it you can obtain its text representation fo
This was a problem in 1.2.2 (sometimes the output was indented properly
sometimes not, with the same settings) and perhaps later but seems to be
fixed in 1.4.1.
Bob Foster
WebGain
- Original Message -
From: "Markus Klann" <[EMAIL PROTECTED]>
To: "xerces-j-user" <[EMAIL PROTECTED]>
Sent: S
When you are serializing, please ensure that you have set your OutputFormat
properties properly.
For eg, do you have OutputFormat properties set like this
OutputFormat of = new OutputFormat(doc); //Serialize DOM
of.setPreserveSpace(false);
of.setIndent(5);
of.setLineWidth(80);
it w
36 matches
Mail list logo