How do I add my own namespace to another and create an XSD ?

A

Andreas M.

Hello,

for a personal project I need to extend the ATOM specification by adding
my own namespaced stuff. It must validate! Therefore I need to create an
XSD.

I came upon several problems:

I can define my own stuff in a seperate XSD as long as it does not
extend already existing stuff of the Atom spec. What I want to do now is
to also add attributes to already existing Atom tags. Also, some of my
stand-alone tags are only allowed as sub-elements within certain Atom
containers (like <entry>).

How would I do this ?
 
J

Joe Kesselman

Andreas said:
I can define my own stuff in a seperate XSD as long as it does not
extend already existing stuff of the Atom spec. What I want to do now is
to also add attributes to already existing Atom tags.

In that case, you're going to have to modify the Atom schema to allow
those attributes if it doesn't already permit that sort of annotation.

Of course this means the element is no longer Atom, but a new language
derived from Atom.
> Also, some of my
stand-alone tags are only allowed as sub-elements within certain Atom
containers (like <entry>).

Again, that's a question of whether Atom has specified that it accepts
non-Atom content at those locations. See above.

Question: Would it make more sense to embed fragments of Atom markup
inside your new document type rather than trying to retrofit Atom to
accept your markup? This would require that the Atom subtrees be valid
Atom markup, but it would let you put additional data alongside/around
that, which might accomplish much of what you need.
 
A

Andreas M.

Hi Joe,

thanks a lot for your answer.

On 29.07.2007 18:05 you wrote
In that case, you're going to have to modify the Atom schema to allow
those attributes if it doesn't already permit that sort of annotation.

Per
http://www.atompub.org/2005/08/17/draft-ietf-atompub-format-11.html#extending_atom

----snip---

6.1 Extensions From Non-Atom Vocabularies

This specification describes Atom's XML markup vocabulary. Markup from
other vocabularies ("foreign markup") can be used in an Atom Document. [...]

6.2 Extensions To the Atom Vocabulary

The Atom namespace is reserved for future forwards-compatible revisions
of Atom. Future versions of this specification could add new elements
and attributes to the Atom markup vocabulary. Software written to
conform to this version of the specification will not be able to process
such markup correctly and, in fact, will not be able to distinguish it
from markup error. For the purposes of this discussion, unrecognized
markup from the Atom vocabulary will be considered "foreign markup".

6.3 Processing Foreign Markup

Atom Processors which encounter foreign markup in a location that is
legal according to this specification MUST NOT stop processing or signal
an error. It might be the case that the Atom Processor is able to
process the foreign markup correctly and does so. Otherwise, such markup
is termed "unknown foreign markup".

---snip---

and

---snip---

6.4 Extension Elements

Atom allows foreign markup anywhere in an Atom document, except where it
is explicitly forbidden. Child elements of atom:entry, atom:feed,
atom:source, and Person constructs are considered Metadata elements, and
are described below. Child elements of Person constructs are considered
to apply to the construct. The role of other foreign markup is undefined
by this specification.

---snip---
Of course this means the element is no longer Atom, but a new language
derived from Atom.

That may pose a problem, see below.
Question: Would it make more sense to embed fragments of Atom markup
inside your new document type rather than trying to retrofit Atom to
accept your markup? This would require that the Atom subtrees be valid
Atom markup, but it would let you put additional data alongside/around
that, which might accomplish much of what you need.

First I had designed my own markup. Then I recognized, that I would want
every Feedreader to be able to parse my markup, so I'd distribute it as
an Atom feed. However, since I do have some custom information, I need
to add it to the Newsfeed. In order to make my new Atom variant show up,
the authors of Feedreader software may not need to do more, than
inculding my schema and make use of it.

Now, what I have problems to understnad is:

---snip---

6.4.1 Simple Extension Elements

A Simple Extension element MUST NOT have any attributes or child
elements. The element MAY contain character data, or be empty. Simple
Extension elements are not Language-Sensitive.

simpleExtensionElement =
element * - atom:* {
text
}

The element can be interpreted as a simple property (or name/value pair)
of the parent element that encloses it. The pair consisting of the
namespace-URI of the element and the local name of the element can be
interpreted as the name of the property. The character data content of
the element can be interpreted as the value of the property. If the
element is empty, then the property value can be interpreted as an empty
string.
6.4.2 Structured Extension Elements

The root element of a Structured Extension element MUST have at least
one attribute or child element. It MAY have attributes, it MAY contain
well-formed XML content (including character data), or it MAY be empty.
Structured Extension elements are Language-Sensitive.

