Re: [xslt] Win2K,xsltproc ignores catalog



On Mon, 17 Feb 2003, Wim de Vries wrote:
> OK. please let me know when I am wrong...
> If I understand the RFC 2396 correctly then '/' is an abstract
> (parent/child) separator. So,
> xxxx:///c:\dir1\dir2/dir3/source has 4 parts:
> xxxx: =scheme
> /// =authority is empty
> c:\dir1\dir2 =first part of  URI path (in URI terms no more meaning then a
> string "c:\dir1\dir2")
> dir3 =second part of URI path;
> source =final resource.
> If xxxx is file then the URI should be resolve to a file-path. In Windows
> it should be resolve to
> c:\dir1\dir2\dir3\source
> Back to my example:
> XML_CATOLOG_FILES = file:///C:\XSherLock0.1/catalog.xml
> So, 5.1.3 RFC ("Base URI from retrieval URI") applies, and the URI to
> 'retrieve' catalog.xml is the one supplied by XML_CATOLOG_FILES
> :  file:///C:\XSherLock0.1/
> In order to find the dtd at the Win-file-system
> c:\xsherlock0.1\art500\art500.dtd
> catlog.xml contains <public publicId="bla-bla" uri="./art500/art500.dtd"/>
> Like you said, this should result in
> file:///C:\XSherLock0.1/art500/art500.dtd
> Still, xsltproc cannot find the dtd. And if catalog.xml contains the
> absolute uri <public publicId="bla-bla"
> uri="file:///C:/XSherLock0.1/art500/art500.dtd"/>,  it does work!
> It seems like the uri of XML_CATALOG_FILES is interpreted differently than
> the uri of a XML-catalog.

Of course they are different. A catalog is a XML file, which is
standardised, follows the specification, and allows only URIs.
XML_CATALOG_FILES is an environment variable, specific to libxml, and libxml
may set any rule regarding to it, be it the contents or anything else. Noone
ever said that the content of the two complies to the same rules.

About the backslash in the URI, here is a bit from the RFC 2396:

  Other characters are excluded because gateways and other transport
  agents are known to sometimes modify such characters, or they are
  used as delimiters.
  unwise      = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"
  Data corresponding to excluded characters must be escaped in order to
  be properly represented within a URI.

which is why an unescaped backslash is not allowed within an URI. The
construct like 'file:///C:\XSherLock0.1/catalog.xml' is therefore an
invalid URI.

Now, what exactly is your problem? Do you insist on using backslashes in the
URI, or do you claim that libxml/libxslt does not find a resource specified
by a valid relative URI? I somehow didn't get that :-)

Ciao,
Igor



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]