[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Catalogs, rewriteURI and xml:base

  • From: cmarchand@oxiane.com
  • To: xml-dev@lists.xml.org
  • Date: Wed, 09 Nov 2016 16:23:44 +0100

Re:  Catalogs
Nobody ? Norm, Apache xml-community ?
No idea ?

Christophe

Le 2016-11-07 14:25, Christophe Marchand a écrit :
Hello,

I've something strange, and don't know if I do not understand OASIS
catalog specification, or if there is a bug in Apache Resolver...

I have this catalog :

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <group xml:base="cp:/catalog.xml">
    <rewriteURI uriStartString="foo:" rewritePrefix="cp:"/>
    <rewriteSystem systemIdStartString="foo:" rewritePrefix="cp:"/>
  </group>
  <group xml:base="file:/home/fake/catalog.xml" [1]>
    <rewriteURI uriStartString="bar:" rewritePrefix="cp:"/>
    <rewriteSystem systemIdStartString="bar:" rewritePrefix="cp:"/>
  </group>
</catalog>

Dependending on I have or not support for cp: protocol (first group
xml:base), the first xml:base (cp:/catalog.xml) is rewritten fo
file:cp:/catalog.xml. It is normal ? I can imagine that new
URI(xx).isAbsolute() is used to know if it should be absolutized (?).
That's strange, but, Ok, I can accept this...

Then, if cp: support is enabled, if I try to resolve
bar:/schemaBar/bar.rnc, it is resolved as cp:/schemaBar/bar.rnc, but
if I try to resolve foe:/schemaFoe/foe.rnc, it is resolved as null.

My question is : with rewriteSystem / rewriteURI, does the xml:base
may change the resolution ? In specification, xml:base is not
mentionned in
https://www.oasis-open.org/committees/entity/spec-2001-08-06.html#s.rewrite,
but it is said " If the value of the rewritePrefix attribute is
relative, it must be made absolute with respect to the base URI
currently in effect."  in
https://www.oasis-open.org/committees/entity/spec-2001-08-06.html#s.rewritesystem


My thought was that xml:base was used only to absolutized relatives
URI, and not absolute ones. Then, with Apache resolver, if I set debug
output ON, I get this while loading catalog :

Cannot find CatalogManager.properties
Parse catalog: ./xcatalog
Loading catalog: ./xcatalog
Default BASE:
file:////home/ext-cmarchand/devel/apache/xml-commons/xcatalog
Catalog does not exist:
file:////home/ext-cmarchand/devel/apache/xml-commons/xcatalog
Parse catalog: ../../github/jing-trang/cmarchand_test/catalog-bug.xml
Loading catalog:
../../github/jing-trang/cmarchand_test/catalog-bug.xml
Default BASE:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml
xml:base: cp:/catalog.xml
BASE CUR:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml
BASE STR: cp:/catalog.xml
BASE NEW: cp:/catalog.xml
rewriteURI: foo:
    cp:
REWRITE_URI: foo:
    cp:/catalog.xml
rewriteSystem: foo:
    cp:
REWRITE_SYSTEM: foo:
    cp:/catalog.xml
(reset) xml:base:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml
BASE CUR: cp:/catalog.xml
BASE STR:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml
BASE NEW:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml
xml:base: file:/home/fake/catalog.xml
BASE CUR:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml
BASE STR: file:/home/fake/catalog.xml
BASE NEW: file:/home/fake/catalog.xml
rewriteURI: bar:
    cp:
REWRITE_URI: bar:
    cp:
rewriteSystem: bar:
    cp:
REWRITE_SYSTEM: bar:
    cp:
(reset) xml:base:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml
BASE CUR: file:/home/fake/catalog.xml
BASE STR:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml
BASE NEW:
file:////home/ext-cmarchand/devel/github/jing-trang/cmarchand_test/catalog-bug.xml

We can see the REWRITE_SYSTEM are not processed the same with
different xml:base.

I will enjoy any help to locate the problem (my code, my catalog, or
Apache Resolver)...

Thanks in advance,
Christophe


Links:
------
[1] file:/home/fake/catalog.xml


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.