Author |
Message
|
znam |
Posted: Wed Sep 22, 2010 3:22 am Post subject: msg set export to schema |
|
|
Newbie
Joined: 22 Sep 2010 Posts: 3
|
what've done:
exported msg set to schema
what's wire format for msg set and how did I create:
cwf, and created using mb tool kit ( that reminds it's mb 6.1 win xp)
what would like to see:
in the schema that I generated, element length restriction. In the example am using "name" element of length 5 character of type string.
what's happening:
generated schema is not having info apart from the info that it's name and is of string. No info about the length !
when I looked at the .mxsd it's wrapping length info inside xsd:appinfo tag
any help how to solve this ? to get the element length ? |
|
Back to top |
|
 |
kimbert |
Posted: Wed Sep 22, 2010 3:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
So you want the export tool to automatically create xs:length facets from the CWF length fields. I'm afraid that is
a) not supported and
b) would not be a good idea.
An xs:length facet specifies the number of *characters* in an XML string. The CWF length property specifies the length of a field. It is often expressed in units of bytes, not characters. So it would be dangerous to do what you suggest in the exporter. |
|
Back to top |
|
 |
znam |
Posted: Wed Sep 22, 2010 9:18 pm Post subject: |
|
|
Newbie
Joined: 22 Sep 2010 Posts: 3
|
ok .. if look from the other end, as a consumer. Now the consumer, knows it's just a string, and absolutely no info about the length ! which doesnt make sense. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 23, 2010 12:24 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I understand why you want this, and it may be quite useful to you and your business. However, the fact remains that even if the exporter did everything it could possibly do, the result would not be as good as a properly-designed xsd created by a business expert.
The schema export facility is intended to allow you to take your mxsd files ( with all of their MRM-specific annotations ) and generate the equivalent pure xsds from them. What you are asking for is not what the export facility was trying to achieve. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 23, 2010 2:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It seems to be more in the purview of the Importer to populate both the CWF length facets AND the Logical length facets. Presumably if the Logical length facets were populated, then they would be exported.
However there is the previously mentioned difficulty of matching byte lengths to character lengths. |
|
Back to top |
|
 |
znam |
Posted: Mon Oct 04, 2010 2:45 am Post subject: |
|
|
Newbie
Joined: 22 Sep 2010 Posts: 3
|
Here is the another way .. if i import XSD with the length defined and then export it as XSD, it's generating the length. Now does that works ? .. I think MB at the run-time takes the pain of converting char to bytes. Having said that, why cannt it extend the same thing while exporting the msg set ? - does this makes sense ? |
|
Back to top |
|
 |
kimbert |
Posted: Mon Oct 04, 2010 2:59 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
if i import XSD with the length defined and then export it as XSD, it's generating the length. |
Yes. If you import an xsd that contains xs:length facets, then the xs:length facets are included in the resulting mxsd. If you then export that mxsd to create an xsd, the xs:length facets are exported into the xsd. That's not at all suprising, and I don't see why it's relevant to your question.
Quote: |
I think MB at the run-time takes the pain of converting char to bytes. Having said that, why cannt it extend the same thing while exporting the msg set ? |
Because the chars->bytes conversion requires the ccsid which is only available at runtime. The exporter is part of the toolkit, and does not know the ccsid, so it cannot reliably do the chars->bytes conversion.
I stand by what I said before:
Quote: |
What you are asking for is not what the export facility was trying to achieve. |
If you want an xsd which contains facets, the best way to do that is to model your data using a schema authoring tool. |
|
Back to top |
|
 |
|