tags:

views:

440

answers:

3

I'm using Ubuntu

I'm working with xsl files that have import or include statements like this

<xsl:import href="/xsl/content/contentsecondary.xsl" />

Eclipse can't find this file because the /xsl/ isn't actually at the the root of the project, but is seen from the root of the web server because of this line in my etc/xml/catalog file:

<rewriteSystem systemIdStartString="/xsl/" rewritePrefix="file:///home/someguy/workspace/someproject/include/xsl/"/>

So in order for eclipse's built in xsl validation to work, it needs to know the real location of /xsl/. Does anyone have any idea how to do this?

For now I've turned off error reporting on missing include files but still get errors on call-template calls to templates it can't find. I've never experienced our templates fully integrated with eclipses xsl features. I think it would provide some really great error checking/auto-completion that I'm missing out on.

Any help would be appreciated. Thanks.

+1  A: 

Is there any reason you can't replicate the structure under the deployment directory in your project dir? If you don't want to migrate the existing structure, you could replicate the rewrite in your project using symbolic links.

If you are worried not just about the content completion/validation, and want to run it, you could write a simple java client that provides it's own URIResolver to resolve URLS to that you obtain correct references.

I haven't yet made the move to Eclipse 3.5, but after reading a bit about it now, I think I'll do and grab a download.

16bytes
Well its under version control so it needs to maintain its structure. I've tried creating a symbolic link so that /xsl/ is at the root but actually It still produced errors when trying to import/include. Perhaps there is something more I need to do that I'm missing.
Sen
+1  A: 

Another shot, but it's not exactly easy:

  • under "Run Configurations" create a new configuration for your scenario.
  • Under the processor tab, Install saxon as an installed processor
  • add an attribute called http://saxon.sf.net/feature/styleParserClass
    • this is where it gets tricky, you have to supply a parser class name in java that knows how to find your files. You'll then have to add this jar under your saxon processor configuration.

That should give you control of overloading the import and include stylesheet directives.

Almost certainly this won't validate in eclipse, but you should be able to run it and find your imports.

16bytes
+1  A: 

I know this works for XML schema, it may work for XSL as well, I'm not in a position to test it at the the moment.

add a catalog contribution to Eclipse. Under Window->Preferences->XML->XML Catalog select User Specified Entries and then the Add button.

Rich Seller
I've tried this but it doesn't seem to help. I'm just pointing to /etc/xml/catalog.Do you know if the Key Type and Key values are actually important in order to get this to work?
Sen
what did you put in the fields?
Rich Seller
I forget, I've just blown away that project and checked it out of CVS again. Somehow my xsl directory lost its association with CVS (??)
Sen