Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xml duplicated field name

Reply
Thread Tools

xml duplicated field name

 
 
sweetpotatop@yahoo.com
Guest
Posts: n/a
 
      06-12-2008
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.
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      06-12-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) 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/
 
Reply With Quote
 
 
 
 
sweetpotatop@yahoo.com
Guest
Posts: n/a
 
      06-12-2008
On Jun 12, 10:37*am, Martin Honnen <(E-Mail Removed)> wrote:
> (E-Mail Removed) 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
 
Reply With Quote
 
Joseph J. Kesselman
Guest
Posts: n/a
 
      06-12-2008
> just <FieldNote />, but not <FieldNote><FieldNote />

http://www.w3.org/TR/REC-xml/#NT-EmptyElemTag
 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      06-12-2008
(E-Mail Removed) 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/
 
Reply With Quote
 
sweetpotatop@yahoo.com
Guest
Posts: n/a
 
      06-12-2008
On Jun 12, 10:58*am, Martin Honnen <(E-Mail Removed)> wrote:
> (E-Mail Removed) 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.
 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      06-12-2008
(E-Mail Removed) 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/
 
Reply With Quote
 
Peter Flynn
Guest
Posts: n/a
 
      06-12-2008
(E-Mail Removed) wrote:
> On Jun 12, 10:58 am, Martin Honnen <(E-Mail Removed)> wrote:
>> (E-Mail Removed) 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Representing duplicated data in XML Charles Packer XML 5 09-06-2008 02:16 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
How to replace string in only one field which could be duplicated in the file waterie@gmail.com Perl Misc 4 11-10-2005 06:16 PM
Read form "name" attribute when it contains form field with name "name" Pavils Jurjans Javascript 3 03-18-2005 01:39 PM
Request.Form("Field Name") Versus Request.QueryString("Field Name") John Davis ASP General 2 08-18-2003 05:00 AM



Advertisments