You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Gregor Karlinger <gr...@iaik.at> on 2000/07/06 12:36:27 UTC

Q: Serializing a DOM Document

Hi all!

I am currently struggling with serializing a manually built
DOM Document; as an example, consider this one:

- a Document Element named "root"

- a single child Element in root, called "child"

- "child" has one child node of type Text; this text has the value
  "FirstLine\nSecondLine"

Now, what I want is a serialization result, which includes line
breaks and indentations reflecting the structure of my DOM document,
but does not change the text value, i.e. the result should look like:

<root>
  <child>FirstLine
SecondLine</child>
<root>

The problem I am facing is that I must switch of the preserveSpace
options, otherwhise the indentation of "child" will not be done, but
then the newLine character in my text value is changed into a space,
which must not happen in my special case. So, to summarize, the two
results I can produce are:

(1) indentation=true, preserveSpace=true

<root><child>FirstLine
SecondLine</child></root>

(2) indentation=true, preserveSpace=false

<root>
  <child>FirstLine SecondLine</child
</root>

I am aware of the option in OutputFormat, to specify a
list of Elements, whose text nodes will be printed unescaped,
but this is not fitting in my case, since I don't know which
Elements will be put into my DOM document.

My question now is, why are text values changed, if preserveSpace
is set to false? At least I think there should be an option to
switch off these changes to text values.

  
Regards, Gregor
---------------------------------------------------------------
Gregor Karlinger
mailto://gregor.karlinger@iaik.at
http://www.iaik.at
Phone +43 316 873 5541
Institute for Applied Information Processing and Communications
Austria
---------------------------------------------------------------
 

Re: missing org.w3c.dom.DocumentType methods in xerces.jar in Xerces-J-bin.1.1.2.zip

Posted by Jose Correia <jo...@exinet.co.za>.
Hi Robert

I also encountered a few problems when compiling with sun's jdk, apparently they
don't sort out dependencies as well as they should. I then got jikes111 compiler
and it works quite nicely. It also has the bonus of being a lot faster that
Sun's compiler.

Cheers
Jose

"Robert E. Newby" wrote:

