qiuwei / jing-trang

Automatically exported from code.google.com/p/jing-trang
Other
1 stars 1 forks source link

Different behavior when converting from RNG to DTD compared with the previous version of Trang #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
While working on integrating the new Jing into oXygen one of the test cases
we have for Trang conversions failed. The problem is described below.

With the previous version of Trang I get:

>type testChoice.rng

<?xml version="1.0" encoding="UTF-8"?>
<grammar
  xmlns="http://relaxng.org/ns/structure/1.0"
  xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
    <start>
      <element name="root">
        <choice>
          <text/>
          <element name="x"><text/></element>
        </choice>
      </element>
    </start>
</grammar>

>java -jar trang.jar -I rng -O dtd testChoice.rng testChoice.dtd
...\testChoice.rng:7:28: warning: approximating mixed choice by repeated
mixed choice

>type testChoice.dtd
<?xml encoding="UTF-8"?>

<!ELEMENT root (#PCDATA|x)*>

<!ELEMENT x (#PCDATA)>

Now with the current development snapshot from Subversion I get

>java -jar trang.jar -I rng -O dtd testChoice.rng testChoice.dtd
...\testChoice.rng:8:17: error: sorry, cannot handle this kind of "choice"

and no DTD output.

Surrounding the choice with zeroOrMore makes the old Trang work without any
warning while the current code gives the same error.

Original issue reported on code.google.com by georgebina76 on 29 Dec 2008 at 3:30

GoogleCodeExporter commented 8 years ago
Fixed in r2314.

Original comment by jjc.jclark.com on 6 Jan 2009 at 6:11

GoogleCodeExporter commented 8 years ago
Thanks James!
Run into another problem on a large TEI-flavour schema:

Exception in thread "main" java.util.ConcurrentModificationException
        at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:449)
        at java.util.AbstractList$Itr.next(AbstractList.java:420)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.outputRequiredComponents(DtdOutp
ut.java:906)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.outputParamEntity(DtdOutput.java
:1021)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.outputRequiredComponents(DtdOutp
ut.java:913)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.outputParamEntity(DtdOutput.java
:1021)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.outputRequiredComponents(DtdOutp
ut.java:913)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.outputParamEntity(DtdOutput.java
:1021)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.outputRequiredComponents(DtdOutp
ut.java:913)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.outputParamEntity(DtdOutput.java
:1021)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput$GrammarOutput.visitDefine(DtdOut
put.java:787)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput$GrammarOutput.visitDefine(DtdOut
put.java:760)
        at
com.thaiopensource.relaxng.edit.DefineComponent.accept(DefineComponent.java:39)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput$GrammarOutput.visitContainer(Dtd
Output.java:764)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutput.topLevelOutput(DtdOutput.java:82
7)
        at com.thaiopensource.relaxng.output.dtd.DtdOutput.output(DtdOutput.java:808)
        at
com.thaiopensource.relaxng.output.dtd.DtdOutputFormat.output(DtdOutputFormat.jav
a:24)
        at com.thaiopensource.relaxng.translate.Driver.doMain(Driver.java:160)
        at com.thaiopensource.relaxng.translate.Driver.main(Driver.java:44)

I will commit a fix for that in a few minutes.

Original comment by georgebina76 on 8 Jan 2009 at 3:42

GoogleCodeExporter commented 8 years ago
Fixed the second problem in r2315.

Original comment by georgebina76 on 8 Jan 2009 at 4:19