[oXygen-user] more problems with xml-model processing instruction

Radu Coravu radu_coravu at sync.ro
Fri Nov 25 09:30:23 CST 2011


Hi Tara,

In Oxygen in the Window->Show view menu there is a view called Information.
It shows you information about the schema against which the XML is 
validated. So this could be an indication for you as a developer as to 
what schema is used for validation.

About the PHP script, instead of returning a valid schema why not return 
an HTTP error code (with a custom message maybe)? This should be 
reported on the client validation side.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 11/25/2011 5:09 PM, Tara Athan wrote:
> My apologies for not making such a simple test myself before posting. I
> discovered the error was in my URL input, compounded by the generous
> exception handling I have in my PHP script.
>
> While this lets oXygen off the hook, it highlights an issue regarding
> the use of web services for dynamically generating schemas for
> validation - there is a break in the exception-handling chain at the
> level of validation. Because the processing to create the schema is
> being performed on a webserver, there is no means, other than the served
> schema itself, to communicate back to the validator with a warning
> message that an exception has been handled, or an error message if not
> handled. The minimum level of this capability would be an annotation
> (which in Relax NG could be added to the schema as a foreign element)
> which the validator (Jing in this case) would reproduce verbatim.
>
> This would help solve another issue I have encountered with multiple
> schema processing - unlike the XSD schema validators, when Jing is
> successful, it is silent, there is no affirmation that the validation
> was successfully performed. I will often temporarily introduce an error
> into the instance in order to get a Jing error message just to verify
> that the Jing validation is being performed. An annotation that gets
> copied to the Jing output could be used as an indicator of application
> of the schema.
>
> There is a jing-trang issue that is perhaps related -
> http://code.google.com/p/jing-trang/issues/detail?id=45 . I have added a
> comment there.
>
> Tara
>
> Radu Coravu wrote:
>> Hi Tara,
>>
>> I made some tests with Oxygen 13.1 and the application seems to
>> correctly unescape the entities in the xml-model value before passing
>> the information to the validator.
>>
>> In my test I used an XML file with the content:
>>
>>
>>> <?xml-model href="http://devel-new.sync.ro/~test/testAmp.php?a=b&amp;c=el3"  type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
>>> <root></root>
>>>
>>
>> which used for validation a simple PHP script located on our web server
>> with the content:
>>
>>
>>> <?php
>>>   echo "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified'>
>>>      <xs:element name='root'>
>>>          <xs:complexType>
>>>              <xs:sequence>
>>>                  <xs:element name='";
>>> echo $_GET["c"];
>>> echo "'/>
>>>              </xs:sequence>
>>>          </xs:complexType>
>>>      </xs:element>
>>> </xs:schema>";
>>> ?>
>>>
>>
>> So the PHP script returned a slightly different XML Schema depending on
>> the value of the "c" GET parameter.
>>
>> Changing the value of the "c" parameter directly in the XML changed the
>> error received from the Xerces parser.
>>
>> Could you give me a simple example which shows the problem on your side?
>>
>> Regards,
>> Radu
>>
>> Radu Coravu
>> <oXygen/>   XML Editor, Schema Editor and XSLT Editor/Debugger
>> http://www.oxygenxml.com
>>
>>
>> On 11/24/2011 5:29 AM, Tara Athan wrote:
>>
>>> In Oxygen 12.2&   13.1:
>>> If the value of the @href attribute of an xml-model processing
>>> instruction is a URL with query string, the ampersands in the query
>>> string must be replaced with&amp; to avoid an error. This is as it
>>> should be.
>>>
>>> BUT when the attribute value is then used to obtain the schema, it
>>> appears that the&amp; entities are not converted back to&, leading to
>>> errors in resolving the URL.
>>>
>>>
>>>
>>> Tara
>>> _______________________________________________
>>> oXygen-user mailing list
>>> oXygen-user at oxygenxml.com
>>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>>
>>>
>> _______________________________________________
>> oXygen-user mailing list
>> oXygen-user at oxygenxml.com
>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>
>>
>



More information about the oXygen-user mailing list