ieXcept
ieXcept

Reputation: 1127

How to approach XML elements with same names (inside 1 XML doc) without prefixes?

Can I mix html table and data table in one XML without resort to prefixes defined on root?

<root xmlns="kuku"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="kuku test.xsd">

    <table xmlns="http://www.w3.org/1999/xhtml">
        <tr>
            <td>Microsoft</td>
            <td>Apple</td>
        </tr>
    </table>

    <table xmlns="http://www.overstock.com/furniture">
        <name>Drawing board</name>
        <length>600</length>
        <width>250</width>
    </table>
</root>

There should be 2 schemes, one for the 1st table and other for the second, what should I write in the test.xsd, taking into account that there are no other things inside the root except two tables? Maybe I can leave XSD empty.

Upvotes: 0

Views: 28

Answers (1)

C. M. Sperberg-McQueen
C. M. Sperberg-McQueen

Reputation: 25034

It sounds as if your goal is to make the document schema-valid against the schema described by test.xsd, and that you control that document, so it can contain anything you like. If so, then you probably want test.xsd to contain

Upvotes: 1

Related Questions