Solved

Convert DTD to XSD, Consolidate Multiple XSD into one SINGLE XSD and Generate XML instance also generate SINGLE Valid XSD.

Posted on 2015-01-21
5
425 Views
Last Modified: 2016-06-13
Title : Convert DTD to XSD, Consolidate Multiple XSD into one SINGLE XSD and Generate XML instance also to generate SINGLE Valid XSD.

Subject:
I have following task : I've a DTD file which is converted into XSD using XML Spy. However XML Spy tool split the DTD into 3 separate XSD file, then this 3 XSD need to be combined and consolidate in to one single XSD.
XSD schema should be valid XSD to exchange message from partner system.

http://xml.cxml.org/schemas/cXML/1.2.011/InvoiceDetail.dtd

When you use XML and pass this DTD it generate  3 XSD file.
  As Input: XMLSpy > InvoiceDetail.dtd
  As Output: InvoiceDetail.dtd > InvoiceDetail.XSD, InvoiceDetail2.XSD, InvoiceDetai3.XSD

Expected Output: SingleInvoiceDetail.XSD  ( InvoiceDetail.XSD + InvoiceDetail2.XSD + InvoiceDetai3.XSD )
Exepected Single Generated XML
Exepected Single Generated Validated XSD


Regards,
Anss
0
Comment
Question by:Anss
  • 3
5 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 40562420
Hi Anns,

This question can not be answered without actually seeing the XSDs

DTDs are unaware of namespaces (the DTD specification predates the namespace specification)
BUT you can add the namespace prefix as an attribute declaration to DTDs and fix the prefix
This technique is used a lot, not really offering namespace support but emulating upto a certain extent
As such DTDs providing (emulated) namespace support don't care at all how many files are used to put the DTD in

XSD do have support for namespaces
BUT each target namespace requires a different file
That implies that there is NO pssible way that you can compile an XSD with multiple namespaces in one file
There are also differences between the available include or import mechanisms that control inheritance

If XML Spy generated multiple XSD files from one DTD, there most likely is a very good reason for that
I suspect there is very little chance that it is possible to compile that into one file
But in order to be sure you need to show me the DTD
0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 500 total points
ID: 40562449
hehe, I missed the link, sorry

In the DTD I find this

<!ATTLIST ds:Signature  
      xmlns:ds      CDATA      #FIXED 'http://www.w3.org/2000/09/xmldsig#'

which is a namespace declaration
each element name that starts with ds: belongs to that namespace
each element name that does not  start with ds: belongs to a different namespace (or no namespace at all)

From a very quick look at the DTD I can assure you it is NOT possible to compile an equivalent XSD in one file
0
 

Author Comment

by:Anss
ID: 40562798
Hi Geert Bormans,

You have correct observation,  Please can you guide any solution to consolidate it, As my end goal is to convert this Invoice CXML  DTD into SINGLE consolidated XSD to use as BizTalk Schema  for further transformation and messaging with ARIBA network.

-Cheers
0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 500 total points
ID: 40563049
I am not sure you understood what I wrote
you CAN NOT consolidate the schema in one file, full stop
There is however no reason why you need consolidations
BizzTalk can handle muktiple imported schemata.
You just need to make sure the references are relative to one another
or completely absolute on a server you maintain

If you need to have one schema only, you will have to transform teh XML first in a namespace less form
but that would mean you are altering the data
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now