xml duplicated field name

Discussion in 'XML' started by sweetpotatop@yahoo.com, Jun 12, 2008.

  1. Guest

    Hi,

    I am wondering if it alright to have duplicate attribute name in an
    xml file. As you can see below, there is an attribute called
    <FieldNote>, then another one at the bottom. Besides, you can see the
    2nd FieldNote attribute doesn't have an open tag, does this file looks
    right at all?


    <AuditType>2</AuditType>

    <FieldNote>0</FieldNote>

    <Date>2/1/2008</Date>
    <EventID>149406</EventID>
    <EventType>2</EventType>
    <FieldName>Approval</FieldName>

    <FieldNote />

    Thanks in advance. Your advice would be greatly appreciated.
    , Jun 12, 2008
    #1
    1. Advertising

  2. wrote:
    > Hi,
    >
    > I am wondering if it alright to have duplicate attribute name in an
    > xml file. As you can see below, there is an attribute called
    > <FieldNote>, then another one at the bottom. Besides, you can see the
    > 2nd FieldNote attribute doesn't have an open tag, does this file looks
    > right at all?
    >
    >
    > <AuditType>2</AuditType>
    >
    > <FieldNote>0</FieldNote>
    >
    > <Date>2/1/2008</Date>
    > <EventID>149406</EventID>
    > <EventType>2</EventType>
    > <FieldName>Approval</FieldName>
    >
    > <FieldNote />


    You have two _elements_ of the name FieldNote. That is allowed. You
    can't have two _attributes_ of the same name on the same element however
    e.g.
    <foo FieldNote="bar" FieldNote="baz"/>
    is not allowed.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 12, 2008
    #2
    1. Advertising

  3. Guest

    On Jun 12, 10:37 am, Martin Honnen <> wrote:
    > wrote:
    > > Hi,

    >
    > > I am wondering if it alright to have duplicate attribute name in an
    > > xml file. As you can see below, there is an attribute called
    > > <FieldNote>, then another one at the bottom. Besides, you can see the
    > > 2nd FieldNote attribute doesn't have an open tag, does this file looks
    > > right at all?

    >
    > >   <AuditType>2</AuditType>

    >
    > >   <FieldNote>0</FieldNote>

    >
    > >   <Date>2/1/2008</Date>
    > >   <EventID>149406</EventID>
    > >   <EventType>2</EventType>
    > >   <FieldName>Approval</FieldName>

    >
    > >   <FieldNote />

    >
    > You have two _elements_ of the name FieldNote. That is allowed. You
    > can't have two _attributes_ of the same name on the same element however
    > e.g.
    >    <foo FieldNote="bar" FieldNote="baz"/>
    > is not allowed.
    >
    > --
    >
    >         Martin Honnen
    >        http://JavaScript.FAQTs.com/- Hide quoted text -
    >
    > - Show quoted text -


    Thanks, how about the 2nd elements without the open tag? i.e. with
    just <FieldNote />, but not <FieldNote><FieldNote />

    Thanks
    , Jun 12, 2008
    #3
  4. Joseph J. Kesselman, Jun 12, 2008
    #4
  5. wrote:

    > Thanks, how about the 2nd elements without the open tag? i.e. with
    > just <FieldNote />, but not <FieldNote><FieldNote />


    Sorry, I don't understand what you are asking now.
    <FieldNote><FieldNote />
    does not make sense, you either need
    <FieldNote></FieldNote>
    or
    <FieldNote><FieldNote /></FieldNote>
    where the first is an empty FieldNote element and the second is a
    FieldNote element that has one child node, a second FieldNote element.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 12, 2008
    #5
  6. Guest

    On Jun 12, 10:58 am, Martin Honnen <> wrote:
    > wrote:
    > > Thanks, how about the 2nd elements without the open tag? i.e. with
    > > just <FieldNote />, but not <FieldNote><FieldNote />

    >
    > Sorry, I don't understand what you are asking now.
    >    <FieldNote><FieldNote />
    > does not make sense, you either need
    >    <FieldNote></FieldNote>
    > or
    >    <FieldNote><FieldNote /></FieldNote>
    > where the first is an empty FieldNote element and the second is a
    > FieldNote element that has one child node, a second FieldNote element.
    >
    > --
    >
    >         Martin Honnen
    >        http://JavaScript.FAQTs.com/


    Alright, by looking at

    <FieldNote>0</FieldNote>
    <Date>2/1/2008</Date>
    <EventID>149406</EventID>
    <EventType>2</EventType>
    <FieldName>Approval</FieldName>
    <FieldNote />
    <NewValue>1</NewValue>

    The first FieldNote has a value of "0"
    How about the 2nd one? what does <FieldNote /> mean?

    Thanks in advance.
    , Jun 12, 2008
    #6
  7. wrote:

    > <FieldNote>0</FieldNote>
    > <Date>2/1/2008</Date>
    > <EventID>149406</EventID>
    > <EventType>2</EventType>
    > <FieldName>Approval</FieldName>
    > <FieldNote />
    > <NewValue>1</NewValue>
    >
    > The first FieldNote has a value of "0"
    > How about the 2nd one? what does <FieldNote /> mean?


    <FieldNote /> is a short form of <FieldNote></FieldNote>, it is an empty
    FieldNode element.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 12, 2008
    #7
  8. Peter Flynn Guest

    wrote:
    > On Jun 12, 10:58 am, Martin Honnen <> wrote:
    >> wrote:
    >>> Thanks, how about the 2nd elements without the open tag? i.e. with
    >>> just <FieldNote />, but not <FieldNote><FieldNote />

    >> Sorry, I don't understand what you are asking now.
    >> <FieldNote><FieldNote />
    >> does not make sense, you either need
    >> <FieldNote></FieldNote>
    >> or
    >> <FieldNote><FieldNote /></FieldNote>
    >> where the first is an empty FieldNote element and the second is a
    >> FieldNote element that has one child node, a second FieldNote element.
    >>
    >> --
    >>
    >> Martin Honnen
    >> http://JavaScript.FAQTs.com/

    >
    > Alright, by looking at
    >
    > <FieldNote>0</FieldNote>
    > <Date>2/1/2008</Date>
    > <EventID>149406</EventID>
    > <EventType>2</EventType>
    > <FieldName>Approval</FieldName>
    > <FieldNote />
    > <NewValue>1</NewValue>
    >
    > The first FieldNote has a value of "0"
    > How about the 2nd one? what does <FieldNote /> mean?


    In terms of markup, it means the element is present but it has no value.

    What it means in terms of your business process is a question only you
    can answer.

    ///Peter
    --
    XML FAQ: http://xml.silmaril.ie/
    Peter Flynn, Jun 12, 2008
    #8
    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. Charles Packer

    Representing duplicated data in XML

    Charles Packer, Aug 28, 2008, in forum: XML
    Replies:
    5
    Views:
    406
    Peter Flynn
    Sep 6, 2008
  2. John Davis
    Replies:
    2
    Views:
    384
    Dave Anderson
    Aug 18, 2003
  3. Replies:
    4
    Views:
    107
  4. Pavils Jurjans
    Replies:
    3
    Views:
    181
    Pavils Jurjans
    Mar 18, 2005
  5. Sound
    Replies:
    2
    Views:
    439
    Randy Webb
    Sep 28, 2006
Loading...

Share This Page