[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    relative paths possible bug?
From:       "david garry" <david.garry () nomos-software ! com>
Date:       2012-07-31 11:50:01
Message-ID: 000601cd6f12$9e4922a0$dadb67e0$ () nomos-software ! com
[Download RAW message or body]

[Attachment #2 (multipart/related)]

[Attachment #4 (multipart/alternative)]


Hi there,

 

I wondering if I could ask the XMLBeans community about an issue I've
encountered when parsing a schema (exchange-schema.xsd attached).

 

When attempting to import the Schema I get the following error:

 

"error: Could not find resource - invalid location URL"

The problem is to do with the import of other namespaces. It looks like the
schemaLocation value on the import statement is not correct. The
schemaLocation value is a relative path value, e.g.

 

<xsd:import namespace="http://doj.ca.gov/niem/SearchWrnt/Extension/1.0"
schemaLocation="..\SearchWrnt\extension-schema.xsd"/> 

I understand that the problem is because the relative path used above should
probably contain the prefix 'file://'.

I have followed the email thread between Jacob and another user which seems
to be closely related.

http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200905.mbox/%3Cbb04eb
0a0905121445k4c3c8ac1ve5ace62be01d9318@mail.gmail.com%3E

I have followed the suggestions above without any success for a couple of
days.

In order to progress my issue, I checked-out the trunk
(http://svn.apache.org/repos/asf/xmlbeans/trunk) and made the following code
change on line 264 to org.apache.xmlbeans.impl.schema.StscImporter

Old:

 

URI childUri = new URI(child);

 

New:

 

URI childUri = null;

try

{

childUri = new URL(base.toURL(),child).toURI();

}

catch(MalformedURLException e)

{

childUri = new URI(child);

}

This has resolved my issue.

Would the XMlbeans community be able to tell me:

1)      - Is the issue I encountered an actual problem that needs fixing?

2)      - If so, can you inform of the code modification procedures so I may
go ahead and make the fix assumming my change is deemed appropriate?

3)      - If this is not a problem, can someone suggest ways I can resolve
my issue. (I'm not permitted to modify the XML Schemas)

Kind Regards

David

 

__________________________
David Garry
Description: Description: Description: NOMOS-logo-email
CTO,  <http://www.nomos-software.com/> Nomos Software
Direct Line: +353-21-4928945
Mobile: +353-86-1980236
Skype: david.garry3
 <https://twitter.com/nomossoftware> Description: Description: Description:
cid:image002.gif@01CD6A46.64269EC0
<http://www.linkedin.com/company/2508693> Description: Description:
Description: cid:image003.gif@01CD6A46.64269EC0

 


[Attachment #7 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 \
(filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);} o\:* \
{behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:"Microsoft Sans Serif";
	panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";
	mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:36.0pt;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
span.EmailStyle19
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:"Courier New";
	mso-fareast-language:EN-GB;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:510534426;
	mso-list-type:hybrid;
	mso-list-template-ids:-254494536 134807569 134807577 134807579 134807567 134807577 \
134807579 134807567 134807577 134807579;} @list l0:level1
	{mso-level-text:"%1\)";
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level2
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level3
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l0:level4
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level5
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level6
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
@list l0:level7
	{mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level8
	{mso-level-number-format:alpha-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level9
	{mso-level-number-format:roman-lower;
	mso-level-tab-stop:none;
	mso-level-number-position:right;
	text-indent:-9.0pt;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal>Hi there,<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I wondering if I could ask \
the XMLBeans community about an issue I&#8217;ve encountered when parsing a schema \
(exchange-schema.xsd attached).<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>When attempting to import the \
Schema I get the following error:<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span \
style='color:black;mso-fareast-language:EN-GB'>&#8220;error: Could not find resource \
&#8211; invalid location URL&#8221;<o:p></o:p></span></p><p class=MsoNormal> \
<o:p></o:p></p><p class=MsoNormal>The problem is to do with the import of other \
namespaces. It looks like the schemaLocation value on the import statement is not \
correct. The schemaLocation value is a relative path value, e.g.<o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue;background:white;mso-highlight:white'>&lt;</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:maroon;background:white;mso-highlight:white'>xsd:import</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white;mso-highlight:white'> \
namespace</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue;background:white;mso-highlight:white'>=&quot;</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;background:white;mso-highlight:white'>http://doj.ca.gov/niem/SearchWrnt/Extension/1.0</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue;background:white;mso-highlight:white'>&quot;</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:red;background:white;mso-highlight:white'> \
schemaLocation</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue;background:white;mso-highlight:white'>=&quot;</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;background:white;mso-highlight:white'>..\SearchWrnt\extension-schema.xsd</span><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue;background:white;mso-highlight:white'>&quot;/&gt;</span> \
<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'>I understand that the problem is because the \
relative path used above should probably contain the prefix \
&#8216;file://&#8217;.<o:p></o:p></span></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'>I have followed the email thread between Jacob and \
another user which seems to be closely related.<o:p></o:p></span></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a \
href="http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200905.mbox/%3Cbb04eb0a09 \
05121445k4c3c8ac1ve5ace62be01d9318@mail.gmail.com%3E">http://mail-archives.apache.org/ \
mod_mbox/xmlbeans-user/200905.mbox/%3Cbb04eb0a0905121445k4c3c8ac1ve5ace62be01d9318@mail.gmail.com%3E</a><span \
style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'>I have followed the suggestions above without any \
success for a couple of days.<o:p></o:p></span></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'>In order to progress my issue, I checked-out the \
trunk (<a href="http://svn.apache.org/repos/asf/xmlbeans/trunk">http://svn.apache.org/repos/asf/xmlbeans/trunk</a>) \
and made the following code change on line 264 to </span><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>org.apache.xmlbeans.impl.schema.StscImporter<o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>Old:<o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>URI childUri = \
</span><b><span style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>new</span></b><span \
style='font-size:10.0pt;font-family:Consolas;color:black'> \
URI(child);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>New:<o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>URI childUri = \
</span><b><span style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>null</span></b><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>;</span><span \
style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><b><span \
style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>try</span></b><span \
style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>{</span><span \
style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='text-indent:36.0pt;text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>childUri = </span><b><span \
style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>new</span></b><span \
style='font-size:10.0pt;font-family:Consolas;color:black'> \
URL(base.toURL(),child).toURI();</span><span \
style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>}</span><span \
style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><b><span \
style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>catch</span></b><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>(MalformedURLException \
e)</span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>{</span><span \
style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='text-indent:36.0pt;text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>childUri = </span><b><span \
style='font-size:10.0pt;font-family:Consolas;color:#7F0055'>new</span></b><span \
style='font-size:10.0pt;font-family:Consolas;color:black'> URI(child);</span><span \
style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt;font-family:Consolas;color:black'>}</span><span \
style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'>This has resolved my \
issue.<o:p></o:p></span></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'>Would the XMlbeans community be able to tell \
me:<o:p></o:p></span></p><p class=MsoListParagraph \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:-18.0pt;mso-list:l0 \
level1 lfo1'><![if !supportLists]><span style='mso-fareast-language:EN-GB'><span \
style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New \
Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span \
style='mso-fareast-language:EN-GB'>&#8211; Is the issue I encountered an actual \
problem that needs fixing?<o:p></o:p></span></p><p class=MsoListParagraph \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:-18.0pt;mso-list:l0 \
level1 lfo1'><![if !supportLists]><span style='mso-fareast-language:EN-GB'><span \
style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New \
Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span \
style='mso-fareast-language:EN-GB'>&#8211; If so, can you inform of the code \
modification procedures so I may go ahead and make the fix assumming my change is \
deemed appropriate?<o:p></o:p></span></p><p class=MsoListParagraph \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:-18.0pt;mso-list:l0 \
level1 lfo1'><![if !supportLists]><span style='mso-fareast-language:EN-GB'><span \
style='mso-list:Ignore'>3)<span style='font:7.0pt "Times New \
Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span \
style='mso-fareast-language:EN-GB'>&#8211; If this is not a problem, can someone \
suggest ways I can resolve my issue. (I&#8217;m not permitted to modify the XML \
Schemas)<o:p></o:p></span></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'>Kind Regards<o:p></o:p></span></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'>David<o:p></o:p></span></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='mso-fareast-language:EN-GB'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='font-size:10.0pt;font-family:"Microsoft Sans \
Serif","sans-serif";mso-fareast-language:EN-GB'>__________________________<br></span><span \
style='font-size:10.0pt;mso-fareast-language:EN-GB'>David Garry</span><span \
style='font-size:10.0pt;font-family:"Microsoft Sans \
Serif","sans-serif";mso-fareast-language:EN-GB'><br></span><span \
style='font-size:10.0pt;mso-fareast-language:EN-GB'><img border=0 width=100 height=40 \
id="Picture_x0020_1" src="cid:image001.gif@01CD6E7B.CE0B6B20" alt="Description: \
Description: Description: NOMOS-logo-email"></span><span \
style='font-size:10.0pt;font-family:"Microsoft Sans \
Serif","sans-serif";mso-fareast-language:EN-GB'><br></span><span \
style='font-size:10.0pt;mso-fareast-language:EN-GB'>CTO, </span><a \
href="http://www.nomos-software.com/"><span \
style='font-size:10.0pt;color:blue;mso-fareast-language:EN-GB'>Nomos \
Software</span></a><span \
style='font-size:10.0pt;mso-fareast-language:EN-GB'><br>Direct Line: \
+353-21-4928945<br>Mobile: +353-86-1980236<br>Skype: david.garry3</span><span \
style='font-size:10.0pt;font-family:"Microsoft Sans \
Serif","sans-serif";mso-fareast-language:EN-GB'><br></span><a \
href="https://twitter.com/nomossoftware"><span \
style='font-size:10.0pt;font-family:"Microsoft Sans \
Serif","sans-serif";color:windowtext;mso-fareast-language:EN-GB;text-decoration:none'><img \
border=0 width=24 height=24 id="Picture_x0020_2" \
src="cid:image002.gif@01CD6E7B.CE0B6B20" alt="Description: Description: Description: \
cid:image002.gif@01CD6A46.64269EC0"></span></a><span \
style='font-size:10.0pt;font-family:"Microsoft Sans \
Serif","sans-serif";mso-fareast-language:EN-GB'>&nbsp;</span><a \
href="http://www.linkedin.com/company/2508693"><span \
style='font-size:10.0pt;font-family:"Microsoft Sans \
Serif","sans-serif";color:windowtext;mso-fareast-language:EN-GB;text-decoration:none'><img \
border=0 width=24 height=24 id="Picture_x0020_3" \
src="cid:image003.gif@01CD6E7B.CE0B6B20" alt="Description: Description: Description: \
cid:image003.gif@01CD6A46.64269EC0"></span></a><span \
style='font-size:10.0pt;font-family:"Microsoft Sans \
Serif","sans-serif";mso-fareast-language:EN-GB'><o:p></o:p></span></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>


["image001.gif" (application/octet-stream)]
["image002.gif" (application/octet-stream)]
["image003.gif" (application/octet-stream)]
["xsds.zip" (application/x-zip-compressed)]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic