Page 1 of 1

Cannot load the associated CSS file(s)

Posted: Wed Aug 01, 2012 12:53 am
by sverhagen
Hi,


I've made a specialization in DITA-OT (put it in my DITA-OT1.5.4/demo/xxx folder), ran the integrator and added the resulting catalog-dita.xml to my document type in oXygen. I'm getting, though:

Code: Select all

Cannot load the associated CSS file(s).
The error was: 'No CSS file specified.'
It suggests to add a CSS file to the document manually, and I may manage to do so, but how can I properly integrate a CSS in my "stand-alone" specialization, that's integrated into DITA-OT by the integrator, and that then is reused in oXygen? Does that make sense?

Also, I would like to instruct authors to use my new information type -- I don't like telling them too that they have to associate a CSS such-and-such.

Thanks for your help already. Kind regards, Sander.

(I'd be happy to post my specialization, so just ask me if that's needed for resolving this.)

Re: Cannot load the associated CSS file(s)

Posted: Wed Aug 01, 2012 2:58 pm
by sorin_ristache
Hello,

The CSS references are not resolved through an XML catalog. This is the cause of the error. Usually only schema references and XSLT references are resolved with an XML catalog.

However I think you don't need to resolve a CSS reference using an XML catalog. In the Oxygen built-in document types all the files of the document type (schema for validating the XML files, CSS stylesheets, file templates, etc) are stored in the same folder and all the references are specified relative to the base directory of the document type, using the ${framework} editor variable, where ${framework} denotes the base directory and enables moving this directory to other location without changing any setting inside the document type. For example if you look at the built-in DITA document type or the DocBook ones you can see the CSS specified as ${framework}/css_classed/dita.css and the schema as ${framework}/5.0/rng/docbookxi.rng.

How did you specify the CSS in the document type? Did you use an Oxygen editor variable? In the dialog box for adding/editing a CSS (on the CSS sub-tab of the Author tab of the dialog box for editing a document type), there is a button with a small green arrow icon which triggers a popup window with the editor variables available in the current context.

If you follow this model of setting up a document type your users don't have to tweak it anytime they want to use it or install it on a different computer. They just add it to Oxygen and open the XML documents of that type in Author mode, where the CSS of the document type will be applied.

You can even have your custom document type installed by default in an Oxygen distribution for Java Webstart which you build and which you provide to your users. If you are interested in this approach I can give you more details (in addition to the User Manual explanation).


Regards,
Sorin

Re: Cannot load the associated CSS file(s)

Posted: Wed Aug 01, 2012 10:22 pm
by sverhagen
Hi Sorin,


We actually have a number of documentation projects, each in its own folder, and configured as Maven project (see below). Even if you don't know about Maven, I'll quickly get to where my bottleneck is.

Code: Select all

/documentation
/documentation/architecture
/documentation/architecture/architecture.xpr
/documentation/architecture/pom.xml
/documentation/architecture/src/main/dita/...
/documentation/architecture/target/...
/documentation/glossary
/documentation/glossary/glossary.xpr
/documentation/glossary/pom.xml
/documentation/glossary/src/main/dita/...
/documentation/glossary/target/...
(et cetera)
The dita folders hold the topic and map files.

The target folders are the subsequent work folders of Maven.

The pom.xml defines the Maven project. Maven has a DITA-OT plugin that it can download itself, but it does not include the actual DITA-OT. So we've made a constellation that downloads DITA-OT from our artifact repository and puts it in Maven's work directory.

