Page 1 of 1

Dynamic XSD by "magic URLs"

Posted: Mon May 29, 2017 9:09 am
by Patrik
Hi,

in our DITA documents we have plenty of xml samples. Thus, we need good support for creating and validating them.

My idea is now to import them from a seperate xml file (customization of codeblock + coderef) having a dynamically created schema assigned to it:

Code: Select all

<samples xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="convert:/processor=java;jars=DitaSemiaOxygen.jar;ccn=org.DitaSemia.Oxygen.AdvancedKeyRef.DynamicXsd;root=Message/VU_GDV_001!/test-topic.dita">
   <sample id="1">
      [...]
   </sample>
   <sample id="2">
      [...]
   </sample>
</samples>


The first experiments look already very promising: validation anf content completion is working fine.

But currently I have these two issues:
  1. The target URL (here: "test-topic.dita") is being resolved relative to the oxygen installation folder - not relative to my samples.xml file. (With an urn it works, but this is very unappropriate for my use-case.)
  2. The custom properties I need to pass might contains a "/" (in the sample: "root=Message/VU_GDV_001"). Is there any way to escape these characters to avoid the property value to be cut there?

I'm currently using oXygen 18.1.

Thanks and regards,
Patrik

Re: Dynamic XSD by "magic URLs"

Posted: Mon May 29, 2017 3:56 pm
by Radu
Hi Patrik,

So:

The target URL (here: "test-topic.dita") is being resolved relative to the oxygen installation folder - not relative to my samples.xml file. (With an urn it works, but this is very unappropriate for my use-case.)


I cannot guarantee that we can get the relative paths to properly work. Honestly I do not understand the entire thing.
So you have a codeblock with a coderef pointing directly to this XML document? And the XML document uses the convert protocol to point to a schema? But the schema is actually a DITA topic which is passed through your custom Java code to create the schema?
So you open the samples.xml document in Oxygen and that is the moment when Oxygen cannot properly convert the relative reference to "topic.dita" to an absolute location.
Would you be willing to give me some precise steps + samples to test this on my side?
If so you can attach the samples and steps to our tech support online form:

https://www.oxygenxml.com/techSupport.html

The custom properties I need to pass might contains a "/" (in the sample: "root=Message/VU_GDV_001"). Is there any way to escape these characters to avoid the property value to be cut there?


You can try to escape that in the URL to its hexadecimal equivalent '%2f'.

Regards,
Radu

Re: Dynamic XSD by "magic URLs"

Posted: Mon Oct 02, 2017 1:32 pm
by Radu
Hi,

Oxygen 19.1 was released and it should have a fix for this issue as well.

Regards,
Radu