" /> " /> "/>

xsd schema: How to omit namespace prefix in XML instance document

62 views Asked by At

I have this XML schema:

<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:r="urn:rt"
        targetNamespace="urn:rt">

    <element name="RTC">
        <complexType>
            <sequence>
                <element name="Nodes"/>
                <element name="Edges"/>
                ...
            </sequence>
        </complexType>
    </element>
    ...
</schema>

and this XML instance document:

<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="urn:rt rt.xsd"
         xmlns:r="urn:rt">

    <r:RTC>
        <Nodes/>
        <Edges/>
        ...
    </r:RTC>
    ...
</catalog>

I want to generate a XML schema for already existing XML files. These files do not have this r: prefix for the top-most element (i.e. the top-most element is just <RTC>...</RTC>).

Is there a way to be able to omit the r: prefix in the instance document?

0

There are 0 answers