[4suite] [amara] windows path usage - requires file URI at cvs head?

Erik Purins epurins at day1studios.com
Wed Aug 1 16:02:24 MDT 2007


Hi 4suite users,

Evaluating XML tool kits for python.
Tried to use amara following web documents, but using a windows file
path 'c:\test.xml' in the context below dies.

Since the error was in trying to normalize an URI, did a quick test of
using 'file:///c:/test.xml' - uri works ok. 

We should probably update the web docs for amara at
http://uche.ogbuji.net/tech/4suite/amara/ if the current released
version of amara exhibits this behavior and it's as-designed (windows
users having to use uri instead of native file path), or possibly fix
the path mechanism. I haven't gotten around to registering for the wiki
http://notes.4suite.org/ to add anything useful.

Sorry if this has been covered before. I did a quick search for 4suite
and 4suite-dev mailing lists with related key words, but didn't get hits
with answers I needed.

Best regards and looking forward to useful engineering using your API,

-e

-- snip --

C:\Documents and Settings\epurins>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Ft
>>> Ft.__version__
'1.1a0'
>>> import amara
>>> amara.__version__
'1.2.0.2'
>>> filename = (r'C:\test.xml')
>>> doc = amara.parse(filename)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python25\Lib\site-packages\amara\__init__.py", line 62, in
parse
    prefixes=prefixes, validate=validate,
binding_classes=binding_classes)
  File "c:\Python25\Lib\site-packages\amara\binderytools.py", line 76,
in bind_uri
    isrc = isrc_factory.fromUri(uri)
  File "c:\Python25\lib\site-packages\Ft\Xml\InputSource.py", line 320,
in fromUri
    return src._resolve(uri, None, hint)
  File "c:\Python25\lib\site-packages\Ft\Xml\InputSource.py", line 210,
in _resolve
    uri = self._normalize(uri, base)
  File "c:\Python25\lib\site-packages\Ft\Xml\InputSource.py", line 226,
in _normalize
    return self.getUriResolver().normalize(uriref, base)
  File "c:\Python25\lib\site-packages\Ft\Lib\Uri.py", line 1027, in
normalize
    return UriResolverBase.normalize(self, uriRef, baseUri)
  File "c:\Python25\lib\site-packages\Ft\Lib\Uri.py", line 943, in
normalize
    resolver=self.__class__.__name__)
Ft.Lib.UriException: The URI scheme C is not supported by resolver
FtUriResolver

>>> filename = (r'file:///c:/test.xml')
>>> doc = amara.parse(filename)
>>> doc
<amara.bindery.root_base object at 0x013E0450>
>>>
















































































































--

Erik Purins
epurins at day1studios.com
(312) 258-0500 x224



More information about the 4suite mailing list