structuredExtensionElement =
element * - atom:* {
(attribute * { text }+,
(text|anyElement)*)
| (attribute * { text }*,
(text?, anyElement+, (text|anyElement)*))
}

The structure of a Structured Extension element, including the order of
its child elements, could be significant.

This specification does not provide an interpretation of a Structured
Extension element. The syntax of the XML contained in the element, and
an interpretation of how the element relates to its containing element
is defined by the specification of the Atom extension.

---snip---

Where do I apply these ? And how ?
 
I

ibrahimover

Hello

I also want to add some new elements with my xsd, have some xsd
knowladge but dont know how to extend t and m new to atom
is there any tutorial wh ch shows how to extend our new elements

"Where do I apply these ? And how ?"

Thank you


Hi Joe,

thanks a lot for your answer.

On 29.07.2007 18:05 you wrote
In that case, you're going to have to modify the Atom schema to allow
those attributes if it doesn't already permit that sort of annotation.

Perhttp://www.atompub.org/2005/08/17/draft-ietf-atompub-format-11.html#e...

----snip---

6.1 Extensions From Non-Atom Vocabularies

This specification describes Atom's XML markup vocabulary. Markup from
other vocabularies ("foreign markup") can be used in an Atom Document. [...]

6.2 Extensions To the Atom Vocabulary

The Atom namespace is reserved for future forwards-compatible revisions
of Atom. Future versions of this specification could add new elements
and attributes to the Atom markup vocabulary. Software written to
conform to this version of the specification will not be able to process
such markup correctly and, in fact, will not be able to distinguish it
from markup error. For the purposes of this discussion, unrecognized
markup from the Atom vocabulary will be considered "foreign markup".

6.3 Processing Foreign Markup

Atom Processors which encounter foreign markup in a location that is
legal according to this specification MUST NOT stop processing or signal
an error. It might be the case that the Atom Processor is able to
process the foreign markup correctly and does so. Otherwise, such markup
is termed "unknown foreign markup".

---snip---

and

---snip---

6.4 Extension Elements

Atom allows foreign markup anywhere in an Atom document, except where it
is explicitly forbidden. Child elements of atom:entry, atom:feed,
atom:source, and Person constructs are considered Metadata elements, and
are described below. Child elements of Person constructs are considered
to apply to the construct. The role of other foreign markup is undefined
by this specification.

---snip---
Of course this means the element is no longer Atom, but a new language
derived from Atom.

That may pose a problem, see below.
Question: Would it make more sense to embed fragments of Atom markup
inside your new document type rather than trying to retrofit Atom to
accept your markup? This would require that the Atom subtrees be valid
Atom markup, but it would let you put additional data alongside/around
that, which might accomplish much of what you need.

First I had designed my own markup. Then I recognized, that I would want
every Feedreader to be able to parse my markup, so I'd distribute it as
an Atom feed. However, since I do have some custom information, I need
to add it to the Newsfeed. In order to make my new Atom variant show up,
the authors of Feedreader software may not need to do more, than
inculding my schema and make use of it.

Now, what I have problems to understnad is:

---snip---

6.4.1 Simple Extension Elements

A Simple Extension element MUST NOT have any attributes or child
elements. The element MAY contain character data, or be empty. Simple
Extension elements are not Language-Sensitive.

simpleExtensionElement=
element * - atom:* {
text
}

The element can be interpreted as a simple property (or name/value pair)
of the parent element that encloses it. The pair consisting of the
namespace-URI of the element and the local name of the element can be
interpreted as the name of the property. The character data content of
the element can be interpreted as the value of the property. If the
element is empty, then the property value can be interpreted as an empty
string.
6.4.2 Structured Extension Elements

The root element of a Structured Extension element MUST have at least
one attribute or child element. It MAY have attributes, it MAY contain
well-formed XML content (including character data), or it MAY be empty.
Structured Extension elements are Language-Sensitive.

structuredExtensionElement =
element * - atom:* {
(attribute * { text }+,
(text|anyElement)*)
| (attribute * { text }*,
(text?, anyElement+, (text|anyElement)*))
}

The structure of a Structured Extension element, including the order of
its child elements, could be significant.

This specification does not provide an interpretation of a Structured
Extension element. The syntax of the XML contained in the element, and
an interpretation of how the element relates to its containing element
is defined by the specification of the Atom extension.

---snip---

Where do I apply these ? And how ?
 

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

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top