I started a project on github using maven-jaxb2-plugin to generate VMAP classes from the vmap xsd.
The problem I am running into appears to be an issue with the xsd itself.
[ERROR] Error while parsing schema(s).Location [ file:/projects/generate-vmap-example/src/main/resources/vmap.xsd{144,70}].
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'vast:VAST' to a(n) 'element declaration' component.
Everything seems to be setup correctly. vmap.xsd declares the vast namespace and imports the vast xsd.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vmap="http://www.iab.net/videosuite/vmap" xmlns:vast="http://www.iab.net/videosuite/vast" targetNamespace="http://www.iab.net/videosuite/vmap" attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0">
<xs:import namespace="http://www.iab.net/videosuite/vast" schemaLocation="vast3_draft.xsd"/>
The VAST element is used here.
<xs:complexType name="VASTAdData_type">
<xs:sequence>
<xs:element ref="vast:VAST" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
Should the vmap xsd be modified for this to work? Why can't it find the VAST element?
You can view the full project here.