Oasis Catalog tutorial and examples

Here should go questions about transforming XML with XSLT and FOP.
FJJCENT
Posts: 18
Joined: Sun Apr 22, 2018 10:17 pm

Oasis Catalog tutorial and examples

Post by FJJCENT » Mon May 21, 2018 1:17 am

Hallo everybody, I'm just starting with Oxygen and with Oasis Catalogs for rewriting Uris, and I see a lot of documentation about how to create a catalog, but my problem is that I don´t find any examples of it's working, anything like with this startUri, this prefix and the following entry uri http://xxxx.com/es... the result is the xxxxxx, so with only two or three examples I would understand the how it works, but I don't find such examples, could somebody help me and give me some link realted.

Other question, is there any way of debug the result of the transformatión made by the catalog in oxygen, because I try things which I think would be correct, and it never works I think that I'm completely disappointed,

Best Regards

adrian
Posts: 2575
Joined: Tue May 17, 2005 4:01 pm

Re: Oasis Catalog tutorial and examples

Post by adrian » Mon May 21, 2018 12:42 pm

Hello,

While it may not be extensive, please check the Oxygen User Guide - Working with XML Catalogs section.

To debug an XML Catalog in Oxygen go to Options > Preferences, XML > XML Catalog and set verbosity to either "Unresolved entities" or "All messages". Run a validation and you should see the list of attempts to resolve PublicID/SystemIDs and URIs. Do note that this will list all attempts. Some attempts are normal to fail ("Could not resolve URI/PublicID/SystemID"). That means there is no catalog entry for them.
Also note that All messages will make a rather long list of messages to go through, so I suggest starting with the former.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

FJJCENT
Posts: 18
Joined: Sun Apr 22, 2018 10:17 pm

Re: Oasis Catalog tutorial and examples

Post by FJJCENT » Mon May 21, 2018 2:09 pm

yes it shows some messages, but the catalog includes the line

<rewriteURI uriStartString="http://www.pepito.es/remoto"
rewritePrefix="file:///C:/Trabajo/Prueba_completa_XLS"/>


and the XLS file the following namespace

xmlns:fart="http://www.pepito.es/remoto/Otracarpeta/Segundo.xsl"

And it doesn't show any conversion for this line, so it yields an error because the not conversion
I thought that it would be tansformed in

file:///C:/Trabajo/Prueba_completa_XLS/Otracarpeta/Segundo.xsl

but no line appears for this

Best Regards

adrian
Posts: 2575
Joined: Tue May 17, 2005 4:01 pm

Re: Oasis Catalog tutorial and examples

Post by adrian » Mon May 21, 2018 2:32 pm

Hi,

Please check the other discussion thread.

There is no attempt to resolve through a catalog for just a namespace declaration in a stylesheet. You need to import the other stylesheet, before you can make references to functions from within its namespace.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

FJJCENT
Posts: 18
Joined: Sun Apr 22, 2018 10:17 pm

Re: Oasis Catalog tutorial and examples

Post by FJJCENT » Mon May 21, 2018 3:22 pm

Please let me Know this question in relation with

1) the namespace: xmlns:fart="http://www.pepito.es/remoto/Otracarpeta/Segundo.xsl"

2) the variable calling to a function of the namespace
<xsl:variable name="Datos_Segundo" select="fart:devuelveImporte()" />

And the question is, are you telling me that the catalog is not going to resolve the namespace and transform it to possibility the call to file:/// xxxx ant it's functions if you don`t import before the file with <xsl:import, are you sure?

Best Regards

adrian
Posts: 2575
Joined: Tue May 17, 2005 4:01 pm

Re: Oasis Catalog tutorial and examples

Post by adrian » Mon May 21, 2018 3:36 pm

Yes, you need to import the stylesheet.
<xsl:import href="Segundo.xsl" />
or
<xsl:import href="http://www.pepito.es/remoto/Otracarpeta/Segundo.xsl" />

You may have read some documentation regarding XML catalogs that describes how catalogs can be used with XML schema (XSD) and that you can use the namespace URIs from namespace declarations (usually within the XML instance). In case of XML schema, as per the specification there can only be one target namespace per schema (.xsd) file, so in that case it makes sense for a namespace URI to be mapped to a schema file.
For XML stylesheets (XSL) you can declare multiple functions from different namespaces within the same XSL file, you can also have multiple XSL files that have functions from the same namespace, so it's not a 1 (namespace) to 1 (file) mapping. So you need to import the required XSL modules, there's no other way.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

FJJCENT
Posts: 18
Joined: Sun Apr 22, 2018 10:17 pm

Re: Oasis Catalog tutorial and examples

Post by FJJCENT » Mon May 21, 2018 3:45 pm

Thank Adrian now I understand better Oasis Catalog and with the import it works, I can follow with my project.

Again thanks.

Post Reply