> Hi Eric,
>
> FYI, after deleting all previous Xerces downloads, etc. from my system I
> reinstalled the source distribution (from Xerces-J-src.1.1.2.zip) and then
> ran "make jars", which of course resets the javac class path as needed.  The
> results, where DocumentType is concerned, are *the same as before*.
>
> Here is the output from "javap -public org.w3c.dom.DocumentType" on the
> DocumentType.class file created by the "make jars" script:
>
> Compiled from DocumentType.java
> public interface org.w3c.dom.DocumentType extends org.w3c.dom.Node
>     /* ACC_SUPER bit NOT set */
> {
>     public abstract org.w3c.dom.NamedNodeMap getEntities();
>     public abstract java.lang.String getName();
>     public abstract org.w3c.dom.NamedNodeMap getNotations();
> }
>
> This despite the fact that the other three (3) public declarations are
> indeed in the source file.  Go figure!  Of course, the xerces.jar shows the
> same set of public method declarations, and not the others that are in the
> source file.
>
> For what it's worth, I am beginning to suspect that this is some sort of
> obscure JVM issue -- I am running Sun's J2SE JDK/JRE 1.3 FCS (build
> 1.3.0-C), with the Java HotSpot Client, on Windows NT 4 SP6a.  The reason I
> say this is (i) because of the above and (ii) because the other instances of
> xerces.jar that are in different download directories on my system (e.g.,
> the one that ships with Apache ecs, and the one that ships with Apache
> xalan) also are *not* showing anything but those 3 methods listed above when
> I look inside them at the compiled DocumentType class.
>
> I will now stop trying to rectify this on my end, unless you have other
> ideas as to what may be wrong.  (Again, there are no other occurrences of
> org.w3c.dom on my system, anywhere.)
>
> Regards,
>
> Bob
> --
>
> Robert E. Newby
> Renew Associates
> Java 2 and XML Distributed & Enterprise Contracting
> Bob_Newby@renewassoc.com
> www.renewassoc.com
>
> ----- Original Message -----
> From: "Robert E. Newby" <Bo...@renewassoc.com>
> To: <xe...@xml.apache.org>; "Eric Ye" <er...@locus.apache.org>
> Sent: Thursday, July 06, 2000 6:01 PM
> Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
> Hi again, Eric.  I am compiling Xerces1.1.2 from the distributed sources
> right now, using the "make jars" script.  Hopefully that will resolve
> things.  If not, you all will hear from me again.
>
> Regards,
>
> Bob
>
> --
>
> Robert E. Newby
> Renew Associates
> Java 2 and XML Distributed & Enterprise Contracting
> Bob_Newby@renewassoc.com
> www.renewassoc.com
>
> ----- Original Message -----
> From: "Eric Ye" <er...@locus.apache.org>
> To: <xe...@xml.apache.org>
> Sent: Thursday, July 06, 2000 5:13 PM
> Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
> Hi, Bob,
> I just ran "javap -public org.w3c.dom.DocumentType" on the
> DocumentType.class that i extracted from "xerces.jar" in 1.1.2 distribution.
> it gives me back both "getSystemId" and "getPublicId" methods.
> You may want to try to compile your program with "javac -classpath
> ...\...\xerces.jar" instead of relying on the jar file placed in the
> jre\lib\ext dir, see if the same problem still pop up.
> _____
>
> Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org
>
> ----- Original Message -----
> From: "Robert E. Newby" <Bo...@renewassoc.com>
> To: <xe...@xml.apache.org>; "Eric Ye" <er...@locus.apache.org>
> Sent: Thursday, July 06, 2000 1:20 PM
> Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
> > Hi Eric,
> >
> > No, it's not a classpath issue; I do not use class path at all.  Rather, I
> > use the Java 2 Platform's Extension Mechanism, which provides for placing
> > jars in $JAVA_HOME$\jre\lib\ext, and none of the other jars there contain
> > the package(s) in question.  This is the first time I have downloaded
> > anything containing those packages.
> >
> > Also, as I said, my IDE (Sun's Forte for Java) allows me to peek inside a
> > jar in order to check out a compiled class's members.  In this case, these
> > are as I stated in my previous email, which is to say that they are
> > definitely not all there.  Also, I downloaded the zip in question twice,
> > just to double check my findings.  No change -- I cannot compile when that
> > interface's getPublicId and getSystemId methods are referenced directly,
> > either from within Forte or external to it.
> >
> > This is not a problem that will hinder me; but I do suspect there is a
> snafu
> > in the latest build process.  In the meantime, I will probably just
> compile
> > that class from source myself and stuff it into the jar.
> >
> > Thanks,
> >
> > Bob
> >
> >
> > ----- Original Message -----
> > From: "Eric Ye" <er...@locus.apache.org>
> > To: <xe...@xml.apache.org>
> > Sent: Thursday, July 06, 2000 3:08 PM
> > Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
> > Xerces-J-bin.1.1.2.zip
> >
> >
> > Couldn't reproduce your problem(I have a program that invoke the 2
> methods
> > your reported missing) , could there be some problem with your classpath?
> > e.g. other jar file that also include org.w3c.dom package which is out of
> > date.
> > Try clean up your classpath with just
> > "...\...\xerces.jar;...\...\xercesSamples.jar;."
> > _____
> >
> >
> > Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org
> >
> > ----- Original Message -----
> > From: "Robert E. Newby" <Bo...@renewassoc.com>
> > To: <xe...@xml.apache.org>
> > Cc: <br...@newInstance.com>
> > Sent: Thursday, July 06, 2000 11:49 AM
> > Subject: BUG: missing org.w3c.dom.DocumentType methods in xerces.jar in
> > Xerces-J-bin.1.1.2.zip
> >
> >
> > > To whom it may concern:
> > >
> > > I recently downloaded and installed the latest binary distribution of
> > Xerces
> > > (Xerces-J-bin.1.1.2.zip), and have been using that distribution's
> > xerces.jar
> > > dated Friday, June 23, 2000 3:47:38 PM.
> > >
> > > While compiling code (in conjunction with my reading of the new O'Reilly
> > > book Java and XML), I discovered that this jar's
> org.w3c.dom.DocumentType
> > > class (i.e., interface) is *missing* at least two (2) method
> declarations,
> > > namely:
> > > * getPublicId
> > > * getSystemId
> > >
> > > An inspection of this jar using my IDE shows the following three (3)
> > method
> > > declarations for org.w3c.dom.DocumentType, and no others:
> > > * getEntities
> > > * getName
> > > * getNotations
> > >
> > > This is in contrast to the Xerces 1.1.2 API documentation (plus the
> source
> > > packaged with Xerces-J-src.1.1.2.zip), which includes the following six
> > (6)
> > > method declarations:
> > > * getEntities
> > > * getInternalSubset
> > > * getName
> > > * getNotations
> > > * getPublicId
> > > * getSystemId
> > >
> > > For now, I am working around this by directly using the concrete class
> > > org.apache.xerces.dom.DocumentTypeImpl.
> > >
> > > Regards,
> > >
> > > Bob
> > >
> > > --
> > >
> > > Robert E. Newby
> > > Renew Associates
> > > Java 2 and XML Distributed & Enterprise Contracting
> > > Bob_Newby@renewassoc.com
> > > www.renewassoc.com
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

