Re: [oXygen-user] regression of oxygen 12.2: validation against rnc schema without .rnc extension on URL

I figured this out, quite by accident. "& in an href attribute must be escaped as &" This is an HTML rule, but apparently also applies to the href in your processing instruction, because when I tried my string with &, it works. *********************************** Before I updated to oXygen 12.2, I was able validate against a URL with a query string that generates an RNC schema ( the URL points to a PHP script that generates an RNC schema customized to the parameters in the query string). Now with the new <?xml-model?> tag, it does not recognize the URL, and gives an error message "SystemID: C:\Documents and Settings\All Users\Documents\RuleML\WP1\schema\tests\validation_on_URL_w_query_string\test_validation_on_URL_w_query_string.xml Main validation file: C:\Documents and Settings\All Users\Documents\RuleML\WP1\schema\tests\validation_on_URL_w_query_string\test_validation_on_URL_w_query_string.xml Engine name: oXygen Severity: error Description: There is no schema or DTD associated with the document. You can create an association either with the Associate Schema action or configuring in the Options the Preferences/Document Type Association list, or by creating a Validation Scenario. " I can (and you can too ;) manually verify that the URL is not broken, and does indeed point to an RNC schema. Also, when I use a redirect (on my server) that disguises this URL as a physical file with an .rnc extension, oXygen is able to validate against that. Below is the instance document that should validate. <?xml version="1.0" encoding="UTF-8"?> <?xml-model href="http://ruleml.org/0.91/relaxng/schema_rnc.php?backbone=x3f&default=x7&termseq=x7&lng=x1&propo=x3f&implies=x7&terms=xf3f&quant=x7&expr=xf&serial=xf" type="application/relax-ng-compact-syntax"?> <RuleML xmlns="http://www.ruleml.org/0.91/xsd"> <Assert> <Exists> <Var>X</Var> <And> <Atom> <oid> <Var>X</Var> </oid> <Rel>P</Rel> </Atom> </And> </Exists> </Assert> </RuleML> The URL redirect that does validate is "http://www.ruleml.org/0.91/relaxng/naffologeq_relaxed.rnc" Could you please modify this feature so that the explicit .rnc extension is not required? There is no need for it to be required, as the schema type is specified with the @type attribute. I would report this as an issue, but I can't find the issue tracker from your website. Tara

