This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Gerd Rosarius

Greenhorn
+ Follow
since Feb 13, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gerd Rosarius

Hello folks,

currently I am involved in a complex Java project. For me this mean, fighting through a huge bunch of classes written by several programmers. The software itself lacks performance heavily.

Beside architectural problems I see excessive use of import wildcards like
instead of .

I know that this is far away from beeing good coding style but does it lead to reduced performance at runtime, too? Any ideas?

H.-Gerd
16 years ago
Hi Barry,

I might be wrong but Sun's JDK is not open source. Therefore you probably won't find sources there.

Maybe you find something by searching for Blackdown. This is a free Java implementation for Linux. Have a look a Blackdown.

H.-Gerd
16 years ago
Sometimes I do not see the obvious!
Thanks Ron.
H.-Gerd Rosarius
Hi folks,
I am collecting some background information about the XML Parser Xerces.
Does anybody know why the XML Parser Xerces was named Xerces?
I believe it was named after Xerces, King of the Persians, who was defeated 480 B.C. in the battle of Salamis by the Spartans. Unfortunately I have no proof for my theory. Is there anybody in this comfortable situation?
Greetings
H.-Gerd Rosarius
Hi folks,
could someone explain me the purpose of the normalize() method in the document class.
What does the method do??? I know normalizing from the context of RDBMS but in XML, haeh?!
H.-Gerd Rosarius
Hey Dan,
thanks for your hint. I will try Xalan.
Seems Xalan makes a lot of things much easier.
H.-Gerd Rosarius
Hey Melissa,
Roopas solution is much easier if you just wan't to get the result displayed in your webbrowser.
Is this what you need, do it Roopas way.
If you want Java objects to do work with, you have to parse the XML file. Than you can use my code.
H.-Gerd Rosarius
Well I found the solution by my own. (Ok, ok, with a little help of a nice lady from IBM Toronto ).
Here it is:
You need to turn on both validation and schema validation features on, otherwise the getElementById() would not work correctly.
You can do that by adding the following Java code to your parser before you use the parse() method:
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://apache.org/xml/features/validation/schema", true);
Voil´┐Ż
H.-Gerd Rosarius
Maybe here in this group is the expert who knows to solve my problem, which I already posted in the group XML, XSL, DOM and SAX.
Here is the URL: https://coderanch.com/t/125206/XML/implement-getElementById-Xerces-XML-Schema
Thanks
H.-Gerd
It's just a quick and dirty hack. I hope it does help and make things clearer ...
I assume you know which Java classes you have to import, how to put the necessary libraries on your classpath and how to parse a XML-file. If I am wrong reply to this message!

You cannot help me with my problem, can you? How to implement getElementById() with Xerces using XML Schema?
Greetings
H.-Gerd Rosarius
[ August 27, 2002: Message edited by: Gerd Rosarius ]
According to the Xerces Java API (Release 2.0.1)it should be possible to search an entire DOM-Document for an Element with a specific ID using getElementById( String elementId ).
The documentation states that I have to tell the DOM-Implementation what the name of the id-attribute is. Either by use of a DTD or a XML Schema.
If I use a DTD to specify my id-attribute and assign it to my XML file, getElementByID("123") returns an object of type Element. So far, so good... If I use a XML Schema I get 'null' instead of the expected Element.
The FAQ-Page of the Apache-Group says about Xerces:
"According to the XML Schema specification, an instance document might have more than one validation root and ID/IDREFS must be unique only within the context of a particular validation root, meaning that a document may potentially contain multiple identical ids. In this case, the output of getElementById() is unspecified. On the other hand, if the document root is a validation root of the document, getElementById() should work as expected." http://xml.apache.org/xerces2-j/faq-general.html#faq-5
Haeh???
How do I have to change my XML-Schema to get an Element instead of 'null' by use of getElementById()?
Here is the XML- and Schema-code which I tried. Any help is welcome!
H.-Gerd Rosarius

The XML file:
-------------

The XML Schema:
---------------

[ August 27, 2002: Message edited by: Gerd Rosarius ]
Hey folks,
according to the Xerces API it should be possible to search an entire DOM-Document for an Element with a specific ID using getElementById(String elementId).
I have to declare id-Attributes of my XML Document as id-Attributes by use of a DTD or Schema. XML-Schema is my choice!
With a DTD all works fine, but when I use a XML Schema the method-call getElementById() returns 'null' instead of the expected Element-object.
Any ideas
H.-Gerd Rosarius
[ August 21, 2002: Message edited by: Gerd Rosarius ]
18 years ago
Hey,
I do not know what the reason for your internal server error is, but for your uploading problem I might have a solution.
There's a free Java API you can get from jspsmart.com. Unfortunately this is a commercial site, so you have to register. The API as well as the documentation is free. Look out for "jspSmartUpload".
As far as I know at sourceforge.net there's some other API for this kind of problem. I'm not sure if this is a explicit German site.
Greetings
H.-Gerd Rosarius
18 years ago
JSP
Can you specify your question a little more, maybe I am able to give you an answer.
H.-Gerd
18 years ago
JSP
Hey folks,
is there any bright person out there, who could explain me the difference in forwarding between

and
.
Both works fine in a certain context, but I cannot get the clue.
Thanks for any comment.
H.-Gerd Rosarius
18 years ago
JSP