Testing a catalog
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 25
- Joined: Sun Apr 22, 2018 10:17 pm
Testing a catalog
Because the catalog is not working well I needed to use absolute address in my project. but now I try to understand how catalog works with Oxygen Xml Editor so I've created a very simple example but it doens't work and I try to know why, so I explain my test
the root of the xml file is:
<?xml version="1.0" encoding="utf-8"?>
<perros xmlns="http://www.animales/domesticos/europa">
<perro raza="collie" chip="01">sam</perro>
<perro raza="chihahua" chip="02">lazy</perro>
<perro raza="fox-terrier" chip="03">fenguy</perro>
<perro raza="coker spaniel" chip="04">laika</perro>
</perros>
the catalog includes
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/en ... atalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
<rewriteURI uriStartString="http://www.animales/domesticos/europa" rewritePrefix="C:/Trabajo/Historico/Prueba_Catalogos" />
</catalog>
and the XSL file includes
<xsl:variable name="rutaDocumentoEntrada" select="concat('http://www.animales/domesticos/europa', '/perros', '.xml')" />
I try that the variable rutaDocumentoEntrada takes the file from the ubication of the xml File (c:\Trabajo) the same directory where the catalog is.
I Look for the result C:/Trabajo/Historico/Prueba_Catalogos\Perros.xml
but the result is always http://www.animales/domesticos/europa/perros.xml' (so the catalog doesn't work)
Could you please tell me where is my fail
Best Regards
the root of the xml file is:
<?xml version="1.0" encoding="utf-8"?>
<perros xmlns="http://www.animales/domesticos/europa">
<perro raza="collie" chip="01">sam</perro>
<perro raza="chihahua" chip="02">lazy</perro>
<perro raza="fox-terrier" chip="03">fenguy</perro>
<perro raza="coker spaniel" chip="04">laika</perro>
</perros>
the catalog includes
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/en ... atalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
<rewriteURI uriStartString="http://www.animales/domesticos/europa" rewritePrefix="C:/Trabajo/Historico/Prueba_Catalogos" />
</catalog>
and the XSL file includes
<xsl:variable name="rutaDocumentoEntrada" select="concat('http://www.animales/domesticos/europa', '/perros', '.xml')" />
I try that the variable rutaDocumentoEntrada takes the file from the ubication of the xml File (c:\Trabajo) the same directory where the catalog is.
I Look for the result C:/Trabajo/Historico/Prueba_Catalogos\Perros.xml
but the result is always http://www.animales/domesticos/europa/perros.xml' (so the catalog doesn't work)
Could you please tell me where is my fail
Best Regards
Last edited by FJJCENT on Tue Feb 01, 2022 4:59 pm, edited 1 time in total.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Testing a catalog
Hi,
Your "rutaDocumentoEntrada" xsl variable has a plain string value, the XSLT processor does not resolve any string value through the XML catalog support.
The XSLT "document" function should pass the referenced location through the URI resolver:
https://www.saxonica.com/html/documenta ... ument.html
and you should get in the $var the entire loaded XML contents.
Regards,
Radu
Your "rutaDocumentoEntrada" xsl variable has a plain string value, the XSLT processor does not resolve any string value through the XML catalog support.
The XSLT "document" function should pass the referenced location through the URI resolver:
Code: Select all
<xsl:variable name="var" select="document(concat('http://www.animales/domesticos/europa', '/perros', '.xml'))"/>
and you should get in the $var the entire loaded XML contents.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 25
- Joined: Sun Apr 22, 2018 10:17 pm
Re: Testing a catalog
I am very sorry I tried with your way but the result is not OK the catalog doesn't change anything
XSL:
<xsl:variable name="rutaDocumentoEntrada"
select="document(concat('http://www.animales/domesticos/europa', '/perros', '.xml'))" />
Result:
http://www.animales/domesticos/europa/perros.xml
XSL:
<xsl:variable name="rutaDocumentoEntrada"
select="document(concat('http://www.animales/domesticos/europa', '/perros', '.xml'))" />
Result:
http://www.animales/domesticos/europa/perros.xml
-
- Posts: 25
- Joined: Sun Apr 22, 2018 10:17 pm
Re: Testing a catalog
I tried also with
<xsl:variable name="rutaDocumentoEntrada"
select="document('http://www.animales/domesticos/europa/perros.xml')" />
but also not result
<xsl:variable name="rutaDocumentoEntrada"
select="document('http://www.animales/domesticos/europa/perros.xml')" />
but also not result
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Testing a catalog
Hi Francisco,
I'm glad this works for you, not sure why it did not work with the XML catalog placed at project level, it should have worked just as well as long as Oxygen properly managed to resolve the path tot he XML catalog. In this case with the XML catalog saved at project level the path to the XML catalog could have been ${pdu}/relative/path/to/catalog.xml as "${pdu}" resolves to the current project folder in URL syntax.
Regards,
Radu
I'm glad this works for you, not sure why it did not work with the XML catalog placed at project level, it should have worked just as well as long as Oxygen properly managed to resolve the path tot he XML catalog. In this case with the XML catalog saved at project level the path to the XML catalog could have been ${pdu}/relative/path/to/catalog.xml as "${pdu}" resolves to the current project folder in URL syntax.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service