?
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
Medium Priority
?
786 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 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 2000 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 2000 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

765 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