--

                \=/,         _-===-_-===-_-===-_-===-_-==-_
                |  @___oo  (                               )_
      /\  /\   / (___,,,}_--=                                )
     ) /^\) ^\/ _)        =_"Positive thinking - a great way  )
     )   /^\/   _)         (_        to face life"             )
     )   _ /  / _)          (        Jose Correia            )
 /\  )/\/ ||  | )_)          (_    jose@exinet.co.za        )
<  >      |(,,) )__)           (   jcorreia@global.co.za    )
 ||      /    \)___)\           (_                        _)
 | \____(      )___) )___          -==-_______-=====-___==
  \______(_______;;; __;;;



Re: missing org.w3c.dom.DocumentType methods in xerces.jar in Xerces-J-bin.1.1.2.zip

Posted by "Robert E. Newby" <Bo...@renewassoc.com>.
Hi Eric,

FYI, after deleting all previous Xerces downloads, etc. from my system I
reinstalled the source distribution (from Xerces-J-src.1.1.2.zip) and then
ran "make jars", which of course resets the javac class path as needed.  The
results, where DocumentType is concerned, are *the same as before*.

Here is the output from "javap -public org.w3c.dom.DocumentType" on the
DocumentType.class file created by the "make jars" script:

Compiled from DocumentType.java
public interface org.w3c.dom.DocumentType extends org.w3c.dom.Node
    /* ACC_SUPER bit NOT set */
{
    public abstract org.w3c.dom.NamedNodeMap getEntities();
    public abstract java.lang.String getName();
    public abstract org.w3c.dom.NamedNodeMap getNotations();
}

This despite the fact that the other three (3) public declarations are
indeed in the source file.  Go figure!  Of course, the xerces.jar shows the
same set of public method declarations, and not the others that are in the
source file.

For what it's worth, I am beginning to suspect that this is some sort of
obscure JVM issue -- I am running Sun's J2SE JDK/JRE 1.3 FCS (build
1.3.0-C), with the Java HotSpot Client, on Windows NT 4 SP6a.  The reason I
say this is (i) because of the above and (ii) because the other instances of
xerces.jar that are in different download directories on my system (e.g.,
the one that ships with Apache ecs, and the one that ships with Apache
xalan) also are *not* showing anything but those 3 methods listed above when
I look inside them at the compiled DocumentType class.

I will now stop trying to rectify this on my end, unless you have other
ideas as to what may be wrong.  (Again, there are no other occurrences of
org.w3c.dom on my system, anywhere.)

Regards,

Bob
--

Robert E. Newby
Renew Associates
Java 2 and XML Distributed & Enterprise Contracting
Bob_Newby@renewassoc.com
www.renewassoc.com


----- Original Message -----
From: "Robert E. Newby" <Bo...@renewassoc.com>
To: <xe...@xml.apache.org>; "Eric Ye" <er...@locus.apache.org>
Sent: Thursday, July 06, 2000 6:01 PM
Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


Hi again, Eric.  I am compiling Xerces1.1.2 from the distributed sources
right now, using the "make jars" script.  Hopefully that will resolve
things.  If not, you all will hear from me again.

Regards,

Bob

--

Robert E. Newby
Renew Associates
Java 2 and XML Distributed & Enterprise Contracting
Bob_Newby@renewassoc.com
www.renewassoc.com


----- Original Message -----
From: "Eric Ye" <er...@locus.apache.org>
To: <xe...@xml.apache.org>
Sent: Thursday, July 06, 2000 5:13 PM
Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


Hi, Bob,
I just ran "javap -public org.w3c.dom.DocumentType" on the
DocumentType.class that i extracted from "xerces.jar" in 1.1.2 distribution.
it gives me back both "getSystemId" and "getPublicId" methods.
You may want to try to compile your program with "javac -classpath
...\...\xerces.jar" instead of relying on the jar file placed in the
jre\lib\ext dir, see if the same problem still pop up.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Robert E. Newby" <Bo...@renewassoc.com>
To: <xe...@xml.apache.org>; "Eric Ye" <er...@locus.apache.org>
Sent: Thursday, July 06, 2000 1:20 PM
Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


