Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9138623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:16:51+00:00 2026-06-17T09:16:51+00:00

I am writing an XML-sheet in which I manage a list of document types

  • 0

I am writing an XML-sheet in which I manage a list of document types and a list of a document collection. It currently looks like this:

<collection>
    <types>
        <type id="T001">CD</type>
        <type id="T002">Drawing</type>
        <type id="T003">Book</type>
        <type id="T004">Photo</type>
        <type id="T005">Letter</type>
    </types>
    <languages>
        <lang id="EN">English</taal>
        <lang id="FR">French</taal>
    </languages>
    <documents>
        <document>
            <type>T001</type>
            <lang>EN</lang>
        </document>
        <document>
            <type>T003</type>
            <lang>FR</lang>
        </document>
        <document>
            <type>T001</type>
            <lang>EN</lang>
        </document>
        <document>
            <type>T002</type>
            <lang>EN</lang>
        </document>
    <documents>
</collection>

I manage the types and languages lists within the XML sheet instead of using DTD entities so I can query those using XSL / Xpath.

As you can see the and elements are used in two different cases: in the first lists (types / languages) I use them as identifier, and later on I use them as reference element, but with the same node name. I am thinking it’s not very neat using the same node name for both the identifier and the refering element.
What would be another, neater way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:16:52+00:00Added an answer on June 17, 2026 at 9:16 am

    It’s just a matter of convention. Personally, I would change it to:

    <documents>
        <document>
            <typeRef>T001</type>
            <langRef>EN</lang>
            ...
    

    Or:

    <documents>
        <document type="T001" lang="EN">
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an XML document in C#. I have something like this... string
While writing an XML schema, I am attempting to do something like this <xs:complexType
I'm currently writing out xml and have done the following: header (content-type: text/xml); header
I'm writing an XML document based on a stream of data. This part has
I am writing a Xml Tag Renamer class with Java which reads in a
I've used xml type by writing (asp coding) Response.ContentType = text/xml Now xml contents
When writing xml documentation you can use <see cref=something>something</see> , which works of course.
I am currently writing an XML parser that parses a lot of data, with
I'm writing an xml file to be consumed by excel. excel wants this: <Cell><Data
I'm writing xml parser using expat . just saw this : XML_SetElementHandler XML_Parser parser,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.