#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    XML Schema Conversion


    Dear Forum Readers,

    Is that possible to convert any xml schema (xsd) to another xml schema (xsd) to merge different xml writers ? I mean I have two different xml writer (code written in C++) and two different xml schema (xsd). I want to convert first xsd to second one for getting same xml file output from different xml writers. I am good at c++ coding but not efficient at xml.

    Any help would be appreciated.
    Best Regards
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,143
    Rep Power
    9398
    It is very unlikely that the XML writers are looking at the schema to decide how to write the XML. Rather, they are writing whatever they want to write and the schemas are there to document it.

    So no.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0
    Originally Posted by requinix
    It is very unlikely that the XML writers are looking at the schema to decide how to write the XML. Rather, they are writing whatever they want to write and the schemas are there to document it.

    So no.
    Thank you for quick answer. As I know XML is world powerful language because it is self-descriptive. We should able to convert self described xml structure to each other.
    It is possible to convert basic xml files to each other with xslt:

    <xsl: output method="xml" indent="yes"/>
    <xsl:template match="/">
    <tagfromXsd1>
    <xsl:for-each select="TagfromXsd2/XSD2tag1">
    <item type="tagYouwant">
    <xsl:attribute name="att1"><xsl:value-of select="@yourAtt"/></xsl:attribute>

    But it is not sufficient for me. I want to write C++ code to convert xml structure at writer level. It is now clear Xml writers schema indepented.

    Still looking for solutions,
    Best regards

IMN logo majestic logo threadwatch logo seochat tools logo