Re: default encoding

2003-05-20 Thread Michael Rafael Glavassevich
Hi Sudha, Internally, Java stores characters (or chars) in memory as 16-bit Unicode. This has nothing to do with the input encoding of your document, so no characters are not stored as UTF-8 in a DOM Document. If you don't specify your own character reader, Xerces will try to translate your strea

default encoding

2003-05-20 Thread Sudha Sathiaseelan
Hi, Is UTF-8 the default encoding for the Document returned by org.apache.xerces.jaxp.DocumentBuilderImpl's parse? Thanks, Sudha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

SAX Parser & DOCTYPE statement

2003-05-20 Thread Anthony Rabaa
Hello, Is it possible to have only the public identifier specified in the DOCTYPE statement?  My goal is to use the public identifier to load the DTD from a JAR so having the SYSTEM identifier means using a dummy DTD.  I'm using the SAXParser object to validate the documents. --    Anthony Ra

Re: w3c html dom versioning oddities

2003-05-20 Thread Michael Rafael Glavassevich
On Tue, 20 May 2003, Jacob Kjome wrote: > > Hi Arno, > > Your response was very informative! > > Looks like the package switch from dom.html to dom.html2 came between the > following releases... > > http://www.w3.org/TR/2001/WD-DOM-Level-2-HTML-20011210/java-binding.html > and > http://www.w3.org/

Re: w3c html dom versioning oddities

2003-05-20 Thread Jacob Kjome
Hi Arno, Your response was very informative! Looks like the package switch from dom.html to dom.html2 came between the following releases... http://www.w3.org/TR/2001/WD-DOM-Level-2-HTML-20011210/java-binding.html and http://www.w3.org/TR/2002/CR-DOM-Level-2-HTML-20020605/java-binding.html So,

Re: Have Node, need to set Attribute

2003-05-20 Thread Joseph Kesselman
>I can see that Elements have a setAttribute method. I have a node (Node n) >and would like to set an attribute. Can I just cast the Node into Element, >or is there a nicer way? 1) As others have said, don't touch setAttribute unless you really want to create a Level 1 Only (non-namespace-tole

Re: Have Node, need to set Attribute

2003-05-20 Thread Jeff Greif
If you're using namespaces anywhere in your document, you should use setAttributeNS instead of setAttribute. Mixing namespace-aware and namespace-unaware DOM interfaces often makes a mess. Jeff - To unsubscribe, e-mail: [EMAIL

Re: Have Node, need to set Attribute

2003-05-20 Thread Constantine Georges
Well, if you're sure that the node is an Element, then you could also do this: // assume 'doc' is the containing document // assume 'node' is the element you want to add the attribute to Attr att = doc.createAttribute("my_att_name"); att.setValue("my_att_value"); node.appendChild(att); Are you

Have Node, need to set Attribute

2003-05-20 Thread Stephan Reiff-Marganiec
Hi, I can see that Elements have a setAttribute method. I have a node (Node n) and would like to set an attribute. Can I just cast the Node into Element, or is there a nicer way? Stephan -- Dr Stephan Reiff-Marganiec Research Fellow Department of Computing Science; University of Stirling email:

RE: XML Parser

2003-05-20 Thread Tim Cronin
>when I call xerces DOM parser>from my Java programme to parse a given XML document then it terminates>the program   no the default error handler it will throw an Exception, as stated in the earlier e-mail you can create your own error handlers and have them handle the error the way you wan

Re: w3c html dom versioning oddities

2003-05-20 Thread Arno Schatz
Hi Jake, The problem is that the HTML DOM Level 2 early Working drafts changed the API of some HTMLElements, but not the package names (see http://www.w3.org/TR/2000/WD-DOM-Level-2-HTML-20001113/java-binding.html). Before the final recommendation the package names where changed to org.w3c.dom.ht

Re: XML Parser

2003-05-20 Thread K. Venugopal
New Environnement wrote: Hi , Thank you very much for the info, I think that will help me. But I have one more question, isnt it true that when I call xerces DOM parser from my Java programme to parse a given XML document then it terminates the program, if the XML document is invalid. A

Re: XML parser

2003-05-20 Thread K. Venugopal
Hi Utsav , With xerces you could get the location where error has occured . For this you need to set a error handler and query the current node in the error handler as shown below . eg: Element node = (Element)parser.getProperty("http://apache.org/xml/properties/dom/current-element-nod

XML parser

2003-05-20 Thread Utsav Boobna
Hi, Presently I am working on a project whose aim is to validify an invalid XML document. For it, I need a XML validating parser, to which I call from my Java program giving it the root of the DOM tree of the XML document and it should return to the program , the pointer to the node wh

w3c html dom versioning oddities

2003-05-20 Thread Jacob Kjome
Hello, I ran into a very strange issue when using the org.w3c.dom.html interfaces in the release versions of Xerces2 (tried 2.3.0 and 2.4.0). The binaries of the xmlParserAPIs.jar and xml-apis.jar both seem to contain a different version of the html dom interfaces than what comes in the source.