[ 
https://issues.apache.org/jira/browse/XERCESC-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520529
 ] 

Jesse Pelton commented on XERCESC-1738:
---------------------------------------

UNC paths are file paths, so a UNC URL must use the file: protocol. The 
protocol in a URL is always followed by two slashes, so your URL has to begin 
with "file://". There's a fair amount of disgreement about what follows, but 
one convention seems to have it that you then indicate the root of the 
directory file system with another slash, then the UNC path with backslashes 
replaced by forward slashes. (Note that backslashes are not allowed in URLs.)

So, many consumers of network resources retrieved by URL would understand 
file://///server/directory/file.xml. Others allow two less slashes: 
file:///server/directory/file.xml. I'm pretty sure Xerces understands the 
former.

> Please support forward slashes for UNC file names
> -------------------------------------------------
>
>                 Key: XERCESC-1738
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1738
>             Project: Xerces-C++
>          Issue Type: Wish
>          Components: Utilities
>    Affects Versions: 2.7.0
>         Environment: WinXP, Vista
>            Reporter: Soren Soe
>
> XercesDOMParser cannot parse/open XML documents specified in UNC path if the 
> path uses forward slashes. 
> For example //server/directory/file.xml causes a SAXParseExecption to be 
> thrown.
> I am not clear on the exact requirements of the UNC format (are forward 
> slashes even allowed), but nevertheless, most windows tools today support 
> both forward and backwards slashes.
> I debugged through the code.  UNC file paths with forward slashes could be 
> supported easily with an extra test for two forward slashes added to 
> XMLPlatformUtils::isRelative()  in win32platformutils.cpp.  
> bool XMLPlatformUtils::isRelative(const XMLCh* const toCheck
>                                   , MemoryManager* const /*manager*/)
> ...
>     //
>     //  If it starts with a double slash, then it cannot be relative since
>     //  it's a remote file.
>     //
>     if (isBackSlash(toCheck[0]) && isBackSlash(toCheck[1]))
>         return false;
> ...
> It appears all that is needed is to check for two forward slashes also.
> Thank you.
> Soren Soe

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to