[relaxng-user] Trang bug; workaround?

Bruce D'Arcus bdarcus at fastmail.fm
Thu Jan 6 13:04:12 ICT 2005


I've stumbled on a bug in Trang.

This schema (taken a from a larger one), will correctly convert to RNG  
XML.

default namespace = "http://www.loc.gov/mods/v3"
namespace mods = "http://www.loc.gov/mods/v3"
namespace xlink = "http://www.w3.org/1999/xlink"

start = Mods
Mods = element mods { anyType }

## allow any content in the extension element
div {
   anyType =
     mixed {
       (attribute * { text }
        | extensionSchema)*
     },
     empty
   extensionSchema =
     element * {
       mixed {
         (extensionSchema
          | attribute * { text })*
       }
     }
}

However, converting to XSD yields this:

# java -jar /opt/jing/bin/trang.jar mods.rng mods.xsd
Exception in thread "main" java.lang.NullPointerException
         at  
com.thaiopensource.relaxng.output.xsd.Transformer.getTransformedAttribut 
eGroup(Unknown Source)
         at  
com.thaiopensource.relaxng.output.xsd.Transformer.visitAttributeGroup(Un 
known Source)
         at  
com.thaiopensource.relaxng.output.xsd.basic.AttributeGroupDefinition.acc 
ept(Unknown Source)
         at  
com.thaiopensource.relaxng.output.xsd.basic.Schema.accept(Unknown  
Source)
         at  
com.thaiopensource.relaxng.output.xsd.basic.SchemaTransformer.transform( 
Unknown Source)
         at  
com.thaiopensource.relaxng.output.xsd.XsdOutputFormat.output(Unknown  
Source)
         at com.thaiopensource.relaxng.translate.Driver.doMain(Unknown  
Source)
         at com.thaiopensource.relaxng.translate.Driver.main(Unknown  
Source)

Hopefully James gets around to fixing this, but in the meantime, does  
anyone have any suggested workarounds?

Bruce



More information about the relaxng-user mailing list