You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Soren Soe (JIRA)" <xe...@xml.apache.org> on 2007/08/17 01:45:31 UTC

[jira] Created: (XERCESC-1738) Please support forward slashes for UNC file names

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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1738) Please support forward slashes for UNC file names

Posted by "Soren Soe (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESC-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520594 ] 

Soren Soe commented on XERCESC-1738:
------------------------------------

Thanks.  I can see that file:////server/directory/file.xml is indeed supported.

I guess my question really is why "//server/directory/file.xml " (without the file://)  is not supported when "\\server\directory\file.xml" is supported?   It seems supporting the former would require just a check for the two forward slashes.   System calls on windows have no problem working with files specified in either form.

> 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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1738) Please support forward slashes for UNC file names

Posted by "Jesse Pelton (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESC-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520601 ] 

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

I'm not sure why leading backslashes are supported; they're not legal in URIs (see http://www.faqs.org/rfcs/rfc3986.html). If I had to guess, it's a convenience feature. Personally, I think such features are misguided, as they contribute to confusion. UNC paths are not URIs, and programs that hide the difference encourage people to think that they're equivalent.

> 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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1738) Please support forward slashes for UNC file names

Posted by "Jesse Pelton (JIRA)" <xe...@xml.apache.org>.
    [ 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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org