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
357 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

11 Experts available now in Live!

Get 1:1 Help Now