OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Could you take a look at my XMLSchema and/or XMLSpy problem please!!!

[ Lists Home | Date Index | Thread Index ]

Hi, i'm a new user of this list!

I have some problem with my schema.  It make two days that i'm searching for
the problem.
I would like to know if this schema is well written. Could you please tell 
me ?

This is the schema i am talking about  (bidon17.xsd).   It's a  simple
schema witth the root element ROOT and a sub-element LOM wich is defined in
an external schema from the LOM spec.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.bidon.org/blahblah";
xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified"
<xs:import namespace="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1";
<xs:element name="ROOT">
   <xs:documentation>Comment describing your root element</xs:documentation>
    <xs:element name="lom" type="lom:lomType"/>

I wanna know if my schema is good because after that, i got the following
problem  :
When i use the Generate Java Code command from XMLSpy i get some code.  Then
i use the java code to generate a simple
file.  This is my code. It create the sample document, and save it.

        bidon17Doc doc = new bidon17Doc();

        // LOM - GENERAL - TITLE
        langstringType titleStr = new langstringType();
        titleStr.setValue(new SchemaString("title"));
        titleType title = new titleType();

        // LOM - GENERAL
        generalType general = new generalType();

        // LOM
        lomType lomElmt = new lomType();

        ROOTType root = new ROOTType();

        doc.setRootElementName(sDefaultSchemaPath, "connaissances");
        doc.save(sDefaultPath, root);
This is the output file i got (output.xml) by running the above code :

<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns="http://www.bidon.org/blahblah";
xsi:schemaLocation="D:\CONTENU\bidon17.xsd D:\CONTENU\bidon17.xsd">
    <lom:langstring lom:lang="fr">title</lom:langstring>

The problem with this output file is that  lom:lang SHOULD HAVE BEEN
xml:lang instead!
This make that the output file is not valid!
Have you an idea, from where the problem may come ?  Is it an error in my
schema ?  In my java code?
If you could take a look at my schema, or if you have XMLSpy and could try
my code, i would really appreciate, thanks.

              Thanks you,


MSN Search, le moteur de recherche qui pense comme vous !  


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS