more problems with xml-model processing instruction

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 & 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 & entities are not converted back to &, leading to errors in resolving the URL. Tara

On 24.11.2011 4:29, Tara Athan wrote:
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 & to avoid an error. This is as it should be.
No, entity references are not recognized inside processing instructions so & has to be entered directly withou escaping. Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------

Hi Jirka, Tara, Indeed PIs allow ampersand to be entered directly. However, the xml-model spec refers to the xml-stylesheet spec for pseudo-attributes http://www.w3.org/TR/2010/REC-xml-stylesheet-20101028/#dt-pseudo-attribute and that specifies that the presudo-attribute value should be obtained after processing character entities and predefined entities by replacing them with the corresponding characters: *** [Definition: The string matched by PseudoAttValue in the PseudoAtt production — with the three modifications specified below — constitutes the value of the corresponding pseudo-attribute.] Each CharRef is replaced with the character it represents according to XML [XML]. Each PredefEntityRef in PseudoAttValue is replaced with U+0026 (&) if it is "&", U+003C (<) if it is "<", U+003E (>) if it is ">", U+0022 (") if it is """ and U+0027 (') if it is "'". The first and last character (the start and end quotes) are removed. *** So, we should make sure we have this processing added to oXygen. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 11/24/11 9:42 AM, Jirka Kosek wrote:
On 24.11.2011 4:29, Tara Athan wrote:
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& to avoid an error. This is as it should be.
No, entity references are not recognized inside processing instructions so& has to be entered directly withou escaping.
Jirka
-- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------ _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

On 24.11.2011 9:09, George Cristian Bina wrote:
However, the xml-model spec refers to the xml-stylesheet spec for pseudo-attributes
So, we should make sure we have this processing added to oXygen.
Hi George, sorry, you are of course right. It was too early morning after too short sleep here :-) Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------

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&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& 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& entities are not converted back to&, leading to errors in resolving the URL.
Tara _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

I really hope you escape $_GET variables. D.
-----Original Message----- From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of Radu Coravu Sent: Thursday, November 24, 2011 10:45 AM To: oxygen-user@oxygenxml.com Subject: Re: [oXygen-user] more problems with xml-model processinginstruction
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&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& 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& entities are not converted back to&, leading to errors in resolving the URL.
Tara _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
Dit bericht is afkomstig van De Telefoongids BV en uitsluitend bestemd voor de geadresseerde. Dit bericht kan vertrouwelijke informatie bevatten. Als u dit bericht per abuis hebt ontvangen, dan wordt u verzocht de afzender te informeren en het bericht en eventuele bijlagen te vernietigen. Communicatie via Internet is niet beveiligd. De Telefoongids BV aanvaardt geen aansprakelijkheid voor wijzigingen in de inhoud van het bericht en eventuele bijlagen, onrechtmatige openbaarmaking ervan jegens derden of schade als gevolg van gebruik van e-mailcommunicatie. De Telefoongids BV is gevestigd te Amsterdam (Handelregister nr. 27198207). ---------------------------------------------------------------------------------------------------------------------------- This message is sent from De Telefoongids BV and is intended only for use by the recipient. It may contain confidential information. If you are not the intended recipient, please advise the sender immediately by reply e-mail and delete this message and any attachments. Internet communications are not secure. De Telefoongids BV does not accept any liability for mutilations to the contents of this message and attachments thereto, if any, unlawful disclosure thereof to third parties, or damage resulting from the use of e-mail communications. De Telefoongids BV is a private limited company with its seat in Amsterdam (Trade Register no. 27198207).

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&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& 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& entities are not converted back to&, leading to errors in resolving the URL.
Tara _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (5)
-
Daniel Crompton
-
George Cristian Bina
-
Jirka Kosek
-
Radu Coravu
-
Tara Athan