Win a copy of Spring Boot in Practice this week in the Spring forum!

Edward Morris

Greenhorn
+ Follow
since Jun 29, 2006
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 Edward Morris

How do I parse an XML file on a remote server in JSP? When I make a pure java stand alone app using JAXP, I am able to do something like

Document doc = docBuilder.parse("http://x.y.com/some.xml");

and it works. I do the same in JSP it fails.
15 years ago
JSP
If I write an application using SWT libraries in eclipse on windows, will that prog run on Unix too?
15 years ago
HI,

I need to print a 2D graphics application but the problem I get using Printable or Pageable (following the tuts on Sun's Java) is that my drawing region is bigger than the page and it is cutting the drawing off. How do I work around this and how do I get it to print on multiple pages?
15 years ago
How do I get the FileDialog to work in such a way that it gives a dropdown menu with a list of formats like *.txt, *.pdf, *.tpl etc. instead of the annoying default *.* All files?
16 years ago
My Code
======================================================================================================================================================
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
URL schemaURL = new URL("http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd");
Schema schema = sf.newSchema(schemaURL);


//Create instance of DocumentBuilderFactory
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setSchema(schema);
======================================================================================================================================================

What I'm trying to do

======================================================================================================================================================

Generate XML output that conforms to that schema and is valid

======================================================================================================================================================

The ERROR

======================================================================================================================================================

sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://graphml.graphdrawing.org/xmlns,key.extra.attrib'.

======================================================================================================================================================

The Schema

======================================================================================================================================================

http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd

======================================================================================================================================================

What I need

======================================================================================================================================================

HELP! HELP! HELP! HELP!
How do I generate XML output that conforms to a Schema? I use the DOM architecture and the DocumentBuilderFactory stuff to easily generate XML, but its just not exactly what I expect it to be i.e. its not valid. How do you assign a schema for an XML document and how do we get this schema info added to the root element of the doc. Right now I do it by using setAttribute() method but I know its not right. Any help appreciated.
Hi, I managed to build the dom structure, serialization, blah blaha...and all works fine. Only problem, the ouput file is not a valid xml file following the schema I want it to. I tried to generate the DOM itself using this schema using the setSchema() for the Doc factory, but I get wiered errors at runtime, complaining about the schema itself.

Snippet
===========================================================================
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
URL schemaURL = new URL("http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd");
Schema schema = sf.newSchema(schemaURL);

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setSchema(schema);
==========================================================================
Error

sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://graphml.graphdrawing.org/xmlns,key.extra.attrib'.
16 years ago
Hi guys, I'm using Sun's Enterprise version of JAVA (which installs on c:\sun.....). I am trying to write a program to create and parse XML documents and when I do an import for org.apache...., eclipse cries! saying import cannot be resolved. I'm guessing I'll have to install this Apache Xerces parser, but I don't know how to do that. Can anybody help??
This got it to run, but now the prob is when I compile, the classes are not going to the classes folder. They are ending up in the sources folder. I need a script to compile my proj just like eclipse does. Read from the sources folder and generate the classes in the classes folder for corresponding packages. And then a script to run it. That would solve my problem, can anyone help?
16 years ago
Ok I was able to compile but I am stll not able to run it.

here is exactly what my proj looks like, can anybody please help me with a good batch file?

MyProj
+--classes
|xxxxxxxx|
|xxxxxxxx+--x
|xxxxxxxxxxx|
|xxxxxxxxxxx+--y
|xxxxxxxxxxxxxx|
|xxxxxxxxxxxxxx+--z
|xxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxx+--a
|xxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxx+--MainClass.class
+--sources
|xxxxxxxx|
|xxxxxxxx+--x
|xxxxxxxxxxx|
|xxxxxxxxxxx+--y
|xxxxxxxxxxxxxx|
|xxxxxxxxxxxxxx+--z
|xxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxx+--a
|xxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxx+--MainClass.java
|
|
+--Resources (icons and stuff)

[ July 21, 2006: Message edited by: Edward Morris ]
[ July 21, 2006: Message edited by: Edward Morris ]
16 years ago
Oh dont worry, mainClass is what I gave out as a name on the forum. My main class is diff, but anyways, it didnt work. I get the same noclassdeffound error! and yes, its a package....
16 years ago
Hi guys, I built a project in eclipse, now I want to make a batch file that executes the app without eclipse. My main class is under a hierarchy like this,

classes\x\y\z\mainClass.class

If I cd to this dir and use java mainClass, it dosent work!

How to run the app?
16 years ago
I made an executable jar for my application and I'm having trouble with this,

C:\>java -jar jed.jar
Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name jedit, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source
)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at edu.bsu.cs.gui.JeditResources.<init>(JeditResources.java:40)
at edu.bsu.cs.gui.JeditControls.<init>(JeditControls.java:76)
at edu.bsu.cs.gui.JeditFrame.<init>(JeditFrame.java:84)
at JEdit.main(JEdit.java:6)

My app reads all the resources from a .properties file and all the image resources for icons are in my classes older that I included in the jar. How do I fix this?
16 years ago
thanx for help guys, but in my quest for "SIMPLE" stuff, i found this and it did it all

http://www.cokeandcode.com/info/webstart-howto.html
16 years ago
Thanks a lot guys, thats some good help I needed. I'm surprised JR doesn't have its own tut for this topic. Well to give you guys the big picture, I am working on this project

www.cs.bsu.edu/homepages/gnet/jedit.htm

Its a simple graph drawing s/w with some good graphs and algorithms.

Two things I wanna do with this are :

1. Incorporate XML output for the graphs and later graphml output.

2. Make this app runnable from the web, something like this

http://www.yworks.com/en/products_yed_about.htm


I'm a newbie with both of the above and I could really use some good and fast teaching help, and of course, I would really really appreciate it.