[oXygen-user] XInclude and Relax NG
Tara Athan
taraathan at gmail.com
Thu May 22 10:25:37 CDT 2014
Dear George,
Here is a small version.
There is an instance document that has the xi:include element.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="../../xcl2_short.rnc"
type="application/relax-ng-compact-syntax"?>
<Construct xmlns="http://example.org"
xmlns:xi="http://www.w3.org/2003/XInclude">
<xi:include href="includes/1.xml" parse="xml"/>
<Atom><Name>Q</Name><Name>b</Name></Atom>
</Construct>
and here is the includes/1.xml file to be included (showing an error)
<?xml version="1.0" encoding="UTF-8"?>
<Construct xmlns="http://examples.org">
<Atom><Name>P</Name><Name>a</Name></Atom>
</Construct>
Here is a short version of the schema xcl2_short.rnc
default namespace = "http://example.org"
namespace xi = "http://www.w3.org/2003/XInclude"
start = clText
## Texts
clText = Construct | Import
## -Text Constructions
Construct = element Construct { Construct.type }
Construct.type = (clText|clSentence)*
## -Imports
Import = element Import { Import.type }
Import.type = Name
## Sentences
clSentence = Atom
## -Atomic Formulas
Atom = element Atom { Atom.type }
Atom.type = clTerm, clTermSequence
## Term Sequences
clTermSequence = (clTerm)*
## Terms
clTerm = Name
## -Names
Name = element Name { Name.type }
Name.type = text
# XInclude
Import |=
element xi:include {
attribute href { xsd:anyURI }
}
I have tried it with and without the pattern for the xi:include element
in the schema.
If the xi:include pattern is in the RNC schema, then the instance
validates, and does not pick up errors in the included file.
If the xi:include pattern is not in the RNC schema, then the instance
does not validate, even when the included file does not have an error.
Thanks, Tara
On 5/5/14 4:18 PM, George Cristian Bina wrote:
> Dear Tara,
>
> It is not very clear if you try to use XInclude in a Relax NG schema
> or in an instance document that uses a Relax N G schema that allows
> xi:include elements. Can you please provide a small cut down sample,
> that will help a lot.
>
> Best Regards,
> George
> --
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
> On 5/5/14, 10:30 PM, Tara Athan wrote:
>> I am using Version 14.2.
>>
>> I have a Relax NG schema that allows xi:include elements.
>> But the validator does not appear to process the xi:include element
>> prior to validation, as it does not pick up errors arising from the
>> included file.
>>
>> I have checked Enable XInclude processing in the XML Parser settings.
>>
>> Is there anything else to do, or is this just not available (in my
>> version)?
>>
>> Thanks, Tara
>> _______________________________________________
>> 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