namespcae nesting

Discussion in 'XML' started by martin mollema, Feb 25, 2005.

  1. I'm stuck with the following problem:
    I want to develop a namespace that consists of two (later possibly
    more distinct namespaces)
    These subnamespaces are the DC element set and a private extension.
    The naming convention is DC:elementName and OVERHEID:eek:therElementName.
    In order ease the processing of these two element sets,
    I would like to create a new namespace, say METADATA this would lead
    to tagnames like
    METADATA:DC:elementName or METADATA:OVERHEID:eek:therElementName.

    Is this syntax valid for XML element names?
    How do I define the namespace?
    Do I have to use METADATA:DC and METADATA:OVERHEID as two seperate
    namespaces,
    or is it possible to create a namespace METADATA that consists of
    namespace DC and OVERHEID

    Thanks in advance for your help

    Martin Mollema
    martin mollema, Feb 25, 2005
    #1
    1. Advertising

  2. (martin mollema) writes:

    > I'm stuck with the following problem:
    > I want to develop a namespace that consists of two (later possibly
    > more distinct namespaces)


    You can't. XML Namespaces are all the same (apart from their name) and
    consist of the set of names legal for XML elements that don't have a
    colon.

    > These subnamespaces are the DC element set and a private extension.
    > The naming convention is DC:elementName and OVERHEID:eek:therElementName.


    > In order ease the processing of these two element sets,
    > I would like to create a new namespace, say METADATA this would lead
    > to tagnames like
    > METADATA:DC:elementName or METADATA:OVERHEID:eek:therElementName.


    Those names would not be accepted by an XML Namespaces conformant system
    (like Xpath or XSLT) although they are well formed XML 1.0 names.


    > Is this syntax valid for XML element names?

    No.

    > How do I define the namespace?
    > Do I have to use METADATA:DC and METADATA:OVERHEID as two seperate
    > namespaces,


    You could do that.

    > or is it possible to create a namespace METADATA that consists of
    > namespace DC and OVERHEID



    This is technically possible, and trivially easy, you just do it,

    <otherElementName xmlns="http://purl.org/dc/elements/1.1/"/>

    see, I just did:)

    However it may be considered bad form as the intention behind namespaces
    is essentially that the you can tell who "owns" an element definition by
    looking at who owns the namespace

    An alternative if you don't want to burden the user with lots of
    namespaces is to define elements in your own namespace but you define
    them as having the same meaning as dc. This is a common technique
    and is most useful if you have a large compound document format
    that is mainly going to be used by a specifc tool that needs to know all
    all the components. The downside is that the "dc" elements will then
    look like dc elements but as they are in the "wrong" namespace they would
    not be recognised as such by generic dc tools, and your documents would
    have to go through a simple transformation that pulled the dc elements
    out of your namespace and put them in the public dc one.

    We do this in house at nag. We have an internal document format which
    has mainly our own elements, but also uses parts of xhtml, mathml and
    xlink. internally we don't use namespaces at all, but the XSLT that
    generates any public files "knows" that various elements should be
    switched to appropriate publicly defined namrespaces, so builds that in
    to the transform.

    > Thanks in advance for your help
    >
    > Martin Mollema



    David
    David Carlisle, Feb 25, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DeadlyTedly
    Replies:
    2
    Views:
    2,536
    Ted Bradley
    Oct 16, 2003
  2. Edward

    Nesting Datagrids

    Edward, Nov 11, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,333
    Guest
    Nov 11, 2003
  3. John

    Nesting Datagrids

    John, Nov 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    345
  4. Bijoy Naick

    Three Level Repeater Nesting - HELP!!!

    Bijoy Naick, Aug 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,862
    Bijoy Naick
    Aug 10, 2004
  5. Trans
    Replies:
    10
    Views:
    288
    Sean O'Halpin
    Sep 16, 2005
Loading...

Share This Page