Re: Review: Serializer API

2000-03-22 Thread Wong Kok Wai
Here's a good tutorial on how to use the serialiser: http://metalab.unc.edu/xml/slides/sd2000west/xmlandjava/185.html Boris Garbuzov wrote: Even if I misuse the API (I should not call this directly?) it should have failed friendlier than this:

Re: Question of a novice.

2000-03-21 Thread Wong Kok Wai
Take a look at org.apache.xml.serialize package. Boris Garbuzov wrote: What people use to print DOM document in Xerces for Java? It is left outside the core? Why not put to the core any default writer class like DOMWriter from the samples? Can I use DOMWriter for commercial needs, a little

Re: Question of a novice.

2000-03-21 Thread Wong Kok Wai
Download the latest 1.0.3 version and you should see the package. Boris Garbuzov wrote: Where this package is? I am finding just following:

Re: Converting 'amplt;' in '' ???

2000-03-20 Thread Wong Kok Wai
Try this: gt; and lt; Schomisch wrote: Hi, How can I convert by an example 'amplt;' in '' or 'amp;gt;' in ''.

Re: Review: Serializer API

2000-03-17 Thread Wong Kok Wai
A quick comment: In QName, the localname checking is only for null. Should add checking for zero-length string too?

Re: Review: Serializer API

2000-03-17 Thread Wong Kok Wai
Kok Wai wrote: A quick comment: In QName, the localname checking is only for null. Should add checking for zero-length string too?

Re: HTML parsing

2000-03-14 Thread Wong Kok Wai
There is a HTML parser in Swing/JFC. It is also event-based but not SAX. Another bad news is the parsed object tree is not DOM-based. Rajiv Mordani wrote: The xhtml parser from Sun is an internal only version which will be made available for Apache as soon as the licensing issues are cleared.

Re: HTML parsing

2000-03-14 Thread Wong Kok Wai
That's a lot of baggage! Not to mention the Swing parser only supports HTML 3.2, if I remember correctly. Rajiv Mordani wrote: Well the xhtml parser is infact just a small handler that builds on the swing html parser using sax events. - Rajiv

Re: BaseMarkupSerializer/XMLSerializer

2000-03-07 Thread Wong Kok Wai
You have to initialise an OutputFormat object and pass it to the serialiser. You set the Doctype declaration and other things like indentation in the OutputFormat. Arnaud Le Hors wrote: The documentation is really sparse on this so maybe I'm just using it in a way which is not intended but it

Re: Validating against a different DTD

2000-02-29 Thread Wong Kok Wai
You can write a class that implements org.xml.sax.EntityResolver and returns an InputSource that points to your local DTD copies. Pass this object to the SAX parser using setEntityResolver. Elliotte Rusty Harold wrote: Is there any way in Xerces I can easily choose a specific DTD/schema to

[Xerces-J] OT question on JAXP implementation

2000-02-27 Thread Wong Kok Wai
I like to ask a question on the implementation of javax.xml.parsers.SAXParserFactory: Why is the advantage of using Thread.currentThread().getContextClassLoader().loadClass() to load class compare to Class.forName()? (This implementation also mean Xerces cannot be compile with JDK 1.1.x).

SAX 2 beta 2 released

2000-02-26 Thread Wong Kok Wai
Get it at http://www.megginson.com/SAX/SAX2/

Bug in build script?

2000-02-24 Thread Wong Kok Wai
The xerces.jar that is included in xerces-J-bin.1.0.2.zip was built with compression turned off. Is there a reason for this or an error in the makefile? With compression turned on, the resulting xerces.jar is almost half the size!

Pretty printing of comment nodes

2000-02-24 Thread Wong Kok Wai
Xerces 1.0.2: Comments nodes are not printed properly by the serializer IMHO. The following is the patch I've made for org.apache.xml.serialize.BaseMarkupSerializer: Index: BaseMarkupSerializer.java === RCS file:

Unable to re-use entity resolver

2000-02-20 Thread Wong Kok Wai
When I parse two documents that uses the same DTD consecutively, and I use the same instance of my implementation of EntityResolver, a stream closed exception is thrown. The workaround is to create a new instance for each document. This is rather inefficient as the same DTD is used and one

Xerces-J: COMMENT node messes up pretty printing

2000-02-20 Thread Wong Kok Wai
When a Comment node is added to the DOM and serialised to a file, the indentation is messed up. For example, using the Test2.java attached, the result is: ?xml version=1.0 encoding=UTF-8? root ele1 ele2 attr1=attrval1/!-- This is a comment --/ele1 /root I would expect the output be

Re: [Xerces-J] problem

2000-02-18 Thread Wong Kok Wai
Two ways you can try: 1) Wrap your FileInputStream with a BufferedInputStream, like: InputSource biginput = new InputSource(new BufferedInputStream(new FileInputStream(C:\\kurs.xml))); 2) Use SAX Mikael Helbo Kjær wrote: Hi everyone. I`m developing a Java Xml

Appending to a XML document

2000-02-10 Thread Wong Kok Wai
A general XML question: What's the most efficient way of appending data to a XML document? Let's say I'm implementating a log file using XML. If I choose DOM, I need to parse the file to DOM, get the document element, append the child node and serialise back to file. I can't think of anyway using

SAX2 beta

2000-01-29 Thread Wong Kok Wai
In case you don't know already, SAX2 beta has been posted at http://www.megginson.com/SAX/SAX2/

Re: Pretty print problem in serializer in 1.0.1

2000-01-06 Thread Wong Kok Wai
Doesn't using setPreserveSpace(false) in OutputFormat takes care of this? Assaf Arkin wrote: If you extract all these whitespaces from the original personal.xml, or test run it with ProjectX (which does not add these whitespaces), you will get the pretty printing you expect to.

New binary distribution for Xerces-J

1999-12-30 Thread Wong Kok Wai
When's the next binary distribution of Xerces-J?

W3C DOM interfaces

1999-12-12 Thread Wong Kok Wai
Hi, Just an observation: I see the DOM2 implementation is available but the W3C interfaces are still at DOM1. BTW, W3C just released CR for DOM2.

Re: Missing checkins?

1999-11-28 Thread Wong Kok Wai
I've got the answer from Brian: it is due to the change of CVS server, it is now at :pserver:[EMAIL PROTECTED]:/home/cvspublic Stefano Mazzocchi wrote: I got them, but I'm not doing anonCVS. Maybe a group visibility problem?

Re: Missing checkins?

1999-11-28 Thread Wong Kok Wai
: warning: unrecognized response `cvs: setgroups: Operation not permitted' from cvs server cvs server: Updating xml-xalan CVS.EXE checkout: move away xml-xalan/BUGS; it is in the way C xml-xalan/BUGS PS: The above is a snippet when checking out xalan but it is true for all modules. Wong Kok Wai

Re: Missing checkins?

1999-11-28 Thread Wong Kok Wai
Thanks for this info! Shaoping Zhou wrote: So, you may also be able to just hack that line by changing dev.apache.org to xml.apache.org, and see if it works without having to either use a new workspace dir or deleting the old xml related package dirs. Sad to say this doesn't work.

Re: cvs commit: xml-xerces/java/src/org/apache/xml/serialize BaseSerializer.java ElementState.java HTMLEntities.res HTMLSerializer.java HTMLdtd.java Makefile OutputFormat.java Serializer.java XHTMLSerializer.java XMLSerializer.java

1999-11-27 Thread Wong Kok Wai
Just tried it and found one small typo: the user should be anoncvs Brian Behlendorf wrote: That's because the CVS repositories were moved at the beginning of the week. You should be using the following CVSROOT for pserver access now: :pserver:[EMAIL PROTECTED]:/home/cvspublic

Missing checkins?

1999-11-26 Thread Wong Kok Wai
Second try. I've even do a fresh checkout but still couldn't find these checkins. Any clue? Wong Kok Wai wrote: I can't seem to find these checkins in the CVS, both the anoncvs and the web. Assaf Arkin wrote: arkin 99/11/23 14:29:53 Added: java/src/org/apache/xml

Re: cvs commit: xml-xerces/java/src/org/apache/xml/serialize BaseSerializer.java ElementState.java HTMLEntities.res HTMLSerializer.java HTMLdtd.java Makefile OutputFormat.java Serializer.java XHTMLSerializer.java XMLSerializer.java

1999-11-25 Thread Wong Kok Wai
I can't seem to find these checkins in the CVS, both the anoncvs and the web. Assaf Arkin wrote: arkin 99/11/23 14:29:53 Added: java/src/org/apache/xml/serialize BaseSerializer.java ElementState.java HTMLEntities.res

Re: Make Tools (was Re: version numbers)

1999-11-11 Thread Wong Kok Wai
The Jakarta project (another Apache-hosted project) is using a Java-based make tool (I think it's called Ant) which I believe solves most cross-platform issues (since it's Java). Another note is Ant's makefile is XML-based, so I think it's ironical if Xerces-J/Xalan-J is not using Ant. Scott