Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / October 2005

Tip: Looking for answers? Try searching our database.

Can I have the same element declared within itself ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sbeerav@gmail.com - 26 Oct 2005 19:09 GMT
Hi,

I wanted to know if it is legal in XML to declare an element within
itself. For example...

<A>
 This is an element of type A.
  <A>
     This is another element of type A
  </A>
</A>

Thanks,
Sri
Stan Kitsis [MSFT] - 26 Oct 2005 19:13 GMT
Yes, it is legal

Signature

Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> Hi,
>
[quoted text clipped - 10 lines]
> Thanks,
> Sri
Peter Flynn - 27 Oct 2005 00:19 GMT
> Hi,
>
[quoted text clipped - 7 lines]
>    </A>
> </A>

Yes, it is very common.

But be careful with your design above, as it uses Mixed Content,
which is normally only required in text document applications.
Perhaps your labels are not supposed to imply the presence of text,
but it would be more usual for data-oriented applications to use, eg

<A>
 <stuff>This is an element of type A.</stuff>
  <A>
     <stuff>This is another element of type A </stuff>
  </A>
</A>

eg

<!ELEMENT A (stuff,A?)>
<!ELEMENT stuff (#PCDATA)>

///Peter
Signature

XML FAQ: http://xml.silmaril.ie/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.