Hi Tara, Well, from what it seems according to the xml-model specification: http://www.w3.org/TR/2010/NOTE-xml-model-20100415/#the-xml-model-processing-... Oxygen should not expect the "&" to be followed by "amp;" as it does now. I added this as a bug to our issues list. The fix will probably be available in one of the Oxygen 12.2 minor bug fix versions. Such versions are usually reported on this RSS feed: http://www.oxygenxml.com/rssBuildID.xml So in the next minor release of Oxygen 12.2 you will probably have to "un-escape" the "&"'s back to simple "&" in order to properly validate the XML with the schema. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 6/19/2011 1:27 AM, Tara Athan wrote:
I figured this out, quite by accident. "& in an href attribute must be escaped as&" This is an HTML rule, but apparently also applies to the href in your processing instruction, because when I tried my string with&, it works.
*********************************** Before I updated to oXygen 12.2, I was able validate against a URL with a query string that generates an RNC schema ( the URL points to a PHP script that generates an RNC schema customized to the parameters in the query string). Now with the new<?xml-model?> tag, it does not recognize the URL, and gives an error message "SystemID: C:\Documents and Settings\All Users\Documents\RuleML\WP1\schema\tests\validation_on_URL_w_query_string\test_validation_on_URL_w_query_string.xml Main validation file: C:\Documents and Settings\All Users\Documents\RuleML\WP1\schema\tests\validation_on_URL_w_query_string\test_validation_on_URL_w_query_string.xml Engine name: oXygen Severity: error Description: There is no schema or DTD associated with the document. You can create an association either with the Associate Schema action or configuring in the Options the Preferences/Document Type Association list, or by creating a Validation Scenario. " I can (and you can too ;) manually verify that the URL is not broken, and does indeed point to an RNC schema.
Also, when I use a redirect (on my server) that disguises this URL as a physical file with an .rnc extension, oXygen is able to validate against that. Below is the instance document that should validate.
<?xml version="1.0" encoding="UTF-8"?> <?xml-model href="http://ruleml.org/0.91/relaxng/schema_rnc.php?backbone=x3f&default=x7&termseq=x7&lng=x1&propo=x3f&implies=x7&terms=xf3f&quant=x7&expr=xf&serial=xf"
type="application/relax-ng-compact-syntax"?> <RuleML xmlns="http://www.ruleml.org/0.91/xsd"> <Assert> <Exists> <Var>X</Var> <And> <Atom> <oid> <Var>X</Var> </oid> <Rel>P</Rel> </Atom> </And> </Exists> </Assert> </RuleML>
The URL redirect that does validate is "http://www.ruleml.org/0.91/relaxng/naffologeq_relaxed.rnc"
Could you please modify this feature so that the explicit .rnc extension is not required? There is no need for it to be required, as the schema type is specified with the @type attribute.
I would report this as an issue, but I can't find the issue tracker from your website.
Tara
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Tara, After reading more specs: Actually the specs state that the pseudo-attributes for the xml-model must have the "&" escaped to "&". Here is a page linked from the xml-model specs: http://www.w3.org/XML/2009/12/xml-stylesheet/#dt-value So: Oxygen handles correctly the value when validating (expecting the & to be escaped to &) although it should give a more meaningful message. But the "Associate schema" action used from Oxygen toolbar to associate the XML with the schema should insert the "href" value properly XML-escaped. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 6/20/2011 12:32 PM, Radu Coravu wrote:
Hi Tara,
Well, from what it seems according to the xml-model specification:
http://www.w3.org/TR/2010/NOTE-xml-model-20100415/#the-xml-model-processing-...
Oxygen should not expect the "&" to be followed by "amp;" as it does now.
I added this as a bug to our issues list. The fix will probably be available in one of the Oxygen 12.2 minor bug fix versions. Such versions are usually reported on this RSS feed:
http://www.oxygenxml.com/rssBuildID.xml
So in the next minor release of Oxygen 12.2 you will probably have to "un-escape" the"&"'s back to simple "&" in order to properly validate the XML with the schema.
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 6/19/2011 1:27 AM, Tara Athan wrote:
I figured this out, quite by accident. "& in an href attribute must be escaped as&" This is an HTML rule, but apparently also applies to the href in your processing instruction, because when I tried my string with&, it works.
*********************************** Before I updated to oXygen 12.2, I was able validate against a URL with a query string that generates an RNC schema ( the URL points to a PHP script that generates an RNC schema customized to the parameters in the query string). Now with the new<?xml-model?> tag, it does not recognize the URL, and gives an error message "SystemID: C:\Documents and Settings\All Users\Documents\RuleML\WP1\schema\tests\validation_on_URL_w_query_string\test_validation_on_URL_w_query_string.xml Main validation file: C:\Documents and Settings\All Users\Documents\RuleML\WP1\schema\tests\validation_on_URL_w_query_string\test_validation_on_URL_w_query_string.xml Engine name: oXygen Severity: error Description: There is no schema or DTD associated with the document. You can create an association either with the Associate Schema action or configuring in the Options the Preferences/Document Type Association list, or by creating a Validation Scenario. " I can (and you can too ;) manually verify that the URL is not broken, and does indeed point to an RNC schema.
Also, when I use a redirect (on my server) that disguises this URL as a physical file with an .rnc extension, oXygen is able to validate against that. Below is the instance document that should validate.
<?xml version="1.0" encoding="UTF-8"?> <?xml-model href="http://ruleml.org/0.91/relaxng/schema_rnc.php?backbone=x3f&default=x7&termseq=x7&lng=x1&propo=x3f&implies=x7&terms=xf3f&quant=x7&expr=xf&serial=xf"
type="application/relax-ng-compact-syntax"?> <RuleML xmlns="http://www.ruleml.org/0.91/xsd"> <Assert> <Exists> <Var>X</Var> <And> <Atom> <oid> <Var>X</Var> </oid> <Rel>P</Rel> </Atom> </And> </Exists> </Assert> </RuleML>
The URL redirect that does validate is "http://www.ruleml.org/0.91/relaxng/naffologeq_relaxed.rnc"
Could you please modify this feature so that the explicit .rnc extension is not required? There is no need for it to be required, as the schema type is specified with the @type attribute.
I would report this as an issue, but I can't find the issue tracker from your website.
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

Radu Coravu wrote: Hi,
Actually the specs state that the pseudo-attributes for the xml-model must have the "&" escaped to "&". Here is a page linked from the xml-model specs:
What I understand from there is that PredefEntityRef must be analyzed as such (and thus decoded) but the characters they represent do not have to be be escaped. That is: "a&b" must be parsed as "a&b", but you can also have "a&b" directly in the PI's data. But I might have missed something, of course. Regards, -- Florent Georges http://fgeorges.org/

Hi Florent, The xml-model spec says: *** href Specifies the location of the referenced schema. Documents must specify this pseudo-attribute. Documents must set the *value* to a string that matches the grammar for <IRI-reference> given in RFC 3987 [RFC3987]. *** and *value* above points to http://www.w3.org/XML/2009/12/xml-stylesheet/#dt-value *** [Definition: The string matched by PseudoAttValue in the PseudoAtt production — after any CharRefs and PredefEntityRefs are replaced with the characters they represent — constitutes the value of the corresponding pseudo-attribute.] Each CharRef in PseudoAttValue is replaced with the character it represents according to XML. [XML] Each PredefEntityRef in PseudoAttValue is replaced with 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 "'". *** which defines the value as a string matching the PseudoAttValue production that is further processed to replace some entity references with characters. The important thing is the PseudoAttValue production that the string needs to match, and that does not allow & directly, only as part of an entity reference: [3] PseudoAttValue ::= ('"' ([^"<&] | CharRef | PredefEntityRef)* '"' | "'" ([^'<&] | CharRef | PredefEntityRef)* "'") Please let me know if you still think that & should be allowed. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 6/20/11 2:50 PM, Florent Georges wrote:
Radu Coravu wrote:
Hi,
Actually the specs state that the pseudo-attributes for the xml-model must have the "&" escaped to"&". Here is a page linked from the xml-model specs:
What I understand from there is that PredefEntityRef must be analyzed as such (and thus decoded) but the characters they represent do not have to be be escaped. That is: "a&b" must be parsed as "a&b", but you can also have "a&b" directly in the PI's data.
But I might have missed something, of course.
Regards,

George Cristian Bina wrote: Hi,
The important thing is the PseudoAttValue production that the string needs to match, and that does not allow & directly, only as part of an entity reference:
[3] PseudoAttValue ::= ('"' ([^"<&] | CharRef | PredefEntityRef)* '"' | "'" ([^'<&] | CharRef | PredefEntityRef)* "'")
Yes you're right, I missed the "^" in the character class, thus prohibiting "&" to appear unescaped. Sorry for the noise. Regards, -- Florent Georges http://fgeorges.org/

On Mon, June 20, 2011 12:50 pm, Florent Georges wrote:
Radu Coravu wrote:
Actually the specs state that the pseudo-attributes for the xml-model must have the "&" escaped to "&". Here is a page linked from the xml-model specs:
What I understand from there is that PredefEntityRef must be analyzed as such (and thus decoded) but the characters they represent do not have to be be escaped. That is: "a&b" must be parsed as "a&b", but you can also have "a&b" directly in the PI's data.
Production 3 [1] prohibits "bare" '&' or '<': [3] PseudoAttValue ::= ('"' ([^"<&] | CharRef | PredefEntityRef)* '"' | "'" ([^'<&] | CharRef | PredefEntityRef)* "'") This is a good match for Production 10 of the XML Rec [2]: [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" Regards, Tony Graham tgraham@mentea.net Consultant http://www.mentea.net Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XML, XSL FO and XSLT consulting, training and programming [1] http://www.w3.org/XML/2009/12/xml-stylesheet/#pseudo-attributes [2] http://www.w3.org/TR/xml/#sec-common-syn
participants (5)
-
Florent Georges
-
George Cristian Bina
-
Radu Coravu
-
Tara Athan
-
Tony Graham