You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Sharma, Navin" <na...@credit-suisse.com> on 2007/03/30 09:13:03 UTC

Query DOMBuilder and DOMWriter

	Hi,

Have test.xml and test.xsd, where test.xml is not valid against xsd.
Is it possible to generate a valid xml say, testOut.xml, providing invalid test.xml as input.

The testOut.xml should be a valid xml that conforms to test.xsd.

Is this possible using Xerces and C++ or something else.
Any thoughts?

Best Regards
Navin 





==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


RE: Query DOMBuilder and DOMWriter

Posted by Jesse Pelton <js...@PKC.com>.
Short answer: no, Xerces does no such document transformations.  It
parses, it serializes, it provides methods for you to add, delete, and
modify various types of document nodes, but it doesn't automatically
make such modifications (except adding default values where possible
during parsing).

Longer answer: I don't know whether any tool does what you want.  In
fact, I'm not entirely sure what you want, or whether it's possible.  If
a document is schema-invalid, I'm not sure how any processor could know
how to make it valid.  Should it throw out invalid elements and
attributes?  Change their names and/or values?  Insert required elements
and attributes?  Other than providing default values, neither a schema
nor a DTD provides much information that would help with such a
transformation.

You might be able to write a program that applies certain rules in order
to generate a specific type of document, but it's hard to imagine a
general-purpose tool that makes invalid documents into useful valid
documents.

But someone else on the list may have a more fertile imagination, or
wider knowledge, than I.

-----Original Message-----
From: Sharma, Navin [mailto:navin.sharma@credit-suisse.com] 
Sent: Friday, March 30, 2007 3:13 AM
To: c-dev-help@xerces.apache.org; c-dev@xerces.apache.org;
c-dev-info@xerces.apache.org; c-dev-faq@xerces.apache.org
Subject: Query DOMBuilder and DOMWriter

	Hi,

Have test.xml and test.xsd, where test.xml is not valid against xsd.
Is it possible to generate a valid xml say, testOut.xml, providing
invalid test.xml as input.

The testOut.xml should be a valid xml that conforms to test.xsd.

Is this possible using Xerces and C++ or something else.
Any thoughts?

Best Regards
Navin 





========================================================================
======
Please access the attached hyperlink for an important electronic
communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
========================================================================
======


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org