[XSD] Schema for unknwn element names with known attribute value

S

smoother

Hello, I'm new to XML Schema. I've already read the Schema tutorial at
w3schools.com but I still have numerous questions:

First, I want to let you know what my XML file looks like:

<root template="rootpage">
<page1 template="journal">
<entry1027 template="entry" title="title for entry no.
1027">...</entry1027>
<entryAlpha template="entry" title="some other
title">...</entryAlpha>
</page1>
<another-page template="a-template">...</another-page>
<another-page-2nd template="a-template">...</another-page-2nd>
...
</root>


As you can see, the file is not strucutred by equal node names (<page
/><page /><page />) but nodes with same structure have the same
attribute "template".
So instead of xs:element, I search for a possiblity to define a schema
for any unspecfific nodes which have a specific attribute value in
common (e.g. 'a-template' or 'entry').

Can somone please give an example?

- Thanks, S.R.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top