xml duplicated field name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sweetpotatop@yahoo.com

    #1

    xml duplicated field name

    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>Appr oval</FieldName>

    <FieldNote />

    Thanks in advance. Your advice would be greatly appreciated.
  • Martin Honnen

    #2
    Re: xml duplicated field name

    sweetpotatop@ya hoo.com 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>Appr oval</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/

    Comment

    • sweetpotatop@yahoo.com

      #3
      Re: xml duplicated field name

      On Jun 12, 10:37 am, Martin Honnen <mahotr...@yaho o.dewrote:
      sweetpota...@ya hoo.com 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>Appr oval</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><Fie ldNote />

      Thanks

      Comment

      • Joseph J. Kesselman

        #4
        Re: xml duplicated field name

        just <FieldNote />, but not <FieldNote><Fie ldNote />


        Comment

        • Martin Honnen

          #5
          Re: xml duplicated field name

          sweetpotatop@ya hoo.com wrote:
          Thanks, how about the 2nd elements without the open tag? i.e. with
          just <FieldNote />, but not <FieldNote><Fie ldNote />
          Sorry, I don't understand what you are asking now.
          <FieldNote><Fie ldNote />
          does not make sense, you either need
          <FieldNote></FieldNote>
          or
          <FieldNote><Fie ldNote /></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/

          Comment

          • sweetpotatop@yahoo.com

            #6
            Re: xml duplicated field name

            On Jun 12, 10:58 am, Martin Honnen <mahotr...@yaho o.dewrote:
            sweetpota...@ya hoo.com wrote:
            Thanks, how about the 2nd elements without the open tag? i.e. with
            just <FieldNote />, but not <FieldNote><Fie ldNote />
            >
            Sorry, I don't understand what you are asking now.
               <FieldNote><Fie ldNote />
            does not make sense, you either need
               <FieldNote></FieldNote>
            or
               <FieldNote><Fie ldNote /></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>Appr oval</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.

            Comment

            • Martin Honnen

              #7
              Re: xml duplicated field name

              sweetpotatop@ya hoo.com wrote:
              <FieldNote>0</FieldNote>
              <Date>2/1/2008</Date>
              <EventID>149406 </EventID>
              <EventType>2</EventType>
              <FieldName>Appr oval</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/

              Comment

              • Peter Flynn

                #8
                Re: xml duplicated field name

                sweetpotatop@ya hoo.com wrote:
                On Jun 12, 10:58 am, Martin Honnen <mahotr...@yaho o.dewrote:
                >sweetpota...@y ahoo.com wrote:
                >>Thanks, how about the 2nd elements without the open tag? i.e. with
                >>just <FieldNote />, but not <FieldNote><Fie ldNote />
                >Sorry, I don't understand what you are asking now.
                > <FieldNote><Fie ldNote />
                >does not make sense, you either need
                > <FieldNote></FieldNote>
                >or
                > <FieldNote><Fie ldNote /></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>Appr oval</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/

                Comment

                Working...