xslt - Loading permitted XML attribute values to a RELAX NG grammar file - Stack Overflow

I have a Relax NG grammar file. I would like to load permitted attribute values from an XML file. Would

I have a Relax NG grammar file. I would like to load permitted attribute values from an XML file. Would it be possible to load those values from a normal XML file or do I need to generate a RELAX NG file from this XML file with XSLT first? This would feel wrong to me.

<element name="language">
  <externalRef href="language.rng"/>
</element>

I have a Relax NG grammar file. I would like to load permitted attribute values from an XML file. Would it be possible to load those values from a normal XML file or do I need to generate a RELAX NG file from this XML file with XSLT first? This would feel wrong to me.

<element name="language">
  <externalRef href="language.rng"/>
</element>
Share Improve this question edited Mar 4 at 13:01 Stefan Jung asked Mar 4 at 12:55 Stefan JungStefan Jung 1,28811 silver badges20 bronze badges 1
  • 1 Relax NG can't directly grab the allowed attribute values from just any old XML file, especially one that isn't a Relax NG file itself. In other words, if you have your allowed values stored in a plain XML file, you'll need to preprocess "converting" the data (maybe with something like XSLT) into a Relax NG module. Then you can use <externalRef> to bring that module into your grammar. – Lorenzo Castagno Commented Mar 4 at 13:05
Add a comment  | 

1 Answer 1

Reset to default 0

Instead of transforming your list of acceptable values into RelaxNG form, an alternative possibility is to supplement your RelaxNG schema with a Schematron schema, which is capable of validating attributes against an external list of values. https://schematron/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745042300a4607883.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信