> Hi Eric,
>
> No, it's not a classpath issue; I do not use class path at all.  Rather, I
> use the Java 2 Platform's Extension Mechanism, which provides for placing
> jars in $JAVA_HOME$\jre\lib\ext, and none of the other jars there contain
> the package(s) in question.  This is the first time I have downloaded
> anything containing those packages.
>
> Also, as I said, my IDE (Sun's Forte for Java) allows me to peek inside a
> jar in order to check out a compiled class's members.  In this case, these
> are as I stated in my previous email, which is to say that they are
> definitely not all there.  Also, I downloaded the zip in question twice,
> just to double check my findings.  No change -- I cannot compile when that
> interface's getPublicId and getSystemId methods are referenced directly,
> either from within Forte or external to it.
>
> This is not a problem that will hinder me; but I do suspect there is a
snafu
> in the latest build process.  In the meantime, I will probably just
compile
> that class from source myself and stuff it into the jar.
>
> Thanks,
>
> Bob
>
>
> ----- Original Message -----
> From: "Eric Ye" <er...@locus.apache.org>
> To: <xe...@xml.apache.org>
> Sent: Thursday, July 06, 2000 3:08 PM
> Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
>
> Couldn't reproduce your problem(I have a program that invoke the 2
methods
> your reported missing) , could there be some problem with your classpath?
> e.g. other jar file that also include org.w3c.dom package which is out of
> date.
> Try clean up your classpath with just
> "...\...\xerces.jar;...\...\xercesSamples.jar;."
> _____
>
>
> Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org
>
> ----- Original Message -----
> From: "Robert E. Newby" <Bo...@renewassoc.com>
> To: <xe...@xml.apache.org>
> Cc: <br...@newInstance.com>
> Sent: Thursday, July 06, 2000 11:49 AM
> Subject: BUG: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
>
> > To whom it may concern:
> >
> > I recently downloaded and installed the latest binary distribution of
> Xerces
> > (Xerces-J-bin.1.1.2.zip), and have been using that distribution's
> xerces.jar
> > dated Friday, June 23, 2000 3:47:38 PM.
> >
> > While compiling code (in conjunction with my reading of the new O'Reilly
> > book Java and XML), I discovered that this jar's
org.w3c.dom.DocumentType
> > class (i.e., interface) is *missing* at least two (2) method
declarations,
> > namely:
> > * getPublicId
> > * getSystemId
> >
> > An inspection of this jar using my IDE shows the following three (3)
> method
> > declarations for org.w3c.dom.DocumentType, and no others:
> > * getEntities
> > * getName
> > * getNotations
> >
> > This is in contrast to the Xerces 1.1.2 API documentation (plus the
source
> > packaged with Xerces-J-src.1.1.2.zip), which includes the following six
> (6)
> > method declarations:
> > * getEntities
> > * getInternalSubset
> > * getName
> > * getNotations
> > * getPublicId
> > * getSystemId
> >
> > For now, I am working around this by directly using the concrete class
> > org.apache.xerces.dom.DocumentTypeImpl.
> >
> > Regards,
> >
> > Bob
> >
> > --
> >
> > Robert E. Newby
> > Renew Associates
> > Java 2 and XML Distributed & Enterprise Contracting
> > Bob_Newby@renewassoc.com
> > www.renewassoc.com
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org




Re: missing org.w3c.dom.DocumentType methods in xerces.jar in Xerces-J-bin.1.1.2.zip

Posted by "Robert E. Newby" <Bo...@renewassoc.com>.
Hi again, Eric.  I am compiling Xerces1.1.2 from the distributed sources
right now, using the "make jars" script.  Hopefully that will resolve
things.  If not, you all will hear from me again.

Regards,

Bob

--

Robert E. Newby
Renew Associates
Java 2 and XML Distributed & Enterprise Contracting
Bob_Newby@renewassoc.com
www.renewassoc.com


----- Original Message -----
From: "Eric Ye" <er...@locus.apache.org>
To: <xe...@xml.apache.org>
Sent: Thursday, July 06, 2000 5:13 PM
Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


