xml duplicated field name

S

sweetpotatop

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.
 
M

Martin Honnen

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.
 
S

sweetpotatop

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
 
M

Martin Honnen

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.
 
S

sweetpotatop

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.

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.
 
M

Martin Honnen

<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.
 
P

Peter Flynn

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
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top