Re: problem with xml schema imports in magiccb/xsd files.

46 views
Skip to first unread message

Fady

unread,
Apr 19, 2013, 2:23:09 AM4/19/13
to legsta...@googlegroups.com
Hello Sri,

I am not sure I understand what you are trying to do. No familiarity with magiccb and don't know what you mean by dto/xsd.

But it seems you are trying to import some xsd using legstar-xsd2cob and that is failing when part of the content is imported from an external xsd?

Can you provide an example?

Fady

srini...@sasktel.com

unread,
May 1, 2013, 10:56:36 AM5/1/13
to legsta...@googlegroups.com
Hi Fady,

Thanks for your response and sorry for not checking the message. I was thinking that I will be getting an email notification when somebody reply's to my post.

Sorry for not able to post my problem properly to understand.

We are using Legstar eclipse plugin to generate xml-transformers, this plugin is working fine when we have all the xml schema elements declared in the xsd file locally. But when we try to import the xsd files as below the Legstar is not working(i.e when you right click on xsd file and select 'Legstar' it should show you a popup window to select the root element and to give package name and to mention the source folder to generate the transformers code).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:cb="http://www.legsem.com/legstar/xml/cobol-binding-1.0.1.xsd"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:tns="http://dto.moi.services.triad.sasktelinternational.com/LineCardInquiryReply"
    elementFormDefault="qualified" jaxb:version="2.0"
    xmlns:tns3="http://dto.moi.services.triad.sasktelinternational.com/common/fibre/fibrepath"
    xmlns:tns4="http://dto.moi.services.triad.sasktelinternational.com/common/fibre/ontinfo"
    targetNamespace="http://dto.moi.services.triad.sasktelinternational.com/LineCardInquiryReply">

<import namespace="http://dto.moi.services.triad.sasktelinternational.com/common/fibre/fibrepath" schemaLocation = "FibrePathType.xsd"></import>
<import namespace="http://dto.moi.services.triad.sasktelinternational.com/common/fibre/ontinfo" schemaLocation = "OntInfoType.xsd"></import>


If we are not able to import the schemas then whenever we got some changes to some xml elements we are forced to change all the xsd files where ever that element is there. This  is a huge work as we have some of the elements declared in lot of places (100s of them actually).

If you have any idea how to over come this problem please let me know, which will be a life saver solution for me.

Thanks in Advance
Sri

Fady Moussallam

unread,
May 1, 2013, 11:27:15 AM5/1/13
to legsta...@googlegroups.com
Hello Sri,

In the example that you are showing, the "http://dto.moi.services.triad.sasktelinternational.com/LineCardInquiryReply" namespace has been annotated with COBOL markup (elements with the cb: prefix).

But how about the other XSD you are importing ("http://dto.moi.services.triad.sasktelinternational.com/common/fibre/fibrepath" and "http://dto.moi.services.triad.sasktelinternational.com/common/fibre/ontinfo"). are they also COBOL annotated?

Thanks

Fady
--
You received this message because you are subscribed to the Google Groups "legstar-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to legstar-user...@googlegroups.com.
To post to this group, send email to legsta...@googlegroups.com.
Visit this group at http://groups.google.com/group/legstar-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

srini...@sasktel.com

unread,
May 1, 2013, 11:27:43 AM5/1/13
to legsta...@googlegroups.com
Hi Fady,

dto and magiccb are the two different structures we were using, dto is the place where we keep all java classes representing all xml schema types and magiccb is the place where we keep the transformer java classes. I thought whoever use the Legstar will be doing the same, so that is the reason I mentioned that way and sorry.

We are using LegStar COBOL Binding Generator V 1.5.1  plugin with eclipse.

Please find the images in the attachment to see how we are using the Legstar to generate Transformer classes and the version we are using.


Thanks again Fady.


Sri


On Friday, April 19, 2013 12:23:09 AM UTC-6, Fady wrote:
Legstar version.png
Transformers Generator window for Legstar.png

Srini Batta

unread,
May 1, 2013, 1:55:40 PM5/1/13
to legsta...@googlegroups.com
Hello Fady,

I have created some sample xsd files like how I am using in my project. I am trying to import "FibrePathTypeTest.xsd" file in "LineCardInquiryReply.xsd" as you see in the attached files. Both files are in same directory and I don't have any validation errors in eclipse.

I also had the "cb:cobolElement" in the imported file. Still I am not able to generate the Transformer classes, I am not getting the popup window that I attached in my previous email.

Please look at the attached files, if you get any thoughts where I am doing the mistake please let me know.

Thanks for your help.

Sri

FibrePathTypeTest.xsd
LineCardInquiryReply.xsd

Fady

unread,
May 3, 2013, 2:08:50 AM5/3/13
to legsta...@googlegroups.com
Ok,

Thanks for taking the time to put together an example. That helps a lot.

I reproduced your issue and from what I can see, the legstar plugin crashes because it is unable to locate FibrePathTypeTest.xsd.

You can see for yourself in the Eclipse workspace under .metadata in the .log file, there is an explicit exception. In my case, the plugin is looking for the file directly under the Eclipse install folder where of course it is not.

So what I did is this: in LineCardInquiryRepl, changed schemaLocation = "FibrePathTypeTest.xsd" to schemaLocation = "file:///C:/Users/Fady/Workspace/eclipse/sandbox/legstar.sri/FibrePathTypeTest.xsd" and that fixed it.

Let me know how it goes.

Srini Batta

unread,
May 3, 2013, 12:07:10 PM5/3/13
to legsta...@googlegroups.com
Hi Fady,

Thank you for taking time to test my sample. Yesterday I also able to figure it out the issue after looking at the eclipse log file. It is working fine If I give absolute path (like c:/......). But I was trying to give relative path thinking that the project structure may change or the OS will change from time to time.


If you have any ideas to over come this issue and how to use the relative path please let me know. Even I tried to install LegStart 1.5.2 version to see how LegStar is behaving in that version, but no luck, that version also behaving in the same way.

Thanks again for your help Fady.

Sri


--
Reply all
Reply to author
Forward
0 new messages