The bottleneck is thus that each of our documentation projects has its own DITA-OT instance (downloaded by Maven, and customizations and specializations inserted by Maven also). All of these projects have DITA files, which in oXygen I'd like to treat as the same. I thus don't know where to point my ${framework} variable to (unless I'd be able to do that on a per-project basis, preferably relative to the project file location. It looks, however, that a project is merely a collection of files -- not of properties or other meta data.

---

That all being said... back to the actual CSS files. Isn't there a way that oXygen can reuse the generic styles? After all: my specializations are done by inheritence. That's the only reason why the FO process knows what to do. Why don't oXygen know what to do? :)

Kind regards, Sander.

Re: Cannot load the associated CSS file(s)

Posted: Thu Aug 02, 2012 5:31 pm
by sorin_ristache
Hello,

It seems there is a confusion between:
  • the CSS stylesheet used for editing the XML files in Oxygen and for which you got the initial error in the Oxygen view, Cannot load the associated CSS file(s)
  • the CSS stylesheet used in the output of the DITA-OT transformation
The CSS files from the base directory of the Oxygen framework are used only for editingin Oxygen Author mode, not for the DITA-OT output. The output pages of the DITA-OT transformations should reference the CSSs that come with DITA-OT, or the custom CSS that you set in the DITA transformation with the args.css parameter, and you should not get any eror like File not found for such CSSs. For the DITA-OT transformations you do not need the ${framework} editor variable or other Oxygen editor variable because the CSS is not loaded from the framework directory.

Did I misunderstand your use of CSS files?


Regards,
Sorin

Re: Cannot load the associated CSS file(s)

Posted: Thu Aug 02, 2012 6:31 pm
by sverhagen
sorin wrote:It seems there is a confusion between:
...
Did I misunderstand your use of CSS files?
I posted here merely to get the Author view in oXygen working well.

However, I got the impression that you were telling me to fix that by pointing ${framework} to wherever my DITA-OT is installed that I can point ${framework} to, hence my elaboration on the fact that I'm not having a single DITA-OT installed, but one-per-documentation-project.

Kind regards, Sander.

Re: Cannot load the associated CSS file(s)

Posted: Tue Aug 07, 2012 4:44 pm
by sorin_ristache
Hi Sander,
sverhagen wrote:I've made a specialization in DITA-OT (put it in my DITA-OT1.5.4/demo/xxx folder), ran the integrator and added the resulting catalog-dita.xml to my document type in oXygen. I'm getting, though:

Code: Select all

Cannot load the associated CSS file(s).
The error was: 'No CSS file specified.'
Adding the catalog-dita.xml file of only one DITA-OT from only one documentation project (/documentation/architecture, /documentation/glossary, etc.) should be enough, you don't have to add the catalog-dita.xml file of the DITA-OT of every documentation project, because in your case every project has a copy of the same DITA-OT (downloaded/checked out from the same repository). Adding the catalog-dita.xml file of a DITA-OT that is external to Oxygen is enough for validating and editing the specialized topics in Oxygen Author mode. Editing in Author mode should work on your DITA customization out of the box using the same styles if you followed the DITA specialization guidelines (for DITA 1.0 or DITA 1.2), more specifically if your specialized DTD/schema keeps the DITAArchVersion attribute on the root element of your specialized topics. If the DITAArchVersion attribute is detected by the XML parser on the root element (either explicitly in the XML topic file or as default attribute in the specialized DTD/schema associated with it) then the last rule from the Association rules tab of the DITA document type will match your specialized topic files. If you look in the DITA document type you can see that this rule specifies the Java class DITATopicCustomRuleMatcher which checks only the presence of the attribute (the source code of this class in included in the Oxygen Author SDK). That means if this attribute is present all the settings of the Oxygen built-in DITA document type will be applied to the specialized topics exactly as for the standard DITA topic files, so they will be edited in Author mode with the same styles.

You can check that by looking in the Properties view (go to menu Window -> Show View -> Properties) when the cursor is in a specialized topic which you have opened in Oxygen. Does the table from the Properties view contain a row Document type? What is its value? It should be DITA.

Also validating a specialized topic from your projects in Oxygen should tell us if the specialized DTD/schema was detected correctly using the catalog-dita.xml which you added in the DITA document type. Does the validation action report errors? What are the errors?
sverhagen wrote:The bottleneck is thus that each of our documentation projects has its own DITA-OT instance (downloaded by Maven, and customizations and specializations inserted by Maven also). All of these projects have DITA files, which in oXygen I'd like to treat as the same.
If you only want to edit the topics and maps in Oxygen and you do not need to test in Oxygen the transformation of your DITA maps to PDF, XHTML, etc. then you just need to add only one catalog-dita.xml file as I said above. That should be enough. So you do not really have a bottleneck for editing in Oxygen. If you need also to test a transformation using Oxygen's DITA-OT you should chain your catalog-dita.xml file to the catalog-dita.xml file from Oxygen's DITA-OT using a <nextCatalog> element.
sverhagen wrote:That all being said... back to the actual CSS files. Isn't there a way that oXygen can reuse the generic styles? After all: my specializations are done by inheritence. That's the only reason why the FO process knows what to do. Why don't oXygen know what to do? :)
Oxygen should reuse the generic styles out of the box if the specialization keeps the DITAArchVersion attribute on the root element of the topics. Please check the validation of a specialized topic and the content of the Properties view for a specialized topic. Does it match Oxygen's built-in DITA document type? If not it seems your specialization was not defined correctly. If yes please send us some sample files (using our form for reporting problems) for finding why the standard DITA styles are not applied in Author mode but instead you get the error:

Code: Select all

Cannot load the associated CSS file(s).
The error was: 'No CSS file specified.'
Regards,
Sorin