Hi, Bob,
I just ran "javap -public org.w3c.dom.DocumentType" on the
DocumentType.class that i extracted from "xerces.jar" in 1.1.2 distribution.
it gives me back both "getSystemId" and "getPublicId" methods.
You may want to try to compile your program with "javac -classpath
...\...\xerces.jar" instead of relying on the jar file placed in the
jre\lib\ext dir, see if the same problem still pop up.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Robert E. Newby" <Bo...@renewassoc.com>
To: <xe...@xml.apache.org>; "Eric Ye" <er...@locus.apache.org>
Sent: Thursday, July 06, 2000 1:20 PM
Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


> Hi Eric,
>
> No, it's not a classpath issue; I do not use class path at all.  Rather, I
> use the Java 2 Platform's Extension Mechanism, which provides for placing
> jars in $JAVA_HOME$\jre\lib\ext, and none of the other jars there contain
> the package(s) in question.  This is the first time I have downloaded
> anything containing those packages.
>
> Also, as I said, my IDE (Sun's Forte for Java) allows me to peek inside a
> jar in order to check out a compiled class's members.  In this case, these
> are as I stated in my previous email, which is to say that they are
> definitely not all there.  Also, I downloaded the zip in question twice,
> just to double check my findings.  No change -- I cannot compile when that
> interface's getPublicId and getSystemId methods are referenced directly,
> either from within Forte or external to it.
>
> This is not a problem that will hinder me; but I do suspect there is a
snafu
> in the latest build process.  In the meantime, I will probably just
compile
> that class from source myself and stuff it into the jar.
>
> Thanks,
>
> Bob
>
>
> ----- Original Message -----
> From: "Eric Ye" <er...@locus.apache.org>
> To: <xe...@xml.apache.org>
> Sent: Thursday, July 06, 2000 3:08 PM
> Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
>
> Couldn't reproduce your problem(I have a program that invoke the 2
methods
> your reported missing) , could there be some problem with your classpath?
> e.g. other jar file that also include org.w3c.dom package which is out of
> date.
> Try clean up your classpath with just
> "...\...\xerces.jar;...\...\xercesSamples.jar;."
> _____
>
>
> Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org
>
> ----- Original Message -----
> From: "Robert E. Newby" <Bo...@renewassoc.com>
> To: <xe...@xml.apache.org>
> Cc: <br...@newInstance.com>
> Sent: Thursday, July 06, 2000 11:49 AM
> Subject: BUG: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
>
> > To whom it may concern:
> >
> > I recently downloaded and installed the latest binary distribution of
> Xerces
> > (Xerces-J-bin.1.1.2.zip), and have been using that distribution's
> xerces.jar
> > dated Friday, June 23, 2000 3:47:38 PM.
> >
> > While compiling code (in conjunction with my reading of the new O'Reilly
> > book Java and XML), I discovered that this jar's
org.w3c.dom.DocumentType
> > class (i.e., interface) is *missing* at least two (2) method
declarations,
> > namely:
> > * getPublicId
> > * getSystemId
> >
> > An inspection of this jar using my IDE shows the following three (3)
> method
> > declarations for org.w3c.dom.DocumentType, and no others:
> > * getEntities
> > * getName
> > * getNotations
> >
> > This is in contrast to the Xerces 1.1.2 API documentation (plus the
source
> > packaged with Xerces-J-src.1.1.2.zip), which includes the following six
> (6)
> > method declarations:
> > * getEntities
> > * getInternalSubset
> > * getName
> > * getNotations
> > * getPublicId
> > * getSystemId
> >
> > For now, I am working around this by directly using the concrete class
> > org.apache.xerces.dom.DocumentTypeImpl.
> >
> > Regards,
> >
> > Bob
> >
> > --
> >
> > Robert E. Newby
> > Renew Associates
> > Java 2 and XML Distributed & Enterprise Contracting
> > Bob_Newby@renewassoc.com
> > www.renewassoc.com
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org



Re: missing org.w3c.dom.DocumentType methods in xerces.jar in Xerces-J-bin.1.1.2.zip

Posted by Eric Ye <er...@locus.apache.org>.
Hi, Bob,
I just ran "javap -public org.w3c.dom.DocumentType" on the
DocumentType.class that i extracted from "xerces.jar" in 1.1.2 distribution.
it gives me back both "getSystemId" and "getPublicId" methods.
You may want to try to compile your program with "javac -classpath
...\...\xerces.jar" instead of relying on the jar file placed in the
jre\lib\ext dir, see if the same problem still pop up.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Robert E. Newby" <Bo...@renewassoc.com>
To: <xe...@xml.apache.org>; "Eric Ye" <er...@locus.apache.org>
Sent: Thursday, July 06, 2000 1:20 PM
Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


