[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
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
?
870 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 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