uriStartString format

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Richard_Wood
Posts: 16
Joined: Tue Jan 12, 2016 9:41 pm

uriStartString format

Post by Richard_Wood »

We are trying to create a rewriteURI entry in our XML Catalog.
The substitution isn't occurring with our current entry.
In all examples that I have viewed, the uriStartString begins with one of several prefixes like: http://, file:///, urn:someName...
In our case, we have the following:
<rewriteURI uriStartString="Spec2500Rev2017dotFinal/" rewritePrefix="file:///C:/Temp/" />

In our instance we have:
<myRoot xsi:noNamespaceSchemaLocation="Spec2500Rev2017dotFinal/someOtherStuff" >

Must the uriStartString begin with a special qualifier, or is there some other problem.
For example, do we need to have:
<myRoot xsi:noNamespaceSchemaLocation="urn:Spec2500Rev2017dotFinal/someOtherStuff" >
See our attached screen shot of associated files and locations.

Regards,

Rich Wood
rewriteURI_not_working.gif
rewriteURI_not_working.gif (210.79 KiB) Viewed 1154 times
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: uriStartString format

Post by tavy »

Hello Rich,

Thanks for your feedback.
Unfortunately I cannot reproduce the problem. I created a simple XML document with an associated XSD, something like this:

Code: Select all

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Spec2500Rev2017dotFinal/root.xsd" >
    <child>a</child>
</root>
Then I created an XML catalog with rewriteURI :

Code: Select all

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <rewriteURI uriStartString="Spec2500Rev2017dotFinal/" rewritePrefix="file:///C:/Temp/" />
</catalog>
I added the catalog in Options->Preferences->XML / XML Catalog option page.

The XSD document is resolved correctly through catalog, and the validation works fine.
I tested with <oXygen/> XML Editor 23.1, build 2021061407.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Richard_Wood
Posts: 16
Joined: Tue Jan 12, 2016 9:41 pm

Re: uriStartString format

Post by Richard_Wood »

Tavy,

I was asked to mention that we are using v18.1 of Oxygen.
Other than that, it must be something in our Options/Preferences that is off I suppose.

Thanks for checking on this.
If you have any other thoughts of where we could look for something improperly set, please don't hesitate.
In the meantime, we will fiddle around, knowing that it should work.

Regards,

Rich
Richard_Wood
Posts: 16
Joined: Tue Jan 12, 2016 9:41 pm

Re: uriStartString format

Post by Richard_Wood »

Tavy,

Just one more try, sorry that I am not seeing our issue.

I am running: XML Editor 18.0, build 2016042012
I went back and tried to replicate your example:
I created an instance:

Code: Select all

C:\Users\nm040a\Desktop\junk\catalog_example.xml
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Spec2500Rev2017dotFinal/root.xsd" >
    <child>a</child>
</root>
Then I created a catalog file:

Code: Select all

C:\Users\nm040a\Desktop\junk\catalog.xml
<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <rewriteURI uriStartString="Spec2500Rev2017dotFinal/" rewritePrefix="file:///C:/Temp/" />
</catalog>
Then I updated my Options/Preferences/XML/catalog to include my catalog (see attached image)
Then I shut down Oxygen and restarted it to make sure everything loaded and was in affect.
Then I parsed my instance.

I received this severity:ERROR message:
Severity: Error
Description:schema_reference.4: Failed to read schema document 'file:/C:/Users/nm040a/Desktop/junk/Spec2500Rev2017dotFinal/root.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

Below is the content of our default catalog.xml

Do you have any ideas about where else should I be looking for an incorrect setting?
Our configuration is substituting in the path to the file location rather than performing the rewriteURI substitution.
And it is leaving the uriStartString in place.


Regards,

Rich

Code: Select all

C:\Program Files\Oxygen XML Editor 18\frameworks\catalog.xml
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <nextCatalog catalog="jsp/xsd/jspcatalog.xml"/>
  <nextCatalog catalog="xml/catalog.xml"/>
  <nextCatalog catalog="xlink/catalog.xml"/>
  <nextCatalog catalog="xinclude/catalog.xml"/>
  <nextCatalog catalog="schema_documentation/catalog.xml"/>
  <nextCatalog catalog="wsdl_documentation/catalog.xml"/>
  <nextCatalog catalog="stylesheet_documentation/catalog.xml"/>
  <nextCatalog catalog="xforms/catalog.xml"/>
  <nextCatalog catalog="xmldsig/catalog.xml"/>
  <nextCatalog catalog="css_support/catalog.xml"/>
</catalog>
Attachments
image.png
image.png (13.41 KiB) Viewed 1123 times
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: uriStartString format

Post by tavy »

Hello,

It seems that in Oxygen 18.0 the rewriteURI does not work well. I suggest to use a full path in the XML instance for referencing for the schema. Something like this:

Code: Select all

 xsi:noNamespaceSchemaLocation="file:///Spec2500Rev2017dotFinal/root.xsd"
Then change the XML catalog something like this:

Code: Select all

<rewriteURI uriStartString="file:///Spec2500Rev2017dotFinal/" rewritePrefix="file:///C:/Temp/" />
Oxygen XML Editor 18.0 has reached the end of life phase, For older versions that have reached the end of life phase, see our End of Life Policy.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Richard_Wood
Posts: 16
Joined: Tue Jan 12, 2016 9:41 pm

Re: uriStartString format

Post by Richard_Wood »

Thank-you Tavy,

Yes, it would be nice to have software kept up to date.

In the meantime, we do have a solution working using a solution similar to yours, but using "urn:" instead of "file:///".

Thank-you very much for your support!

Regards,

Rich
Post Reply