You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Håvard Nesvold <ha...@more.no> on 2008/07/22 09:51:10 UTC

Inconsistant filenames when saving schema type system

Hi!

Every time i save a SchemaTypeSystem using the .save(Filer..) method, 
for some files i seem to get different filenames even though the files 
are generated from the exact same .xsds (i.e. the SHA-1 digests are 
exactly the same for the types i keep parsing).

For example, the filer is sent the following filename:

schemaorg_apache_xmlbeans/system/s0158A65C33FC82B60A7D752CA5A94FC4/lodginghouseinformationrequesttype1e10type.xsb

And the part between the /system/ and /index.xsb is different each time 
i generate a type system from a xsd, and then save it using this method.
What is the s0158A65C33FC82B60A7D752CA5A94FC4, and is there any way to 
get this value to be the same each time these files are generated from 
the exact same source?

Thanks ,

Håvard Nesvold


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Inconsistant filenames when saving schema type system

Posted by Radu Preotiuc-Pietro <ra...@oracle.com>.
Oh, I see.

I should have gathered from your original post that you are using XmlBeans.compileXsd() and not the 'scomp' script.

Currently, the only way to compute a digest (that's later used in computing the "type system name") is when the XML document is loaded. Once in memory, the digest cannot be computed/updated. So what you are doing is the correct thing to do, I wonder where we could document this so it is clear in the future.

Radu

> -----Original Message-----
> From: Håvard Nesvold [mailto:haavard.nesvold@more.no] 
> Sent: Wednesday, July 23, 2008 12:09 AM
> To: user@xmlbeans.apache.org
> Subject: Re: Inconsistant filenames when saving schema type system
> 
> ...which it was.
> 
> Howver, by setting the option setLoadMessageDigest() on the 
> XmlOptions object passed when parsing the XSD, the "type 
> system name" became the same every time the types system was 
> created so this seemed to fix the problem!
> Could this be a bug or was this as expected?
> 
> Regards,
> Håvard Nesvold
> 
> 
> Radu Preotiuc-Pietro skrev:
> > In theory, the "type system name" (the part betwenn system/ and 
> > /index.xsb as you put it) is supposed to be the same for 
> the same set 
> > of input files. But you must be sure that it is really the same set 
> > and the same content of all the files, without modification.
> >
> > Radu
> >
> > On Tue, 2008-07-22 at 00:51 -0700, "Håvard Nesvold" wrote:
> >
> >> Hi!
> >>
> >> Every time i save a SchemaTypeSystem using the 
> .save(Filer..) method, 
> >> for some files i seem to get different filenames even though the 
> >> files are generated from the exact same .xsds (i.e. the 
> SHA-1 digests 
> >> are exactly the same for the types i keep parsing).
> >>
> >> For example, the filer is sent the following filename:
> >>
> >> 
> schemaorg_apache_xmlbeans/system/s0158A65C33FC82B60A7D752CA5A94FC4/lo
> >> dginghouseinformationrequesttype1e10type.xsb
> >>
> >> And the part between the /system/ and /index.xsb is different each 
> >> time i generate a type system from a xsd, and then save it 
> using this method.
> >> What is the s0158A65C33FC82B60A7D752CA5A94FC4, and is 
> there any way 
> >> to get this value to be the same each time these files are 
> generated 
> >> from the exact same source?
> >>
> >> Thanks ,
> >>
> >> Håvard Nesvold
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> >> For additional commands, e-mail: user-help@xmlbeans.apache.org
> >>
> >>
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> > For additional commands, e-mail: user-help@xmlbeans.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Inconsistant filenames when saving schema type system

Posted by Håvard Nesvold <ha...@more.no>.
...which it was.

Howver, by setting the option setLoadMessageDigest() on the XmlOptions 
object passed when parsing the XSD, the
"type system name" became the same every time the types system was 
created so this seemed to fix the problem!
Could this be a bug or was this as expected?

Regards,
Håvard Nesvold


Radu Preotiuc-Pietro skrev:
> In theory, the "type system name" (the part betwenn system/
> and /index.xsb as you put it) is supposed to be the same for the same
> set of input files. But you must be sure that it is really the same set
> and the same content of all the files, without modification.
>
> Radu
>
> On Tue, 2008-07-22 at 00:51 -0700, "Håvard Nesvold" wrote:
>   
>> Hi!
>>
>> Every time i save a SchemaTypeSystem using the .save(Filer..) method,
>> for some files i seem to get different filenames even though the files
>> are generated from the exact same .xsds (i.e. the SHA-1 digests are
>> exactly the same for the types i keep parsing).
>>
>> For example, the filer is sent the following filename:
>>
>> schemaorg_apache_xmlbeans/system/s0158A65C33FC82B60A7D752CA5A94FC4/lodginghouseinformationrequesttype1e10type.xsb
>>
>> And the part between the /system/ and /index.xsb is different each time
>> i generate a type system from a xsd, and then save it using this method.
>> What is the s0158A65C33FC82B60A7D752CA5A94FC4, and is there any way to
>> get this value to be the same each time these files are generated from
>> the exact same source?
>>
>> Thanks ,
>>
>> Håvard Nesvold
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Inconsistant filenames when saving schema type system

Posted by Radu Preotiuc-Pietro <ra...@oracle.com>.
In theory, the "type system name" (the part betwenn system/
and /index.xsb as you put it) is supposed to be the same for the same
set of input files. But you must be sure that it is really the same set
and the same content of all the files, without modification.

Radu

On Tue, 2008-07-22 at 00:51 -0700, "Håvard Nesvold" wrote:
> Hi!
> 
> Every time i save a SchemaTypeSystem using the .save(Filer..) method,
> for some files i seem to get different filenames even though the files
> are generated from the exact same .xsds (i.e. the SHA-1 digests are
> exactly the same for the types i keep parsing).
> 
> For example, the filer is sent the following filename:
> 
> schemaorg_apache_xmlbeans/system/s0158A65C33FC82B60A7D752CA5A94FC4/lodginghouseinformationrequesttype1e10type.xsb
> 
> And the part between the /system/ and /index.xsb is different each time
> i generate a type system from a xsd, and then save it using this method.
> What is the s0158A65C33FC82B60A7D752CA5A94FC4, and is there any way to
> get this value to be the same each time these files are generated from
> the exact same source?
> 
> Thanks ,
> 
> Håvard Nesvold
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org