Skip to content

Commit

Permalink
adding option to MYNG REST interface for includes to use absolute URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
greenTara committed Jul 2, 2014
1 parent e0db46b commit 69b7e4e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions relaxng/schema_rnc.php
Expand Up @@ -96,6 +96,7 @@
$serialization_datatyping = 2;
$serialization_schemaLocation = 3;
$serialization_pivot = 4;
$serialization_absolute = 5;
$bserialization = processGETParameter ($serialization);
$serializationParam = "x".dechex(bindec($bserialization));

Expand All @@ -115,8 +116,6 @@
$rnc_filename = $rnc_filename.'-s'.substr($serializationParam, 1);
$rnc_filename = $rnc_filename.'.rnc';
header('Content-Disposition: attachment; filename="'.basename($rnc_filename).'"');
$schemaLocation='';
$modulesLocation = $schemaLocation . 'modules/';
$start = ' start = Node.choice | edge.choice'."\n";
$end = ' inherit = ruleml {start |= notAllowed}';
$base_url = "http://deliberation.ruleml.org/1.01/relaxng/schema_rnc.php";
Expand Down Expand Up @@ -223,6 +222,7 @@
$needDatatyping = extractBit($bserialization, $serialization_datatyping);
$needSchemaLocation = extractBit($bserialization, $serialization_schemaLocation);
$notPivot = 1-extractBit($bserialization, $serialization_pivot);
$absolute = extractBit($bserialization, $serialization_absolute);

$needURI = extractBit($bpropo, $propo_iri);
$needRulebase = extractBit($bpropo, $propo_rulebase);
Expand Down Expand Up @@ -289,6 +289,13 @@
$needDefaultPresentFO = $needDefaultPresent * $needFO;

//Step 1. Assemble the language foundation
if ($absolute) {
$schemaLocation='http://deliberation.ruleml.org/1.01/relaxng/';
} else {
$schemaLocation='';
}
$modulesLocation = $schemaLocation . 'modules/';

//Step 1A. Assemble the propositional language
// Add the start statement
echo $start;
Expand Down

0 comments on commit 69b7e4e

Please sign in to comment.