> Hi Eric,
>
> No, it's not a classpath issue; I do not use class path at all.  Rather, I
> use the Java 2 Platform's Extension Mechanism, which provides for placing
> jars in $JAVA_HOME$\jre\lib\ext, and none of the other jars there contain
> the package(s) in question.  This is the first time I have downloaded
> anything containing those packages.
>
> Also, as I said, my IDE (Sun's Forte for Java) allows me to peek inside a
> jar in order to check out a compiled class's members.  In this case, these
> are as I stated in my previous email, which is to say that they are
> definitely not all there.  Also, I downloaded the zip in question twice,
> just to double check my findings.  No change -- I cannot compile when that
> interface's getPublicId and getSystemId methods are referenced directly,
> either from within Forte or external to it.
>
> This is not a problem that will hinder me; but I do suspect there is a
snafu
> in the latest build process.  In the meantime, I will probably just
compile
> that class from source myself and stuff it into the jar.
>
> Thanks,
>
> Bob
>
>
> ----- Original Message -----
> From: "Eric Ye" <er...@locus.apache.org>
> To: <xe...@xml.apache.org>
> Sent: Thursday, July 06, 2000 3:08 PM
> Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
>
> Couldn't reproduce your problem(I have a program that invoke the 2
methods
> your reported missing) , could there be some problem with your classpath?
> e.g. other jar file that also include org.w3c.dom package which is out of
> date.
> Try clean up your classpath with just
> "...\...\xerces.jar;...\...\xercesSamples.jar;."
> _____
>
>
> Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org
>
> ----- Original Message -----
> From: "Robert E. Newby" <Bo...@renewassoc.com>
> To: <xe...@xml.apache.org>
> Cc: <br...@newInstance.com>
> Sent: Thursday, July 06, 2000 11:49 AM
> Subject: BUG: missing org.w3c.dom.DocumentType methods in xerces.jar in
> Xerces-J-bin.1.1.2.zip
>
>
> > To whom it may concern:
> >
> > I recently downloaded and installed the latest binary distribution of
> Xerces
> > (Xerces-J-bin.1.1.2.zip), and have been using that distribution's
> xerces.jar
> > dated Friday, June 23, 2000 3:47:38 PM.
> >
> > While compiling code (in conjunction with my reading of the new O'Reilly
> > book Java and XML), I discovered that this jar's
org.w3c.dom.DocumentType
> > class (i.e., interface) is *missing* at least two (2) method
declarations,
> > namely:
> > * getPublicId
> > * getSystemId
> >
> > An inspection of this jar using my IDE shows the following three (3)
> method
> > declarations for org.w3c.dom.DocumentType, and no others:
> > * getEntities
> > * getName
> > * getNotations
> >
> > This is in contrast to the Xerces 1.1.2 API documentation (plus the
source
> > packaged with Xerces-J-src.1.1.2.zip), which includes the following six
> (6)
> > method declarations:
> > * getEntities
> > * getInternalSubset
> > * getName
> > * getNotations
> > * getPublicId
> > * getSystemId
> >
> > For now, I am working around this by directly using the concrete class
> > org.apache.xerces.dom.DocumentTypeImpl.
> >
> > Regards,
> >
> > Bob
> >
> > --
> >
> > Robert E. Newby
> > Renew Associates
> > Java 2 and XML Distributed & Enterprise Contracting
> > Bob_Newby@renewassoc.com
> > www.renewassoc.com
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


Re: missing org.w3c.dom.DocumentType methods in xerces.jar in Xerces-J-bin.1.1.2.zip

Posted by "Robert E. Newby" <Bo...@renewassoc.com>.
Hi Eric,

No, it's not a classpath issue; I do not use class path at all.  Rather, I
use the Java 2 Platform's Extension Mechanism, which provides for placing
jars in $JAVA_HOME$\jre\lib\ext, and none of the other jars there contain
the package(s) in question.  This is the first time I have downloaded
anything containing those packages.

