Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Loading Classpath Resources
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Steven Waldren  
View profile  
 More options Sep 22, 5:53 pm
From: Steven Waldren <swald...@gmail.com>
Date: Tue, 22 Sep 2009 16:53:30 -0500
Local: Tues, Sep 22 2009 5:53 pm
Subject: Loading Classpath Resources
Hello,

I have run into a little issue.  I want to be able to load some XSLT  
files that are in the Classpath (org.mine.xslt.samplexslt.xsl).  I  
tried to use MyClass.class.getResourceAsStream("/org/mine/xslt/
samplexslt.xsl"), but I then run into problems because the  
samplexslt.xsl has an <xsl:import href"./date/difference/
date.difference.xsl"/> (since it in in a sub-package).  When I load  
the samplexslt.xsl it throws an error because it cannot find  
date.difference.xslt.

When I change the xsl:import href to "src/org/mine/xslt/date/
difference/date.difference.xsl"  The XSLT will compile.  This does not  
seem to be a good approach.

Any direction on best practices to load non-java files that reference  
other files from the classpath?

Thanks for any help.

Best,
Steven
--
Steven Waldren
swald...@gmail.com
GnuPGP Key: https://keyserver2.pgp.com/vkd/DownloadKey.event?keyid=0xEE7A9BE0A97A...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jon Brisbin  
View profile  
 More options Sep 22, 5:57 pm
From: Jon Brisbin <jon.bris...@gmail.com>
Date: Tue, 22 Sep 2009 16:57:32 -0500
Local: Tues, Sep 22 2009 5:57 pm
Subject: Re: [kcjava] Loading Classpath Resources

I don't have any examples handy, but I've done something like this  
before by registering a protocol handler and using urls like  
"classpath:/org/mypackage/etc.xml".

jb

On Sep 22, 2009, at 4:53 PM, Steven Waldren wrote:

Thanks!

Jon Brisbin
http://jbrisbin.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hanasaki  
View profile  
 More options Sep 22, 8:24 pm
From: hanasaki <hanas...@hanaden.com>
Date: Tue, 22 Sep 2009 19:24:57 -0500
Local: Tues, Sep 22 2009 8:24 pm
Subject: Re: [kcjava] Re: Loading Classpath Resources
I had this issue in the past and used a customer resolver:

ref:
http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/EntityResolver.html
http://xml.apache.org/commons/components/resolver/resolver-article.html

--

=================================================================
= Management is doing things right;                             =
= Leadership is doing the right things.    - Peter Drucker      =
=================================================================


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google