Loading...

jibx-users@lists.sourceforge.net

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [jibx-users] Skip code generation for included XML Schema Don Corley Fri Feb 03 09:21:36 2012

Klaus,

Actually, JiBX handles included schema very easily.

Just run JiBX on the included schema and package it as a separate project.
Then, run JiBX on your main schema using the <includeBaseBindings> tag as
explained in the maven instructions here:
http://jibx.sourceforge.net/maven-jibx-plugin/modular-codegen.html .

There is a nice example in our source repository at
https://github.com/jibx/maven-plugin/tree/master/test-suite/base-binding-test
 .

Hope this helps!

Don

------------------------------
>
> Message: 5
> Date: Tue, 24 Jan 2012 11:52:37 +0100 (CET)
> From: [EMAIL PROTECTED]
> Subject: [jibx-users] Skip code generation for included XML Schema
> To: "JiBX users list" <[EMAIL PROTECTED]>
> Message-ID:
>        <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="UTF-8"
>
> Dear all,
>
> This is a question about code generation.
> I wonder if it is possible to skip the generation of Java code for schema
> files which are included by others.
>
> Example:
>
> ** Schema foo.xsd
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> ?? ?xmlns:tns="http://foo.bar"
> ?? ?targetNamespace="http://foo.bar" version="1.0">
>
> ?? ?<xs:include schemaLocation="bar.xsd" />
> .......
>
> I would like to skip the code generation of the types declared in bar.xsd
> as I already generated them in a separate artefact (which is on the
> classpath).
>
> I first tried to exclude the schema in the jibx-maven-plugin section of my
> pom.xml
>
> ?? ?<excludeSchemas>
> ?? ??? ?<exludeSchema>bar.xsd</exludeSchema>
> ?? ?</excludeSchemas>
> ?? ?
> but this does not exlude the schema (I think because it is included by
> another one).
>
> Then I tried to explicitly exlude the generation of the types declared in
> bar.xsd in a custom schema configuration with:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <schema-set xmlns:xs="http://foo.bar">
> ?? ?<schema name="bar.xsd" excludes="myType" />
> </schema-set>
>
> This prevents the generation of "myType" but also skips generating all
> occurences (usage) of this type in foo.xsd (e.g. as elements for declared
> types in foo.xsd).
>
> So my question: Is it possible to skip the generation of Java source code
> for special schema files (or even types) which are included by other
> schemas - without also skipping all usage occurences of these types?
>
> Thanks for any help
> ? Klaus
>
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users