Also, as I said, my IDE (Sun's Forte for Java) allows me to peek inside a
jar in order to check out a compiled class's members.  In this case, these
are as I stated in my previous email, which is to say that they are
definitely not all there.  Also, I downloaded the zip in question twice,
just to double check my findings.  No change -- I cannot compile when that
interface's getPublicId and getSystemId methods are referenced directly,
either from within Forte or external to it.

This is not a problem that will hinder me; but I do suspect there is a snafu
in the latest build process.  In the meantime, I will probably just compile
that class from source myself and stuff it into the jar.

Thanks,

Bob


----- Original Message -----
From: "Eric Ye" <er...@locus.apache.org>
To: <xe...@xml.apache.org>
Sent: Thursday, July 06, 2000 3:08 PM
Subject: Re: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


Couldn't reproduce your problem(I have a program that invoke the 2  methods
your reported missing) , could there be some problem with your classpath?
e.g. other jar file that also include org.w3c.dom package which is out of
date.
Try clean up your classpath with just
"...\...\xerces.jar;...\...\xercesSamples.jar;."
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Robert E. Newby" <Bo...@renewassoc.com>
To: <xe...@xml.apache.org>
Cc: <br...@newInstance.com>
Sent: Thursday, July 06, 2000 11:49 AM
Subject: BUG: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


> To whom it may concern:
>
> I recently downloaded and installed the latest binary distribution of
Xerces
> (Xerces-J-bin.1.1.2.zip), and have been using that distribution's
xerces.jar
> dated Friday, June 23, 2000 3:47:38 PM.
>
> While compiling code (in conjunction with my reading of the new O'Reilly
> book Java and XML), I discovered that this jar's org.w3c.dom.DocumentType
> class (i.e., interface) is *missing* at least two (2) method declarations,
> namely:
> * getPublicId
> * getSystemId
>
> An inspection of this jar using my IDE shows the following three (3)
method
> declarations for org.w3c.dom.DocumentType, and no others:
> * getEntities
> * getName
> * getNotations
>
> This is in contrast to the Xerces 1.1.2 API documentation (plus the source
> packaged with Xerces-J-src.1.1.2.zip), which includes the following six
(6)
> method declarations:
> * getEntities
> * getInternalSubset
> * getName
> * getNotations
> * getPublicId
> * getSystemId
>
> For now, I am working around this by directly using the concrete class
> org.apache.xerces.dom.DocumentTypeImpl.
>
> Regards,
>
> Bob
>
> --
>
> Robert E. Newby
> Renew Associates
> Java 2 and XML Distributed & Enterprise Contracting
> Bob_Newby@renewassoc.com
> www.renewassoc.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org




Re: missing org.w3c.dom.DocumentType methods in xerces.jar in Xerces-J-bin.1.1.2.zip

Posted by Eric Ye <er...@locus.apache.org>.
Couldn't reproduce your problem(I have a program that invoke the 2  methods
your reported missing) , could there be some problem with your classpath?
e.g. other jar file that also include org.w3c.dom package which is out of
date.
Try clean up your classpath with just
"...\...\xerces.jar;...\...\xercesSamples.jar;."
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Robert E. Newby" <Bo...@renewassoc.com>
To: <xe...@xml.apache.org>
Cc: <br...@newInstance.com>
Sent: Thursday, July 06, 2000 11:49 AM
Subject: BUG: missing org.w3c.dom.DocumentType methods in xerces.jar in
Xerces-J-bin.1.1.2.zip


> To whom it may concern:
>
> I recently downloaded and installed the latest binary distribution of
Xerces
> (Xerces-J-bin.1.1.2.zip), and have been using that distribution's
xerces.jar
> dated Friday, June 23, 2000 3:47:38 PM.
>
> While compiling code (in conjunction with my reading of the new O'Reilly
> book Java and XML), I discovered that this jar's org.w3c.dom.DocumentType
> class (i.e., interface) is *missing* at least two (2) method declarations,
> namely:
> * getPublicId
> * getSystemId
>
> An inspection of this jar using my IDE shows the following three (3)
method
> declarations for org.w3c.dom.DocumentType, and no others:
> * getEntities
> * getName
> * getNotations
>
> This is in contrast to the Xerces 1.1.2 API documentation (plus the source
> packaged with Xerces-J-src.1.1.2.zip), which includes the following six
(6)
> method declarations:
> * getEntities
> * getInternalSubset
> * getName
> * getNotations
> * getPublicId
> * getSystemId
>
> For now, I am working around this by directly using the concrete class
> org.apache.xerces.dom.DocumentTypeImpl.
>
> Regards,
>
> Bob
>
> --
>
> Robert E. Newby
> Renew Associates
> Java 2 and XML Distributed & Enterprise Contracting
> Bob_Newby@renewassoc.com
> www.renewassoc.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


BUG: missing org.w3c.dom.DocumentType methods in xerces.jar in Xerces-J-bin.1.1.2.zip

Posted by "Robert E. Newby" <Bo...@renewassoc.com>.
To whom it may concern:

I recently downloaded and installed the latest binary distribution of Xerces
(Xerces-J-bin.1.1.2.zip), and have been using that distribution's xerces.jar
dated Friday, June 23, 2000 3:47:38 PM.

While compiling code (in conjunction with my reading of the new O'Reilly
book Java and XML), I discovered that this jar's org.w3c.dom.DocumentType
class (i.e., interface) is *missing* at least two (2) method declarations,
namely:
* getPublicId
* getSystemId

An inspection of this jar using my IDE shows the following three (3) method
declarations for org.w3c.dom.DocumentType, and no others:
* getEntities
* getName
* getNotations

This is in contrast to the Xerces 1.1.2 API documentation (plus the source
packaged with Xerces-J-src.1.1.2.zip), which includes the following six (6)
method declarations:
* getEntities
* getInternalSubset
* getName
* getNotations
* getPublicId
* getSystemId

For now, I am working around this by directly using the concrete class
org.apache.xerces.dom.DocumentTypeImpl.

Regards,

Bob

--

Robert E. Newby
Renew Associates
Java 2 and XML Distributed & Enterprise Contracting
Bob_Newby@renewassoc.com
www.renewassoc.com


Re: Q: Serializing a DOM Document

Posted by Kevin Regan <ke...@valicert.com>.
I think the problem is that the Xerces J outputter is not
sophisticated enough (actually no XML outputter is as
sophisticated as I would like it to be).

In order to produce the "correct" or expected output,
the outputter must have access to the DTD or Schema.

Take the following example:

<!ELEMENT Root (A | B | #PCDATA)*>
<!ELEMENT A (#PCDATA)>
<!ELEMENT B (#PCDATA)>

Now, we might create a DOM similar to:

<Root><A>Hello</A><B>Goodbye</B></Root>

The outputter has no way of knowing (without looking
at the DTD) that it can not turn the previous into:

<Root>
	<A>Hello</A>
        <B>Goodbye</B>
</Root>

In the above example, the outputter has added extra
space where it thought that it had only encountered
element data (however, looking at the DTD, we know that
it was actually mixed data).  This seems to be a pretty
common way of doing XML output (i.e. If any children
of an element are Text, don't indent at that level).

So, I predict that there will be lots of questions,
complaints, and problems until we come up with a
"smart" or "DTD/Schema aware" outputter.

Is there any work going towards this?

Sincerely,
Kevin Regan
kevinr@valicert.com


On Thu, 6 Jul 2000, Gregor Karlinger wrote:

> Hi all!
> 
> I am currently struggling with serializing a manually built
> DOM Document; as an example, consider this one:
> 
> - a Document Element named "root"
> 
> - a single child Element in root, called "child"
> 
> - "child" has one child node of type Text; this text has the value
>   "FirstLine\nSecondLine"
> 
> Now, what I want is a serialization result, which includes line
> breaks and indentations reflecting the structure of my DOM document,
> but does not change the text value, i.e. the result should look like:
> 
> <root>
>   <child>FirstLine
> SecondLine</child>
> <root>
> 
> The problem I am facing is that I must switch of the preserveSpace
> options, otherwhise the indentation of "child" will not be done, but
> then the newLine character in my text value is changed into a space,
> which must not happen in my special case. So, to summarize, the two
> results I can produce are:
> 
> (1) indentation=true, preserveSpace=true
> 
> <root><child>FirstLine
> SecondLine</child></root>
> 
> (2) indentation=true, preserveSpace=false
> 
> <root>
>   <child>FirstLine SecondLine</child
> </root>
> 
> I am aware of the option in OutputFormat, to specify a
> list of Elements, whose text nodes will be printed unescaped,
> but this is not fitting in my case, since I don't know which
> Elements will be put into my DOM document.
> 
> My question now is, why are text values changed, if preserveSpace
> is set to false? At least I think there should be an option to
> switch off these changes to text values.
> 
>   
> Regards, Gregor
> ---------------------------------------------------------------
> Gregor Karlinger
> mailto://gregor.karlinger@iaik.at
> http://www.iaik.at
> Phone +43 316 873 5541
> Institute for Applied Information Processing and Communications
> Austria
> ---------------------------------------------------------------
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>